/* Tesoritos pañalera
   Talco, tinta y agua vienen del turquesa de la tienda; durazno, del logo.
   Sol marca lo elegido y las ofertas; frutilla, lo que no hay. */
:root {
  --talco: #F3F8F7;
  --blanco: #FFFFFF;
  --tinta: #17304A;
  --tinta-suave: #51667B;
  --agua: #22C3B1;
  --agua-fuerte: #0A7D73;
  --agua-honda: #086158;
  --durazno: #FFDCC7;
  --sol: #FFD23F;
  --frutilla: #C92C52;
  --linea: #D5E3E0;

  --titulo: 'Baloo 2', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --texto: 'Albert Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --alto-cabecera: 68px;
  --alto-rubros: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--talco);
  color: var(--tinta);
  font: 400 1rem/1.5 var(--texto);
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--tinta); outline-offset: 2px; border-radius: 6px; }

.ancho { width: min(100% - 2rem, 1240px); margin-inline: auto; }

.solo-lector {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  padding: .6rem 1rem; background: var(--tinta); color: var(--blanco); border-radius: 10px;
}
.saltar:focus { top: .75rem; }

/* ---------- Botones ---------- */

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .5rem 1.1rem;
  border: 0; border-radius: 14px;
  background: var(--agua-fuerte); color: var(--blanco);
  font-weight: 600; text-decoration: none;
}
.boton:hover { background: var(--agua-honda); }
.boton[disabled] { background: var(--linea); color: var(--tinta-suave); cursor: not-allowed; }
.boton-suave { background: var(--blanco); color: var(--tinta); box-shadow: inset 0 0 0 1.5px var(--tinta); }
.boton-suave:hover { background: var(--tinta); color: var(--blanco); }
.boton-ancho { width: 100%; }

.enlace { background: none; border: 0; padding: 0; color: var(--agua-fuerte); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.enlace:hover { color: var(--tinta); }

/* ---------- Cabecera ---------- */

.cabecera { background: var(--blanco); border-bottom: 1px solid var(--linea); }
.cabecera-fila {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem 1.25rem;
  min-height: var(--alto-cabecera); padding-block: .6rem;
}

.marca { display: flex; flex-direction: column; text-decoration: none; line-height: 1; }
.marca-nombre { font: 800 1.9rem/0.9 var(--titulo); letter-spacing: -0.01em; }
.marca-rubro { font-size: .8125rem; font-weight: 600; color: var(--agua-fuerte); padding-left: 2px; }

.buscador { position: relative; max-width: 520px; width: 100%; justify-self: center; }
.buscador input {
  width: 100%; height: 44px; padding: 0 1rem 0 2.75rem;
  border: 1.5px solid var(--linea); border-radius: 22px; background: var(--talco);
}
.buscador input::placeholder { color: var(--tinta-suave); }
.buscador input:focus { outline: none; border-color: var(--tinta); background: var(--blanco); }
.buscador-lupa {
  position: absolute; left: .9rem; top: 50%; width: 20px; height: 20px; translate: 0 -50%;
  fill: none; stroke: var(--tinta-suave); stroke-width: 2.2; stroke-linecap: round; pointer-events: none;
}

.boton-pedido {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1.1rem;
  border: 0; border-radius: 22px; background: var(--sol); font-weight: 700;
}
.boton-pedido:hover { background: var(--tinta); color: var(--blanco); }
.boton-pedido-cantidad {
  min-width: 1.5rem; padding: 0 .4rem; border-radius: 1rem;
  background: var(--tinta); color: var(--blanco); font-size: .875rem; line-height: 1.5rem; text-align: center;
}
.boton-pedido:hover .boton-pedido-cantidad { background: var(--sol); color: var(--tinta); }

/* ---------- Talles: la escalera ---------- */

.talles { background: var(--agua); padding-top: clamp(2rem, 6vw, 4.5rem); overflow: hidden; }
.talles h1 {
  font: 800 clamp(3rem, 9.5vw, 6.5rem)/0.92 var(--titulo); letter-spacing: -0.02em;
  max-width: 12ch;
}
.talles-bajada { margin-top: 1rem; max-width: 38ch; font-size: 1.125rem; font-weight: 500; }

.escalera {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem;
  margin-top: 1.75rem; padding-bottom: 1.5rem;
}

.talle {
  display: flex; flex-direction: column; justify-content: space-between; gap: .35rem;
  min-height: 96px; padding: .6rem .65rem .65rem;
  background: var(--blanco); border-radius: 16px; text-decoration: none;
}
.talle:hover, .talle[aria-current='true'] { background: var(--sol); }
.talle-letra { font: 800 clamp(1.25rem, 6.2vw, 1.7rem)/0.9 var(--titulo); letter-spacing: -0.02em; }
.talle-nombre { display: none; font-size: .875rem; font-weight: 600; line-height: 1.25; }
.talle-dato { font-size: .75rem; line-height: 1.25; color: var(--tinta-suave); }
.talle-dato b { display: block; font: 700 1.0625rem/1.1 var(--titulo); color: var(--tinta); }
.talle:hover .talle-dato, .talle[aria-current='true'] .talle-dato { color: var(--tinta); }
.talle-todos .talle-letra { font-size: 1.25rem; line-height: 1; }

@media (min-width: 860px) {
  .escalera {
    grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: .75rem;
    margin-top: 2.5rem; padding-bottom: 0;
  }
  /* Cada talle es un escalón más alto que el anterior. */
  .talle {
    min-height: calc(150px + var(--paso) * 26px);
    padding: 1.1rem 1.1rem 1.25rem; border-radius: 24px 24px 0 0;
  }
  .talle-letra { font-size: clamp(2.1rem, 3.5vw, 3rem); }
  .talle-nombre { display: block; margin-top: .4rem; }
  .talle-dato { font-size: .8125rem; }
  .talle-dato b { font-size: 1.375rem; }
  .talle-todos { display: none; }

  @media (prefers-reduced-motion: no-preference) {
    .talle { animation: crecer .6s cubic-bezier(.2, .9, .3, 1) backwards; animation-delay: calc(var(--paso) * 70ms); }
  }
}

@keyframes crecer { from { transform: translateY(100%); } }

/* ---------- Cómo comprar ---------- */

.datos { background: var(--durazno); }
.datos-lista { display: grid; gap: .75rem 2.5rem; padding-block: 1.25rem; font-size: .9375rem; line-height: 1.45; }
.datos-lista strong { display: block; font: 700 1.125rem/1.3 var(--titulo); }
@media (min-width: 760px) { .datos-lista { grid-template-columns: repeat(3, 1fr); padding-block: 1.5rem; } }

/* ---------- Catálogo ---------- */

.catalogo { scroll-margin-top: 0; padding-bottom: 5rem; }

.rubros { position: sticky; top: 0; z-index: 20; background: var(--talco); border-bottom: 1px solid var(--linea); }
.rubros-fila {
  display: flex; gap: .35rem; align-items: center; min-height: var(--alto-rubros);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.rubros-fila::-webkit-scrollbar { display: none; }

.rubro {
  flex: none; min-height: 40px; padding: 0 .95rem;
  border: 0; border-radius: 20px; background: transparent;
  font-weight: 600; white-space: nowrap;
}
.rubro:hover { background: var(--blanco); }
.rubro[aria-current='true'] { background: var(--tinta); color: var(--blanco); }
.rubro-ofertas[aria-current='false'] { box-shadow: inset 0 0 0 2px var(--sol); background: var(--blanco); }
.rubro-buscar { display: inline-flex; align-items: center; gap: .4rem; background: var(--blanco); box-shadow: inset 0 0 0 1.5px var(--linea); }
.rubro-buscar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
@media (min-width: 760px) { .rubro-buscar { display: none; } }

.vista-cabeza { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem 1.5rem; padding-top: 2rem; }
.vista-cabeza h2 { font: 800 clamp(2rem, 5vw, 3rem)/1 var(--titulo); letter-spacing: -0.015em; }
.vista-conteo { margin-top: .35rem; color: var(--tinta-suave); }

.orden { display: flex; align-items: center; gap: .5rem; font-size: .9375rem; color: var(--tinta-suave); }
.orden select {
  height: 40px; padding: 0 2rem 0 .8rem; border: 1.5px solid var(--linea); border-radius: 12px;
  background: var(--blanco) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2317304A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .7rem center / 12px;
  appearance: none; color: var(--tinta); font-weight: 600;
}

.filtros { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.filtros[hidden] { display: none; }

.chip {
  min-height: 36px; padding: 0 .8rem;
  border: 1.5px solid var(--linea); border-radius: 18px; background: var(--blanco);
  font-size: .9375rem; font-weight: 600; white-space: nowrap;
}
.chip:hover { border-color: var(--tinta); }
.chip[aria-pressed='true'] { background: var(--tinta); border-color: var(--tinta); color: var(--blanco); }
.chip small { font-weight: 500; color: var(--tinta-suave); margin-left: .2rem; }
.chip[aria-pressed='true'] small { color: inherit; opacity: .75; }
#filtros-talle .chip { font-family: var(--titulo); font-size: 1.0625rem; font-weight: 700; min-width: 48px; }

.grilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem .75rem; margin-top: 1.5rem; }
@media (min-width: 620px) { .grilla { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.25rem 1.25rem; } }
@media (min-width: 900px) { .grilla { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1160px) { .grilla { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.ver-mas { display: flex; margin: 2.5rem auto 0; }
.ver-mas[hidden] { display: none; }

.vacio { max-width: 46ch; margin-top: 2rem; padding: 1.5rem; background: var(--blanco); border-radius: 20px; }
.vacio p + p { margin-top: .75rem; }
.vacio strong { font: 700 1.25rem/1.3 var(--titulo); }

/* ---------- Producto ---------- */

.prod { display: flex; flex-direction: column; min-width: 0; }

.prod-foto {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0;
  border: 0; border-radius: 20px; background: var(--blanco); overflow: hidden;
}
.prod-foto img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.prod-foto:hover img { scale: 1.04; }
.prod-agotado .prod-foto img { opacity: .45; filter: grayscale(.6); }

.sello {
  position: absolute; left: .6rem; top: .6rem; padding: .15rem .6rem; border-radius: 12px;
  font-size: .8125rem; font-weight: 700; line-height: 1.5;
}
.sello-oferta { background: var(--sol); }
.sello-agotado { background: var(--tinta); color: var(--blanco); }

.prod-nombre { margin-top: .7rem; font: 500 .9375rem/1.3 var(--texto); }
.prod-nombre button { padding: 0; border: 0; background: none; text-align: left; font: inherit; }
.prod-nombre button:hover { text-decoration: underline; text-underline-offset: 3px; }

.variantes { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .55rem; }
.variantes .chip { min-height: 32px; padding: 0 .6rem; font-size: .8125rem; border-radius: 10px; }
.variantes .chip.sin-stock { border-style: dashed; color: var(--tinta-suave); text-decoration: line-through; }
.variantes .chip.sin-stock[aria-pressed='true'] { background: var(--blanco); border-color: var(--tinta); color: var(--tinta-suave); }
.variante-unica { margin-top: .4rem; font-size: .8125rem; color: var(--tinta-suave); }

.prod-pie { margin-top: auto; padding-top: .6rem; }
.precio { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .5rem; }
.precio-ahora { font: 700 1.5rem/1.15 var(--titulo); }
.precio-antes { font-size: .875rem; color: var(--tinta-suave); text-decoration: line-through; }
.precio-unidad { font-size: .8125rem; font-weight: 600; color: var(--agua-fuerte); }
.prod-pie .boton, .prod-pie .cantidad { margin-top: .6rem; }
.prod-aviso { display: block; margin-top: .6rem; font-size: .875rem; }

.cantidad {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: 44px;
  border-radius: 14px; background: var(--tinta); color: var(--blanco); overflow: hidden;
}
.cantidad button { height: 100%; border: 0; background: none; color: inherit; font: 700 1.375rem/1 var(--titulo); }
.cantidad button:hover:not([disabled]) { background: var(--agua-fuerte); }
.cantidad button[disabled] { opacity: .35; cursor: not-allowed; }
.cantidad output { text-align: center; font-weight: 700; }
.cantidad output small { font-weight: 500; opacity: .8; }

/* ---------- Ficha ---------- */

dialog { border: 0; padding: 0; color: var(--tinta); background: var(--talco); }
dialog::backdrop { background: rgb(23 48 74 / .55); }

.ficha { width: min(100%, 940px); max-width: none; max-height: none; height: 100dvh; margin: 0 auto; }
@media (min-width: 760px) { .ficha { height: fit-content; max-height: calc(100dvh - 3rem); margin: auto; border-radius: 28px; } }

/* El contenido se desplaza adentro; el botón de cerrar queda siempre a mano. */
.ficha[open], .cajon[open] { display: flex; flex-direction: column; overflow: hidden; }
.ficha-cuerpo { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 1.25rem; padding: 3.75rem 1rem 1.5rem; }
@media (min-width: 760px) { .ficha-cuerpo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; padding: 2rem; } }

.cerrar {
  position: absolute; right: .75rem; top: .75rem; z-index: 2; min-height: 40px; padding: 0 .9rem;
  border: 0; border-radius: 20px; background: var(--blanco); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--linea);
}
.cerrar:hover { background: var(--tinta); color: var(--blanco); box-shadow: none; }

.galeria-grande { aspect-ratio: 1; border-radius: 22px; background: var(--blanco); overflow: hidden; }
.galeria-grande img { width: 100%; height: 100%; object-fit: contain; padding: 6%; }
.galeria-miniaturas { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.galeria-miniaturas button { width: 60px; height: 60px; padding: 4px; border: 2px solid transparent; border-radius: 12px; background: var(--blanco); }
.galeria-miniaturas button[aria-pressed='true'] { border-color: var(--tinta); }
.galeria-miniaturas img { width: 100%; height: 100%; object-fit: contain; }

.ficha-rubro { font-size: .9375rem; font-weight: 600; color: var(--agua-fuerte); }
.ficha-info h2 { margin-top: .25rem; font: 700 clamp(1.5rem, 3.4vw, 2rem)/1.12 var(--titulo); }
.ficha-info .precio { margin-top: 1rem; }
.ficha-info .precio-ahora { font-size: 2.25rem; }
.ficha-info .variantes { margin-top: 1rem; }
.ficha-info .variantes .chip { min-height: 40px; padding: 0 .85rem; font-size: .9375rem; border-radius: 12px; }
.ficha-atributo { margin-top: 1.1rem; font-size: .875rem; font-weight: 600; color: var(--tinta-suave); }
.ficha-atributo + .variantes { margin-top: .4rem; }
.ficha-compra { margin-top: 1.25rem; max-width: 320px; }
.ficha-stock { margin-top: .5rem; font-size: .875rem; color: var(--tinta-suave); }
.ficha-descripcion { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--linea); max-width: 52ch; }
.ficha-descripcion li { position: relative; padding-left: 1.1rem; }
.ficha-descripcion li + li { margin-top: .35rem; }
.ficha-descripcion li::before { content: ''; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--agua); }
.ficha-consulta { display: inline-block; margin-top: 1.25rem; }

/* ---------- Pedido ---------- */

.cajon { width: min(100%, 460px); max-width: none; height: 100dvh; max-height: none; margin: 0 0 0 auto; }
.cajon-cuerpo { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 1.25rem 1rem 1.5rem; }
@media (min-width: 520px) { .cajon-cuerpo { padding-inline: 1.5rem; } }
.cajon h2 { font: 800 2rem/1 var(--titulo); padding-right: 6rem; }

@media (prefers-reduced-motion: no-preference) {
  .cajon[open] { animation: entrar-cajon .28s cubic-bezier(.2, .8, .3, 1); }
  .ficha[open] { animation: entrar-ficha .22s ease-out; }
}
@keyframes entrar-cajon { from { transform: translateX(100%); } }
@keyframes entrar-ficha { from { opacity: 0; transform: translateY(16px); } }

.renglones { margin-top: 1.25rem; }
.renglon { display: grid; grid-template-columns: 64px 1fr auto; gap: .2rem .8rem; padding: .9rem 0; border-top: 1px solid var(--linea); }
.renglon-foto { grid-row: span 2; width: 64px; height: 64px; border-radius: 12px; background: var(--blanco); object-fit: contain; padding: 4px; }
.renglon-nombre { font-weight: 600; font-size: .9375rem; line-height: 1.3; }
.renglon-nombre small { display: block; font-weight: 400; color: var(--tinta-suave); font-size: .8125rem; }
.renglon-total { font: 700 1.125rem/1.3 var(--titulo); text-align: right; }
.renglon-controles { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.renglon .cantidad { width: 132px; height: 38px; grid-template-columns: 38px 1fr 38px; border-radius: 12px; margin: 0; }
.renglon .enlace { font-size: .875rem; }

.campo { display: grid; gap: .4rem; }
.campo[hidden] { display: none; }
.campo input, .campo textarea { width: 100%; min-width: 0; }
.campo input { height: 46px; padding: 0 .9rem; border: 1.5px solid var(--linea); border-radius: 14px; background: var(--blanco); }
.campo input:focus { outline: none; border-color: var(--tinta); }

.pedido-cierre { margin-top: auto; padding-top: 1.5rem; }
.pedido-cierre .boton { margin-top: 1rem; min-height: 52px; font-size: 1.0625rem; }
.pedido-nota { margin-top: .75rem; font-size: .875rem; color: var(--tinta-suave); }

.pedido-vacio { margin-top: 2rem; }
.pedido-vacio p { max-width: 30ch; font-size: 1.0625rem; }
.pedido-vacio .boton { margin-top: 1.25rem; }

.campo > span:first-child { font-weight: 700; font-size: .9375rem; }
.campo small { font-weight: 400; color: var(--tinta-suave); }
.campo textarea { padding: .6rem .9rem; border: 1.5px solid var(--linea); border-radius: 14px; background: var(--blanco); resize: vertical; }
.campo textarea:focus { outline: none; border-color: var(--tinta); }
.campo [aria-invalid='true'] { border-color: var(--frutilla); }
.campo-error { color: var(--frutilla); font-size: .875rem; font-weight: 600; }
.campo-error:empty { display: none; }
.campos-dos { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .6rem; align-items: start; }

.renglones { border-bottom: 1px solid var(--linea); }

.bloque { border: 0; padding: 0; margin: 1.1rem 0 0; min-width: 0; }
.bloque legend { padding: 0; margin-bottom: .5rem; font-weight: 700; font-size: .9375rem; }

.metodos { display: grid; gap: .45rem; }
.metodo {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem;
  padding: .65rem .8rem; border: 1.5px solid var(--linea); border-radius: 14px; background: var(--blanco); cursor: pointer;
}
.metodo:has(input:checked) { border-color: var(--tinta); background: #FFF4C7; }
.metodo input { width: 20px; height: 20px; margin: 0; accent-color: var(--tinta); }
.metodo-texto { font-weight: 600; line-height: 1.3; }
.metodo-texto small { display: block; font-weight: 400; font-size: .8125rem; color: var(--tinta-suave); }
.metodo-costo { font-weight: 700; font-size: .9375rem; }

.metodo-no { opacity: .55; cursor: not-allowed; }

.pago-caja { display: grid; gap: .7rem; padding: 1rem; border: 1.5px solid var(--tinta); border-radius: 16px; background: var(--blanco); }
.pago-caja .aviso { margin-top: 0; }
.pago-nota { font-size: .875rem; color: var(--tinta-suave); }

.transferencia { display: grid; gap: .1rem; margin: 0; }
.transferencia div { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); align-items: center; gap: .6rem; min-height: 40px; border-top: 1px solid var(--linea); }
.transferencia dt { font-size: .875rem; color: var(--tinta-suave); }
.transferencia dd { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 0; min-width: 0; }
.dato { font-weight: 700; overflow-wrap: anywhere; user-select: all; }
.copiar { flex: none; min-height: 32px; padding: 0 .7rem; border: 1.5px solid var(--tinta); border-radius: 16px; background: var(--blanco); font-size: .8125rem; font-weight: 700; }
.copiar:hover { background: var(--tinta); color: var(--blanco); }

.pasos-finales { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; counter-reset: paso; }
.pasos-finales > li { position: relative; display: grid; gap: .5rem; padding-left: 2.4rem; counter-increment: paso; }
.pasos-finales > li::before {
  content: counter(paso); position: absolute; left: 0; top: -.1rem; display: grid; place-items: center;
  width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--tinta); color: var(--blanco); font: 700 1rem/1 var(--titulo);
}

.aviso { margin-top: .6rem; padding: .6rem .8rem; border-radius: 12px; background: var(--durazno); font-size: .875rem; line-height: 1.4; }

.cupon { margin-top: 1.1rem; }
.cupon label { font-weight: 700; font-size: .9375rem; }
.cupon-fila { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin: .4rem 0; }
.cupon input { height: 44px; padding: 0 .9rem; border: 1.5px solid var(--linea); border-radius: 14px; background: var(--blanco); text-transform: uppercase; }
.cupon input:focus { outline: none; border-color: var(--tinta); }
.cupon-puesto { margin-top: 1.1rem; font-size: .9375rem; }

.cuenta { display: grid; gap: .35rem; margin: 0; }
.cuenta div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.cuenta dt small { margin-left: .3rem; font-size: .8125rem; color: var(--tinta-suave); }
.cuenta dd { margin: 0; font-weight: 600; }
.cuenta .cuenta-total { margin-top: .4rem; padding-top: .7rem; border-top: 1px solid var(--linea); font-weight: 700; }
.cuenta .cuenta-total dd { font: 800 2rem/1 var(--titulo); }

.boton-grande { min-height: 52px; font-size: 1.0625rem; }
.pedido-seguir { display: block; margin: .9rem auto 0; }

/* ---------- Finalizar compra ---------- */

.compra { width: min(100%, 1040px); max-width: none; height: 100dvh; max-height: none; margin: 0 auto; }
.compra[open] { display: flex; flex-direction: column; overflow: hidden; }
.compra h2 { font: 800 2rem/1 var(--titulo); }
.compra-cuerpo { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 1.5rem; padding: 4rem 1rem 1.5rem; }
@media (min-width: 900px) {
  .compra { height: min(100dvh - 3rem, 880px); margin: auto; border-radius: 28px; }
  .compra-cuerpo { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 2.5rem; padding: 2rem; }
  .compra-resumen { position: sticky; top: 3rem; }
}
@media (prefers-reduced-motion: no-preference) { .compra[open] { animation: entrar-ficha .22s ease-out; } }

.paso { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; margin-top: 1.75rem; }
.paso h3 { display: flex; align-items: center; gap: .6rem; font: 700 1.25rem/1.2 var(--titulo); }
.paso-numero { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--tinta); color: var(--blanco); font-size: 1rem; }
.paso .aviso { margin-top: 0; }

.compra-resumen { padding: 1.25rem; border-radius: 22px; background: var(--blanco); }
.compra-resumen h3 { font: 700 1.25rem/1.2 var(--titulo); }
.compra-resumen .boton { margin-top: 1rem; }
.resumen-renglones { display: grid; gap: .7rem; margin: .75rem 0 1rem; }
.resumen-renglon { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: .7rem; font-size: .9375rem; line-height: 1.3; }
.resumen-renglon img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: var(--talco); }
.resumen-renglon small { display: block; font-size: .8125rem; color: var(--tinta-suave); }

.compra-lista { display: grid; gap: 1rem; max-width: 48ch; margin: auto; padding: 4.5rem 1.25rem 2rem; }
.compra-lista h2 { font-size: clamp(2rem, 6vw, 2.75rem); }
.compra-lista h2:focus { outline: none; }
.compra-lista-botones { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .5rem; }

/* ---------- Vidriera: un banner, cuatro rubros ---------- */

.vidriera { padding-top: 2.5rem; }
.vidriera h2 { font: 800 clamp(2rem, 5vw, 3rem)/1 var(--titulo); letter-spacing: -0.015em; }
.vidriera-paneles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-top: 1.25rem; overflow: hidden; border-radius: 24px; }

.panel { position: relative; height: 210px; border-radius: 24px; overflow: hidden; background: linear-gradient(#E2F2EF, #EBF4F6); }
.panel-foto { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; }
.panel-foto:focus-visible { outline-offset: -5px; border-radius: 24px; }
.panel-foto img {
  /* un poco más abajo para que el nombre del rubro no pise el producto */
  position: absolute; left: 50%; top: 10%; width: auto; max-width: none; height: 92%;
  translate: -50% 0; transform-origin: 50% 35%;
  transition: scale .55s cubic-bezier(.2, .8, .3, 1), left .55s cubic-bezier(.2, .8, .3, 1);
  /* los bordes del recorte se funden con el fondo del panel */
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(transparent, #000 10%);
  mask-composite: intersect;
}
.panel-foto:hover img { scale: 1.06; }
.panel-nombre { position: absolute; left: 1rem; top: .9rem; right: 1rem; text-align: left; font: 700 1.25rem/1.1 var(--titulo); }

.panel-info {
  position: absolute; left: 56%; right: 1rem; top: 50%; translate: 0 -50%;
  display: grid; justify-items: start; gap: .7rem;
  visibility: hidden; opacity: 0;
}
.panel-info p { font-weight: 600; line-height: 1.3; }
.panel-info .boton { text-align: left; line-height: 1.2; }

/* Elegido: el panel se abre y el producto se acerca. */
.panel-elegido { grid-column: 1 / -1; height: 260px; }
.panel-elegido .panel-foto img, .panel-elegido .panel-foto:hover img { left: 28%; scale: 1.22; }
.panel-elegido .panel-info { visibility: visible; opacity: 1; transition: opacity .3s .2s; }

@media (min-width: 760px) {
  .vidriera { padding-top: 3.5rem; }
  .vidriera-paneles { display: flex; gap: .75rem; height: clamp(320px, 32vw, 430px); }
  .panel, .panel-elegido { flex: 1 1 0; height: auto; transition: flex-grow .55s cubic-bezier(.2, .8, .3, 1); }
  .panel-elegido { flex-grow: 2.1; }
  .panel-nombre { left: 1.25rem; top: 1.1rem; font-size: 1.5rem; }
  .panel-info { left: 54%; right: 1.25rem; }
}

/* Los paneles suben uno tras otro cuando la vidriera entra en pantalla, como la escalera de talles. */
@media (prefers-reduced-motion: no-preference) {
  .vidriera .panel {
    transform: translateY(103%);
    transition: transform .65s cubic-bezier(.2, .9, .3, 1) calc(var(--paso) * 80ms), flex-grow .55s cubic-bezier(.2, .8, .3, 1);
  }
  .vidriera.a-la-vista .panel { transform: none; }
}

/* Barra fija en el celular cuando hay algo en el pedido */
.barra-pedido {
  position: fixed; left: .75rem; right: .75rem; bottom: .75rem; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; min-height: 54px; padding: 0 1.25rem;
  border-radius: 18px; background: var(--tinta); color: var(--blanco); text-decoration: none; font-weight: 600;
}
.barra-pedido strong { font: 700 1.25rem/1 var(--titulo); }
.barra-pedido[hidden] { display: none; }
@media (min-width: 760px) { .barra-pedido { display: none; } }

/* ---------- Pie ---------- */

.pie { background: var(--tinta); color: var(--blanco); padding: 3rem 0 6rem; font-size: .9375rem; }
.pie-columnas { display: grid; gap: 2rem; }
@media (min-width: 760px) { .pie-columnas { grid-template-columns: 1.3fr 1fr 1fr 1fr; } .pie { padding-bottom: 3rem; } }
.pie-marca { font: 800 2.25rem/1 var(--titulo); color: var(--agua); margin-bottom: .5rem; }
.pie h2 { font: 700 1.125rem/1.3 var(--titulo); margin-bottom: .4rem; }
.pie li + li { margin-top: .3rem; }
.pie a { text-underline-offset: 3px; }
.pie a:hover { color: var(--sol); }
.pie :focus-visible { outline-color: var(--sol); }
.pie-nota { margin-top: .75rem; font-size: .8125rem; opacity: .75; }

/* ---------- Celular ---------- */

@media (max-width: 759px) {
  .cabecera-fila { grid-template-columns: 1fr auto; }
  .buscador { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .boton-pedido { padding: 0 .9rem; }
  .vista-cabeza { padding-top: 1.5rem; }
  .precio-ahora { font-size: 1.375rem; }
}

@media (min-width: 760px) {
  .cabecera { position: sticky; top: 0; z-index: 25; }
  .rubros { top: var(--alto-cabecera); }
  .catalogo { scroll-margin-top: var(--alto-cabecera); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
