/* ★ 11-nov (local · usuario): Mis proyectos / Borradores / Pedidos con la estructura de la cesta (proyectos.js · index.html #viewGuardadas) */
#viewGuardadas:has(.gp) { background: #F8F7F4; }
#viewGuardadas .side-main:has(> .gp) { padding: 0; background: #F8F7F4; }
#viewGuardadas .gp { max-width: none; }

/* ---- buscador y filtros ---- */
.gp-filtros { display: flex; flex-direction: column; gap: 14px; }
.gp-buscar { position: relative; display: block; }
.gp-buscar svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--zi-muted); pointer-events: none; }
#viewGuardadas .gp-buscar input { width: 100%; box-sizing: border-box; min-height: 46px; margin: 0; padding: 0 14px 0 42px; border: 1px solid var(--zi-border); border-radius: 10px; background: #fff; font: 400 15px/20px "Inter", Arial, sans-serif; color: var(--zi-text); }
#viewGuardadas .gp-buscar input:focus { outline: none; border-color: var(--zi-accent); box-shadow: 0 0 0 3px rgba(168, 131, 59, .14); }
#viewGuardadas .gp-filtros .guardadas-estfiltro { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
#viewGuardadas .gp-filtros .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin: 0; padding: 0 14px; border: 1px solid var(--zi-border); border-radius: 999px; background: #fff; color: var(--zi-text); font: 500 13px/18px "Inter", Arial, sans-serif; cursor: pointer; }
#viewGuardadas .gp-filtros .chip:hover { background: var(--zi-soft); }
#viewGuardadas .gp-filtros .chip.is-active { background: var(--zi-accent); border-color: var(--zi-accent); color: #fff; }
#viewGuardadas .gp-filtros .chip__n { font-weight: 600; font-size: 12px; opacity: .75; }
#viewGuardadas .gp-filtros .chip__n:empty { display: none; }

/* ---- recuadro de la lista ---- */
.gp-lista-card .zp-bloque__cab { margin-bottom: 4px; }
.gp-n { color: var(--zi-muted); font-size: 13px; margin-left: 8px; font-weight: 400; }
.gp-cab-acc { display: flex; align-items: center; gap: 8px; }
#viewGuardadas .gp-cat { min-height: 40px; padding: 0 18px; font-size: 14px; }
#guardadasList.gp-lista { display: flex; flex-direction: column; margin: 0; padding: 0; }
#guardadasVacia.gp-vacio { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 12px 0 0; padding: 28px 16px; border: 1px dashed var(--zi-border); border-radius: 12px; background: none; text-align: center; color: var(--zi-muted); font-size: 14px; line-height: 20px; }
#guardadasVacia.gp-vacio::before { content: ""; width: 56px; height: 56px; border-radius: 50%; background: var(--zi-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23191816' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / 24px no-repeat; }
#guardadasVacia.gp-vacio[hidden] { display: none; }

/* ---- cada proyecto: una línea como la de la cesta ---- */
.guardada.gp-lin { display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-areas: "foto top" "det det"; align-items: start; gap: 0 20px; margin: 0; padding: 18px 0; border: 0; border-top: 1px solid var(--zi-border); border-radius: 0; background: none; box-shadow: none; }
.guardada.gp-lin:first-child { border-top: 0; }
.gp-lin:not(.guardada--col) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "det"; }
.gp-lin > .guardada__col { grid-area: foto; flex: none; width: 112px; max-width: none; height: 84px; aspect-ratio: auto; border-radius: 10px; overflow: hidden; background: var(--zi-soft); }
.gp-lin__top { grid-area: top; display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; grid-template-areas: "id precio acc"; align-items: center; gap: 12px 20px; min-width: 0; }
.gp-lin__id { grid-area: id; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gp-lin__ref { font: 500 11.5px/16px "Inter", Arial, sans-serif; letter-spacing: .4px; color: var(--zi-muted); }
.gp-lin__nom { margin: 0; font: 600 17px/24px "Inter", Arial, sans-serif; color: var(--zi-text); overflow-wrap: anywhere; }
.guardada--anulada .gp-lin__nom { text-decoration: line-through; }
.gp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 0; }
.gp-lin .ct-chip, .gp-mue .ct-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; background: var(--zi-soft); color: var(--zi-text); font: 500 12px/16px "Inter", Arial, sans-serif; margin: 0; }
.gp-lin .ct-chip--arch, .gp-mue .ct-chip--arch { background: var(--zi-selected); }
.gp-lin .guardada__estado { align-self: center; margin: 0; min-height: 24px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; border: 1px solid transparent; font: 600 11px/16px "Inter", Arial, sans-serif; letter-spacing: .4px; text-transform: uppercase; }
.gp-lin .guardada__vend { margin: 0; }
.gp-chip--carga { background: #F3ECDD !important; color: #7a5d18 !important; }
.gp-lin .inc-tag { align-self: center; }
.gp-prog { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-width: 420px; }
.gp-prog__barra { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.gp-prog__barra i { height: 5px; border-radius: 3px; background: var(--zi-border); }
.gp-prog__barra i.is-done { background: #4f7a52; }
.gp-prog__barra i.is-cur { background: var(--zi-accent); }
.gp-prog small { color: var(--zi-muted); font-size: 12.5px; line-height: 18px; }
.gp-aviso { margin: 4px 0 0; font-size: 12.5px; }
.gp-lin__precio { grid-area: precio; text-align: right; }
.gp-lbl { display: block; margin-bottom: 4px; font: 400 12px/16px "Inter", Arial, sans-serif; color: var(--zi-muted); white-space: nowrap; }
.gp-lin__precio b { display: block; font: 600 17px/24px "Inter", Arial, sans-serif; color: var(--zi-text); white-space: nowrap; }
.gp-lin__precio small { display: block; color: var(--zi-muted); font-size: 12px; line-height: 16px; }
.gp-lin .guardada__acc { grid-area: acc; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; max-width: 300px; margin: 0; padding: 0; border: 0; }
.gp-lin .gp-btn, .gp-lin .inc-pedido-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; margin: 0; padding: 0 14px; border: 1px solid var(--zi-accent); border-radius: 999px; background: #fff; color: var(--zi-accent) !important; font: 500 13.5px/18px "Inter", Arial, sans-serif; cursor: pointer; white-space: nowrap; box-shadow: none; }
.gp-lin .gp-btn:hover, .gp-lin .inc-pedido-btn:hover { background: var(--zi-soft); }
.gp-lin .gp-btn--pri { background: var(--zi-accent); color: #fff !important; }
.gp-lin .gp-btn--pri:hover { background: var(--zi-accent-h); border-color: var(--zi-accent-h); }
.gp-lin .gp-btn--peligro { border-color: #c9a3a3; color: #8a3232 !important; }
.gp-lin .gp-btn--peligro:hover { background: #f6eaea; }
.gp-lin .gp-ico { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin: 0; padding: 0; border: 1px solid var(--zi-border); border-radius: 50%; background: #fff; color: var(--zi-muted); font-size: 15px; cursor: pointer; }
.gp-lin .gp-ico:hover { background: #f6eaea; color: #8a3232; border-color: #e8cccc; }

/* desplegables («Ver muebles del proyecto» y, dentro, «Ver opciones elegidas»): como en la cesta */
.gp-lin__det { grid-area: det; margin: 12px 0 0 132px; background: none; padding: 0; border-radius: 0; }
.gp-lin:not(.guardada--col) .gp-lin__det { margin-left: 0; }
.gp-lin__det > summary, .gp-mue__det > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--zi-soft); color: var(--zi-text); font: 500 13.5px/18px "Inter", Arial, sans-serif; cursor: pointer; list-style: none; user-select: none; }
.gp-lin__det > summary::-webkit-details-marker, .gp-mue__det > summary::-webkit-details-marker { display: none; }
.gp-lin__det > summary::after, .gp-mue__det > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.gp-lin__det[open] > summary::after, .gp-mue__det[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.gp-lin__det > summary:hover, .gp-mue__det > summary:hover { background: var(--zi-selected); }
.gp-ocu, .gp-lin__det[open] > summary .gp-ver, .gp-mue__det[open] > summary .gp-ver { display: none; }
.gp-lin__det[open] > summary .gp-ocu, .gp-mue__det[open] > summary .gp-ocu { display: inline; }
.gp-lin__cuerpo { margin-top: 12px; padding: 4px 16px 16px; border: 1px solid var(--zi-border); border-radius: 10px; background: #FCFBF9; display: flex; flex-direction: column; gap: 16px; }
.gp-txt { margin: 0; font-size: 14px; line-height: 20px; color: var(--zi-text); overflow-wrap: anywhere; }
.gp-nota { margin: 0; font-size: 13px; line-height: 19px; color: var(--zi-muted); }
.gp-lin .guardada__estudio { margin: 0; }
.gp-lin .seguimiento { margin: 0; }

/* cada mueble dentro del proyecto */
.gp-mues { display: flex; flex-direction: column; }
.gp-mue { padding: 14px 0; border-top: 1px solid var(--zi-border); }
.gp-mue:first-child { border-top: 0; }
.gp-mue__top { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto 140px; grid-template-areas: "foto id cant precio"; align-items: center; gap: 10px 18px; }
.gp-mue__foto { grid-area: foto; width: 80px; height: 60px; border-radius: 8px; background: var(--zi-soft); overflow: hidden; display: grid; place-items: center; color: #8a857c; }
.gp-mue__foto img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gp-mue__id { grid-area: id; min-width: 0; }
.gp-mue__ref { display: block; font: 500 11px/16px "Inter", Arial, sans-serif; letter-spacing: .4px; color: var(--zi-muted); }
.gp-mue__nom { margin: 0; font: 600 15px/22px "Inter", Arial, sans-serif; color: var(--zi-text); overflow-wrap: anywhere; }
.gp-mue__med { margin: 2px 0 0; color: var(--zi-muted); font-size: 13px; line-height: 18px; }
.gp-mue__cant { grid-area: cant; text-align: center; }
.gp-mue__cant b { font: 600 15px/22px "Inter", Arial, sans-serif; }
.gp-mue__precio { grid-area: precio; text-align: right; }
.gp-mue__precio b { font: 600 15px/22px "Inter", Arial, sans-serif; color: var(--zi-text); white-space: nowrap; }
.gp-mue__det { margin: 10px 0 0 98px; }
.gp-mue__cuerpo { margin-top: 10px; padding: 14px; border: 1px solid var(--zi-border); border-radius: 10px; background: #fff; display: flex; flex-direction: column; gap: 14px; }
/* las opciones agrupadas por pasos: mismas reglas que la cesta (cesta.css va con #viewCesta) */
.gp-mue .ct-pasos { display: flex; flex-direction: column; gap: 18px; }
.gp-mue .ct-paso__t { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--zi-border); font: 600 14px/20px "Inter", Arial, sans-serif; color: var(--zi-text); }
.gp-mue .ct-paso__n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--zi-soft); font: 600 12px/1 "Inter", Arial, sans-serif; }
.gp-mue .ct-ops { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.gp-mue .ct-ops li { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--zi-border); font-size: 14px; line-height: 20px; }
.gp-mue .ct-paso .ct-ops li:last-child, .gp-mue .ct-paso .ct-ops li:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.gp-mue .ct-op__k { color: var(--zi-muted); }
.gp-mue .ct-op__v { color: var(--zi-text); overflow-wrap: anywhere; }
.gp-lin .ct-incluye { margin: 0; font-size: 13.5px; line-height: 20px; color: var(--zi-text); }
.gp-lin .ct-bloque { display: flex; flex-direction: column; gap: 8px; }
.gp-lin .ct-h4 { margin: 0; font: 600 14px/20px "Inter", Arial, sans-serif; color: var(--zi-text); }
.gp-desg { list-style: none; margin: 0; padding: 0; max-width: 360px; }
.gp-desg li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--zi-border); font-size: 14px; }
.gp-desg li span { color: var(--zi-muted); }
.gp-desg li.gp-desg__tot { border-bottom: 0; font-weight: 600; }
.gp-desg li.gp-desg__tot span { color: var(--zi-text); }

@media (max-width: 1199px) {
  .gp-lin__top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id precio" "acc acc"; }
  .gp-lin .guardada__acc { justify-content: flex-start; max-width: none; }
}
@media (max-width: 899px) {
  .gp-mue .ct-ops { grid-template-columns: minmax(0, 1fr); }
  .gp-mue .ct-paso .ct-ops li:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--zi-border); }
  .gp-mue__top { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "foto id id" "foto cant precio"; }
  .gp-mue__foto { width: 64px; height: 50px; align-self: start; }
  .gp-mue__cant { text-align: left; }
  .gp-mue__det { margin-left: 82px; }
}
@media (max-width: 767px) {
  #viewGuardadas .zp-miesp { padding: 20px 16px 32px; gap: 16px; }
  #viewGuardadas .zp-tit { font-size: 30px !important; line-height: 38px !important; }
}
@media (max-width: 599px) {
  .guardada.gp-lin { grid-template-columns: 72px minmax(0, 1fr); gap: 0 12px; }
  .gp-lin > .guardada__col { width: 72px; height: 56px; }
  .gp-lin__top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "id" "precio" "acc"; gap: 10px; }
  .gp-lin__precio { text-align: left; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
  .gp-lin__precio .gp-lbl { margin: 0; }
  .gp-lin__precio b, .gp-lin__precio small { display: inline; }
  .gp-lin .guardada__acc { grid-column: 1 / -1; }
  .gp-lin__det { margin-left: 0; }
  .gp-lin__det > summary, .gp-mue__det > summary { width: 100%; justify-content: center; box-sizing: border-box; }
  .gp-lin__cuerpo { padding: 4px 12px 12px; }
  .gp-mue__top { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "foto id" "cant precio"; gap: 8px 12px; }
  .gp-mue__foto { width: 56px; height: 44px; }
  .gp-mue__det { margin-left: 0; }
  .gp-mue .ct-ops li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gp-cab-acc { width: 100%; }
  #viewGuardadas .gp-lista-card .zp-bloque__cab { flex-wrap: wrap; }
}
#viewGuardadas .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* ★ 12-nov: miniatura de cada producto = su celda del collage (collage.js · znMiniMueble) */
.gp-mue__foto--col { background: #F3EFE8; }
.gp-mue__foto--col > .zcol__c { width: 100%; height: 100%; }
