/* ==========================================================
   Magnificat Atelier — Colección y telas
   (páginas pintadas por js/catalogo.js a partir de data/*.json)
   ========================================================== */

.tienda {
  padding: clamp(7.5rem, 13vw, 10rem) 0 clamp(4.5rem, 9vw, 7rem);
  background: var(--cream);
  min-height: 70vh;
}
.tienda-intro { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.tienda-intro h1 { font-size: clamp(3rem, 2rem + 4.4vw, 5.6rem); }
.tienda-lead {
  max-width: 34em;
  margin: 1.4rem 0 0;
  font-family: var(--serif-display);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  line-height: 1.45;
  color: var(--muted);
}
.tienda-cargando, .tienda-error { color: var(--muted); font-style: italic; }
.tienda-nota {
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  max-width: 36em;
  text-align: center;
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--muted);
}
.page-tienda .button-ghost { color: var(--gold); background: transparent; }
.page-tienda .button-ghost:hover,
.page-tienda .button-ghost:focus-visible { color: var(--paper); background: var(--gold); }
.page-tienda .button { margin-top: 0; padding: 0.85rem 1.8rem; font-size: 0.78rem; }

/* ---------- Aviso de medidas del maniquí ---------- */
.medidas-aviso {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.2rem 1.6rem;
  background: var(--paper);
  border: 1px solid var(--line);
}
.medidas-aviso p { margin: 0; max-width: 40em; color: var(--muted); }
.medidas-aviso label { display: flex; align-items: center; gap: 0.8rem; cursor: pointer; }
.medidas-aviso input { width: 1.1rem; height: 1.1rem; accent-color: var(--gold); flex: none; }
.medidas-aviso > a:not(.button) { color: var(--muted); text-underline-offset: 0.25em; text-decoration-color: var(--gold-soft); }

/* ---------- Categorías ---------- */
.cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2rem 0 0;
}
.cat-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--line);
  font-family: var(--serif-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .4s var(--ease), color .4s var(--ease);
}
.cat-nav a span { color: var(--gold); letter-spacing: 0; }
.cat-nav a:hover, .cat-nav a:focus-visible { background: var(--night); color: var(--on-night); }
.categoria {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 3fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 5rem;
}
.categoria-head { position: sticky; top: 6rem; }
.categoria-head h2 { font-size: clamp(2.2rem, 1.6rem + 2.2vw, 3.4rem); }
.categoria-head p { margin: 0.8rem 0 0; color: var(--muted); font-style: italic; }

/* ---------- Prendas ---------- */
.prendas, .telas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: clamp(1.2rem, 2.4vw, 2rem);
}
.prenda, .tela {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 30px 50px -44px rgba(70, 50, 25, 0.6);
  scroll-margin-top: 6rem;
}
.prenda:target, .tela:target { outline: 1px solid var(--gold); outline-offset: 4px; }
.prenda-media, .tela-media { position: relative; }
.estado {
  position: absolute;
  left: 1rem; top: 1rem;
  padding: 0.3rem 0.8rem;
  background: var(--night);
  color: var(--on-night);
  font-family: var(--serif-display);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.is-disponible .prenda-media .estado { background: var(--gold); color: var(--paper); }

/* boceto sobre papel de patronaje */
.boceto {
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  background-color: #f7f1e4;
  background-image:
    linear-gradient(rgba(169, 138, 88, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 138, 88, 0.14) 1px, transparent 1px),
    linear-gradient(rgba(169, 138, 88, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 138, 88, 0.06) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
  border-bottom: 1px solid var(--line);
}
.boceto svg { width: 74%; height: auto; overflow: visible; transition: transform .8s var(--ease); }
.prenda:hover .boceto svg { transform: scale(1.04); }
.boceto path { fill: rgba(255, 253, 248, 0.75); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.boceto path.fino { fill: none; stroke-width: 0.9; stroke: var(--muted); }
.boceto path.punto { stroke-width: 3; stroke: var(--gold); }
.boceto path.discontinuo { stroke-dasharray: 4 5; }
.boceto-m { font-family: var(--script); font-size: 17px; fill: var(--gold); }

.prenda-foto img, .tela-media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.prenda-thumbs { display: flex; gap: 0.4rem; padding: 0.5rem; }
.prenda-thumbs button { padding: 0; border: 1px solid transparent; background: none; cursor: pointer; width: 52px; }
.prenda-thumbs button[aria-pressed="true"] { border-color: var(--gold); }
.prenda-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tela-vacia { aspect-ratio: 4 / 5; background: var(--linen); }

.prenda-body, .tela-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  flex: 1;
  padding: 1.5rem 1.5rem 1.7rem;
}
.prenda-body h3, .tela-body h3 { font-size: clamp(1.7rem, 1.4rem + 0.8vw, 2.1rem); font-weight: 300; }
.prenda-desc { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.tela-tipo {
  margin: 0;
  font-family: var(--serif-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}
.ficha { width: 100%; margin: 0; border-top: 1px solid var(--line); }
.ficha > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.98rem; }
.ficha dt {
  font-family: var(--serif-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.25rem;
}
.ficha dd { margin: 0; text-align: right; }
.precio { margin: 0; font-family: var(--serif-display); font-size: 1.7rem; font-weight: 400; line-height: 1; }
.precio span { font-size: 0.95rem; color: var(--muted); font-style: italic; }
.prenda-body > .button, .tela-body > .button { margin-top: auto; }
.prenda-talla { margin: 0; color: var(--gold); }
.prenda-tallas { width: 100%; }
.prenda-tallas summary {
  cursor: pointer;
  font-family: var(--serif-display);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.tallas-wrap { overflow-x: auto; margin-top: 0.8rem; }
.tallas { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tallas caption { caption-side: bottom; padding-top: 0.5rem; font-size: 0.82rem; font-style: italic; color: var(--muted); text-align: left; }
.tallas th, .tallas td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.tallas thead th { font-family: var(--serif-display); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }

/* ---------- Telas ---------- */
.colaboradora {
  display: grid;
  gap: 0.8rem;
  justify-items: start;
  padding: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: clamp(2rem, 4vw, 3rem);
  background: var(--night);
  color: var(--on-night);
}
.colaboradora .eyebrow { margin: 0; color: var(--gold-soft); }
.colaboradora h2 { color: var(--on-night); font-size: clamp(2rem, 1.5rem + 1.8vw, 3rem); }
.colaboradora p { margin: 0; max-width: 44em; color: var(--on-night-muted); }
.colaboradora-nota { font-size: 0.92rem; font-style: italic; }
.colaboradora .button-ghost { color: var(--gold-soft); border-color: var(--gold-soft); }
.colaboradora .button-ghost:hover, .colaboradora .button-ghost:focus-visible { background: var(--gold-soft); color: var(--night); }
.filtros { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.6rem; }
.filtros button {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif-display);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.filtros button[aria-pressed="true"] { background: var(--night); color: var(--on-night); border-color: var(--night); }
.tela.is-agotado .tela-media img { filter: grayscale(0.5) opacity(0.7); }
.tienda-vacia {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.5rem) clamp(1.6rem, 6vw, 4rem);
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
}
.tienda-vacia h2 { margin-bottom: 1.2rem; }
.tienda-vacia p:not(.eyebrow) { margin: 0 auto 2rem; max-width: 28em; color: var(--muted); }
.demo-aviso {
  margin: 0 0 1.6rem;
  padding: 0.7rem 1.1rem;
  border: 1px dashed var(--gold);
  color: var(--muted);
  font-style: italic;
  font-size: 0.95rem;
}
[hidden] { display: none !important; }

@media (max-width: 640px) {
  .medidas-aviso { padding: 1rem 1.1rem; }
}
@media (max-width: 860px) {
  .categoria { grid-template-columns: 1fr; gap: 1.4rem; }
  .categoria-head { position: static; }
}

/* ==========================================================
   Cuenta, cesta y formularios
   ========================================================== */
.panel {
  padding: clamp(1.4rem, 3vw, 2.2rem);
  background: var(--paper);
  border: 1px solid var(--line);
}
.panel h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin-bottom: 1rem; }
.panel-estrecho { max-width: 520px; }
.panel-texto { margin: 0 0 1.2rem; color: var(--muted); }
.panel-nota { margin: 1rem 0 0; font-size: 0.95rem; color: var(--muted); }
.panel-nota a, .panel-texto a { color: var(--ink); text-decoration-color: var(--gold-soft); text-underline-offset: 0.2em; }
.panel-acciones { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }
.acceso, .cuenta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 2.4vw, 2rem); align-items: start; }
.cuenta-grid, .tienda-cuerpo > .panel { margin-top: clamp(1rem, 2.4vw, 2rem); }
.cuenta-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.cuenta-cab p { margin: 0; font-family: var(--serif-display); font-size: 1.5rem; }
.cuenta-cab .panel-acciones { margin: 0; }

.form { display: grid; gap: 1rem; }
.campo { display: grid; gap: 0.35rem; }
.campo label, .opciones legend {
  font-family: var(--serif-display);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.campo input, .campo textarea, .campo select, .compra select, .compra input, .cesta-cantidad input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
}
.campo input:focus, .campo textarea:focus, .campo select:focus, .compra select:focus, .compra input:focus { outline: 1px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.campo textarea { resize: vertical; min-height: 5rem; }
.campo-ayuda { margin: 0; font-size: 0.88rem; color: var(--muted); }
.check { display: flex; align-items: flex-start; gap: 0.7rem; cursor: pointer; line-height: 1.45; }
.check input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; accent-color: var(--gold); flex: none; }
.check a { color: var(--ink); text-decoration-color: var(--gold-soft); text-underline-offset: 0.2em; }
.opciones { margin: 0; padding: 0; border: 0; display: grid; gap: 0.5rem; }
.opciones legend { padding: 0; margin-bottom: 0.5rem; }
.form .button { justify-self: start; cursor: pointer; }
.form .button:disabled { opacity: 0.55; cursor: progress; }
.form-aviso { margin: 0; padding: 0.7rem 1rem; border-left: 2px solid var(--gold); background: rgba(169, 138, 88, 0.1); }
.form-aviso.is-error { border-color: #a4432e; background: rgba(164, 67, 46, 0.08); color: #7c2f1f; }
.form-baja .button { background: transparent; color: #7c2f1f; border-color: #a4432e; }
.form-baja .button:hover { background: #a4432e; color: var(--paper); }
button.button { cursor: pointer; font-family: var(--serif-display); }

/* pedidos del cliente */
.pedidos { display: grid; gap: 0.6rem; }
.pedido { border: 1px solid var(--line); background: #fffdf8; }
.pedido-cab {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto 1fr 1fr;
  gap: 0.8rem;
  align-items: center;
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.pedido-num { font-family: var(--serif-display); font-size: 1.2rem; }
.pedido-total { text-align: right; font-family: var(--serif-display); font-size: 1.2rem; }
.pedido-pago { text-align: right; font-size: 0.9rem; color: var(--muted); }
.pedido-detalle { padding: 0 1.1rem 1.2rem; border-top: 1px solid var(--line); }
.pedido-lineas { list-style: none; margin: 0; padding: 0.6rem 0; }
.pedido-lineas li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.pedido-lineas em { color: var(--muted); }
.pedido-extra { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.95rem; }
.pedido-pasos { list-style: none; margin: 1.2rem 0 0; padding: 0 0 0 1.2rem; border-left: 1px solid var(--gold-soft); display: grid; gap: 0.8rem; }
.pedido-pasos li { position: relative; display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; align-items: baseline; }
.pedido-pasos li::before { content: ""; position: absolute; left: calc(-1.2rem - 3.5px); top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.pedido-pasos span { font-size: 0.9rem; color: var(--muted); }
.pedido-pasos p { flex-basis: 100%; margin: 0; color: var(--muted); }
.chip {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--line);
  font-family: var(--serif-display);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip-solicitado { background: rgba(169, 138, 88, 0.14); }
.chip-confirmado, .chip-en_confeccion, .chip-listo, .chip-enviado { background: var(--night); color: var(--on-night); border-color: var(--night); }
.chip-entregado { background: var(--gold); color: var(--paper); border-color: var(--gold); }
.chip-cancelado { color: var(--muted); text-decoration: line-through; }
.medidas-ficha { columns: 2; column-gap: 2rem; border-top: 0; }
.medidas-ficha > div { break-inside: avoid; }

/* cesta */
.cesta { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(1.2rem, 3vw, 2.5rem); align-items: start; }
.cesta-lista { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cesta-item { display: grid; grid-template-columns: 72px 1fr auto auto auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.cesta-item img, .cesta-sinfoto { width: 72px; height: 90px; object-fit: cover; background: var(--linen); }
.cesta-sinfoto { display: grid; place-items: center; font-family: var(--script); font-size: 2rem; color: var(--gold); }
.cesta-info h3 { font-size: 1.4rem; font-weight: 400; }
.cesta-info h3 a { text-decoration: none; }
.cesta-info p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.95rem; }
.cesta-cantidad { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.cesta-cantidad input { width: 4.6rem; padding: 0.45rem 0.5rem; text-align: center; }
.cesta-precio { margin: 0; min-width: 5.5rem; text-align: right; font-family: var(--serif-display); font-size: 1.25rem; }
.cesta-quitar { width: 2rem; height: 2rem; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.cesta-quitar:hover { color: #7c2f1f; border-color: #a4432e; }
.cesta-total { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0.3rem 1rem; padding: 1.2rem 0; }
.cesta-total span { font-family: var(--serif-display); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.cesta-total strong { font-family: var(--serif-display); font-size: 2rem; font-weight: 400; }
.cesta-total p { grid-column: 1 / -1; margin: 0; font-size: 0.92rem; color: var(--muted); }

/* compra en la ficha de prenda o tela */
.compra { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: stretch; width: 100%; margin-top: auto; }
.compra select { flex: 1 1 9rem; width: auto; }
.compra .metros { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.compra .metros input { width: 5rem; text-align: center; }
.cesta-aviso {
  position: fixed;
  left: 50%; bottom: 1.5rem;
  z-index: 70;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  max-width: calc(100vw - 2rem);
  padding: 0.9rem 1.3rem;
  background: var(--night);
  color: var(--on-night);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, 160%);
  transition: transform .5s var(--ease);
}
.cesta-aviso.is-visible { transform: translate(-50%, 0); }
.cesta-aviso a { color: var(--gold-soft); white-space: nowrap; text-underline-offset: 0.2em; }

@media (max-width: 860px) {
  .acceso, .cuenta-grid, .cesta { grid-template-columns: 1fr; }
  .pedido-cab { grid-template-columns: 1fr auto; }
  .pedido-total, .pedido-pago { text-align: left; }
  .cesta-item { grid-template-columns: 56px 1fr auto; }
  .cesta-item img, .cesta-sinfoto { width: 56px; height: 70px; }
  .cesta-precio { grid-column: 2; text-align: left; }
  .cesta-cantidad { grid-column: 2; }
  .cesta-quitar { grid-row: 1; grid-column: 3; }
  .medidas-ficha { columns: 1; }
}

/* acceso: pestañas iniciar sesión / crear cuenta */
.acceso-unico { max-width: 520px; }
.pestanas { display: flex; border-bottom: 1px solid var(--line); }
.pestana {
  flex: 1;
  padding: 0.9rem 1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--muted);
  font-family: var(--serif-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
}
.pestana[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.pestana:focus-visible { outline: 1px solid var(--gold); outline-offset: -1px; }
.acceso-unico .panel { border-top: 0; max-width: none; }
.panel-cambio { margin: 1.4rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); text-align: center; }
.panel-cambio a { color: var(--gold); text-underline-offset: 0.2em; }

/* facturas y protección de datos */
.info-datos { font-size: 0.85rem; line-height: 1.5; }
.datos-fiscales { display: grid; gap: 0.9rem; }
.facturas-lista { list-style: none; margin: 0; padding: 0; }
.facturas-lista li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 0.8rem; align-items: baseline; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.facturas-lista a { font-weight: 600; color: var(--ink); text-decoration-color: var(--gold-soft); text-underline-offset: 0.2em; }
@media (max-width: 560px) { .facturas-lista li { grid-template-columns: 1fr auto; } .facturas-lista li span:nth-child(2) { display: none; } }
.codigo-vale { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.92em; letter-spacing: 0.03em; }
