/* EONDEI — Porcelana + Lectura (dir-4, aprobada 2026-12-03).
   Campo porcelana con mucho aire y el producto flotando (Porcelana) + reglas finas,
   grilla modular y voz de máquina solo para lecturas en vivo (Lectura).
   Instrument Sans para todo el mensaje; Martian Mono solo para hora, conteos y tallas.
   El acento iridiscente marca únicamente stock, tu talla y descuentos. */

/* Fuentes propias (SIL OFL, ver /fonts/OFL-*.txt): archivos variables de Google Fonts, subconjuntos latin y latin-ext */
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-latin.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-latin-ext.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Martian Mono"; src: url("/fonts/martian-mono-latin.woff2") format("woff2"); font-weight: 300 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Martian Mono"; src: url("/fonts/martian-mono-latin-ext.woff2") format("woff2"); font-weight: 300 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Respaldo con las métricas de Instrument Sans (medidas en Chrome sobre Segoe UI: ancho ×1,0174, ascenso 0,97, descenso 0,25):
   al llegar la fuente web el texto no cambia de alto ni de ancho, y los chips no saltan de fila */
@font-face { font-family: "Instrument Fallback"; src: local("Segoe UI"), local("Arial"); size-adjust: 101.74%; ascent-override: 95.34%; descent-override: 24.57%; line-gap-override: 0%; }
/* Igual para Martian Mono sobre Consolas (avance 0,70 contra 0,55; ascenso 1,00, descenso 0,20): "Prueba con" y la línea de confianza no se corren al cargar */
@font-face { font-family: "Martian Fallback"; src: local("Consolas"); size-adjust: 127.32%; ascent-override: 78.54%; descent-override: 15.71%; line-gap-override: 0%; }

/* hidden siempre gana: reglas como .fchip { display: inline-flex } lo pisaban y quedaba una píldora vacía */
[hidden] { display: none !important; }

:root {
  --bg: #f2f1ee;
  --bg-2: #fbfaf8;
  --surface: #fbfaf8;
  --surface-2: #ecebe7;
  --surface-3: #e4e2dd;
  --line: #dedbd5;
  --line-2: #cdc9c2;
  --line-3: #a9a59e;
  --edge: 0 0 0 0 transparent;
  --text: #1c1d20;
  --text-2: #4a4c52;
  --text-3: #686b71;
  /* --white es el relleno de la acción principal y --ink su texto (nombres heredados del tema oscuro) */
  --white: #1c1d20;
  --ink: #fbfaf8;
  --mint: #4656c8;
  --mint-ink: #1c1d20;
  --mint-soft: rgb(143 184 255 / 0.22);
  --holo-a: #8fb8ff;
  --holo-b: #c7a6ff;
  --holo: linear-gradient(135deg, var(--holo-a), var(--holo-b));
  --amber: #8a5a00;
  --amber-soft: rgb(242 196 107 / 0.18);
  --rose: #b4233a;
  --plate-a: #ffffff;
  --plate-b: #eeece7;

  --display: "Instrument Sans", "Instrument Fallback", system-ui, sans-serif;
  --ui: "Instrument Sans", "Instrument Fallback", system-ui, sans-serif;
  --mono: "Martian Mono", "Martian Fallback", ui-monospace, monospace;

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 24px;
  --wrap: 1280px;
  --gutter: 40px;
  --header-h: 68px;

  --shadow-1: 0 40px 80px -50px rgb(28 29 32 / 0.45), 0 0 0 1px var(--line);
  --shadow-2: 0 40px 90px -40px rgb(28 29 32 / 0.5), 0 0 0 1px var(--line);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 140ms;
  --t: 260ms;

  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); scrollbar-color: var(--surface-3) var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }

::selection { background: rgb(143 184 255 / 0.45); color: var(--text); }
input, select { caret-color: var(--text); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

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

.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; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 300;
  padding: 10px 16px; border-radius: var(--r-xs);
  background: var(--white); color: var(--ink); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-fast) var(--ease);
}
.btn-primary { background: var(--white); color: var(--ink); }
.btn-primary:hover { background: #000; box-shadow: 0 12px 30px -16px rgb(28 29 32 / 0.6); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--line-3); background: rgb(28 29 32 / 0.04); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 56px; padding: 0 28px; font-size: 16px; }
.btn:active { transform: scale(0.98); }

.icon-btn {
  position: relative; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text);
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.icon-btn:hover { border-color: var(--line-3); background: rgb(28 29 32 / 0.04); }
.icon-btn.on { color: var(--text); }
.icon-btn.on svg { fill: url(#holo); }

.link {
  border: 0; background: none; padding: 0;
  color: var(--text-2); font-size: 14px; font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 4px;
}
.link:hover { color: var(--text); text-decoration-color: currentColor; }

.badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--holo); color: var(--text); font-size: 11px; font-weight: 600;
}

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--holo); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -0.01em; }

.chip {
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  font-size: 14px; font-weight: 500;
  transition: border-color var(--t-fast) ease, color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.chip:hover { color: var(--text); border-color: var(--line-3); background: rgb(28 29 32 / 0.03); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: rgb(251 250 248 / 0.92); color: var(--text);
  border: 1px solid var(--line-2);
}
.pill.ok { color: var(--text); border-color: transparent; background: var(--holo); }
.pill.warn { color: var(--amber); border-color: rgb(138 90 0 / 0.25); background: rgb(251 250 248 / 0.92); }

/* Placa de producto: todas las fotos a la misma escala sobre el mismo fondo claro */
.plate {
  position: relative;
  display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(90% 85% at 50% 35%, var(--plate-a) 0%, #f7f6f3 60%, var(--plate-b) 100%);
}
.plate img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
/* Encuadradas por app.js (frameImage): sin padding, el encuadre ya deja aire; en placa de color propio no se multiplica */
.plate img.framed { padding: 0; }
.plate.solid img { mix-blend-mode: normal; }

.field { position: relative; display: flex; align-items: center; }
.field-ico { position: absolute; left: 18px; z-index: 1; color: var(--text-3); pointer-events: none; }
.field input {
  width: 100%; border: 0; outline: none; background: transparent; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.field input::placeholder { color: var(--text-3); }

.select { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.select select, .sort select {
  height: 40px; padding: 0 34px 0 14px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a9afba' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text); font-size: 14px;
  -webkit-appearance: none; appearance: none;
}
.select select option, .sort select option { background: var(--surface); color: var(--text); }
.select-sm select { height: 36px; }

/* ===== Cabecera ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(242 241 238 / 0.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.brand-logo { display: block; }

.hsearch {
  flex: 1; max-width: 640px;
  display: flex; align-items: center; gap: 6px;
  height: 46px; padding: 4px 4px 4px 0;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
}
.hsearch:focus-within { border-color: var(--line-3); }
.hsearch .field { flex: 1; min-width: 0; height: 100%; }
.hsearch .field-ico { left: 16px; }
.hsearch input { height: 100%; padding: 0 12px 0 42px; font-size: 15px; }
.hsearch-size {
  flex-shrink: 0; height: 36px; padding: 0 14px;
  border: 0; border-left: 1px solid var(--line-2); border-radius: 0;
  background: transparent; color: var(--text-2); font-size: 14px; white-space: nowrap;
}
.hsearch-size .v { color: var(--text); font-weight: 500; }

.header-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-link {
  height: 40px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px;
  color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none;
}
.nav-link:hover { color: var(--text); background: rgb(28 29 32 / 0.04); }
body:not(.is-home) .home-only { display: none; }
/* Favoritos: píldora de 44 px con corazón y número; bajo 640 px solo el corazón con el número en insignia */
.fav-btn { position: relative; height: 44px; padding: 0 16px 0 14px; font-size: 14px; }
.fav-count { font-family: var(--mono); font-size: 12px; }

/* ===== Portada ===== */
.hero { position: relative; padding: 0; isolation: isolate; overflow: hidden; }
/* Un solo barrido de luz al cargar */
.light { position: absolute; inset: -20% -10%; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgb(143 184 255 / 0.2) 47%, rgb(199 166 255 / 0.18) 53%, transparent 62%);
  transform: translateX(-60%); animation: lightSweep 2.2s 0.3s var(--ease) both; }
@keyframes lightSweep { 70% { opacity: 1; } to { transform: translateX(60%); opacity: 0; } }

.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); border-bottom: 1px solid var(--line); }
.hero-copy { padding: 48px 48px 40px 0; }
.hero-side { padding: 32px 0 32px 40px; border-left: 1px solid var(--line); display: flex; align-items: center; }
.hero-grid.solo { grid-template-columns: minmax(0, 1fr); }
.hero-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.5rem, 5.2vw, 4.6rem); line-height: 1.02; letter-spacing: -0.035em;
  max-width: 8em; text-wrap: balance; /* = 12ch de Instrument Sans; en em para que el respaldo corte igual */
}
.hero-title .soft { color: var(--text-2); }
/* Escritorio (2 columnas): titular en 2 líneas y algo más chico para que asome la vitrina sobre el pliegue */
@media (min-width: 1181px) {
  .hero-title { max-width: 12em; font-size: clamp(2.5rem, 4.6vw, 4.2rem); }
  /* Márgenes verticales algo más justos para que la vitrina asome también a 1280x800 */
  .hero-copy { padding-top: 40px; padding-bottom: 32px; }
  .hero-copy .search { margin-top: 28px; }
  .hero-copy .trust { margin-top: 16px; }
}
.hero-sub { margin-top: 22px; max-width: 28em; font-size: 19px; line-height: 1.6; color: var(--text-2); }

.search {
  margin-top: 40px; max-width: 640px;
  display: flex; align-items: center; gap: 6px;
  padding: 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px -32px rgb(28 29 32 / 0.35);
  transition: border-color var(--t) ease, box-shadow var(--t) var(--ease);
}
.search:focus-within { border-color: var(--text-3); box-shadow: 0 0 0 5px rgb(143 184 255 / 0.25), 0 24px 60px -32px rgb(28 29 32 / 0.35); }
.search-field { flex: 1; min-width: 0; height: 56px; }
.search-field input { height: 100%; padding: 0 16px 0 52px; font-size: 17px; }
.search-size {
  flex-shrink: 0; height: 44px; padding: 0 18px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
  border: 0; border-left: 1px solid var(--line-2); background: transparent; text-align: left;
}
.search-size .k { font-size: 11.5px; color: var(--text-3); }
.search-size .v { font-size: 15px; color: var(--text); white-space: nowrap; }
.search-size.is-set .v { font-weight: 600; }

.popular { margin-top: 16px; display: flex; align-items: flex-start; gap: 14px; }
.popular-label { line-height: 36px; flex-shrink: 0; }
.popular .chips { flex: 1; min-width: 0; }
.popular-label { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
/* Escritorio: una sola fila con scroll y desvanecido, como en móvil, para que asome la vitrina */
@media (min-width: 1181px) {
  .popular .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: 24px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .popular .chip { flex-shrink: 0; white-space: nowrap; }
}

.trust {
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 32px; font-family: var(--mono); font-size: 12px; color: var(--text-3);
}
.trust > span { display: inline-flex; align-items: center; gap: 10px; }
.trust > span:first-child { color: var(--text-2); }

/* Comparador en vivo: un modelo, sus tiendas y el precio en cada una. El esqueleto tiene los mismos altos que la lectura */
.live { width: 100%; border-radius: 28px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-1); }
.live-skeleton, .live .sk, .live-strip .sk { background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: shimmer 1.6s ease-in-out infinite; }
.live .sk, .live-strip .sk { display: block; border-radius: 6px; }
.live-head { margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.live-head::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--holo); margin-right: 8px; vertical-align: 1px; }
.live-model { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 18px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.live-plate { aspect-ratio: 4 / 3; border-radius: var(--r-sm); }
.live-plate img { padding: 8px; }
.live-name { font-size: 20px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.live-meta { margin-top: 6px; color: var(--text-3); }
.live-offers { list-style: none; margin: 0; padding: 0; }
.live-offers li {
  position: relative; height: 52px; padding: 0 20px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: center; column-gap: 12px;
  border-bottom: 1px solid var(--line);
  animation: rise 500ms var(--ease) backwards; animation-delay: calc(var(--i, 0) * 80ms);
}
.live-offers li.sk { border-radius: 0; animation: shimmer 1.6s ease-in-out infinite; }
.live-offers li.best::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--holo); }
.live-store { font-size: 15px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-deliv { grid-row: 2; color: var(--text-3); }
.live-price { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 21px; font-weight: 400; letter-spacing: -0.015em; }
.live-foot { margin: 0; height: 46px; padding: 0 20px; display: flex; align-items: center; }
.live-foot .sk { width: 140px; height: 16px; }
.live-name.sk { height: 22px; width: 80%; }
.live-meta.sk { width: 60%; height: 14px; }
.live-cta { color: var(--text); font-size: 15px; font-weight: 500; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 5px; }
.live-cta:hover { text-decoration-color: currentColor; }
.live-strip { display: none; }

/* Bajas de precio: tabla de lectura, cada fila abre la ficha */
.deals { width: 100%; border-collapse: collapse; }
.deals th { text-align: left; padding: 10px 12px; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--text-3); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.deals td { padding: 12px; border-bottom: 1px solid var(--line); }
.deals tbody tr { cursor: pointer; transition: background-color 160ms ease; }
.deals tbody tr:hover td { background: var(--surface); }
.deals .r { text-align: right; white-space: nowrap; }
.deals .m { font-family: var(--mono); font-size: 12px; }
.dm { display: flex; align-items: center; gap: 16px; font-weight: 500; }
.dm .plate { flex-shrink: 0; width: 64px; height: 64px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.dm .plate img { padding: 4px; }
.dm small { display: block; font-weight: 400; color: var(--text-3); font-size: 14px; }
.deals s { color: var(--text-3); }
.dp { font-size: 19px; }
.dbar { display: inline-block; width: 80px; height: 4px; border-radius: 4px; background: var(--line); margin-right: 10px; vertical-align: 3px; overflow: hidden; }
.dbar i { display: block; height: 100%; background: var(--holo); }

/* Secciones */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--line); }
/* La vitrina asoma bajo el pliegue: menos aire arriba que el resto de secciones */
#destacados { padding-top: 40px; }
#destacados .section-head { margin-bottom: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.section-title { font-family: var(--display); font-weight: 400; font-size: clamp(1.75rem, 2.8vw, 2.5rem); line-height: 1.1; letter-spacing: -0.03em; }
.section-sub { margin-top: 10px; max-width: 60ch; color: var(--text-2); }
.title-row { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
/* Pestañas de marca en la fila del título: si no caben, scroll horizontal con desvanecido */
#destacados .section-head > div { flex: 1; min-width: 0; }
#destacados .title-row { flex-wrap: nowrap; min-height: 46px; }
#destacados .title-row .section-title { flex-shrink: 0; }
/* Orden de la vitrina: va en el HTML, así no hay salto; mismo tamaño que "Para" */

.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line-2); border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tab { height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--white); color: var(--ink); }

.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; position: relative; border-top: 1px solid var(--line); }
.steps li { padding-top: 20px; }
.steps li { position: relative; }
.step-n {
  position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; color: var(--text-3);
}
.steps h3 { margin-top: 18px; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.steps p { margin-top: 8px; max-width: 34ch; color: var(--text-2); }
.how-stores { margin-top: 56px; scroll-margin-top: 80px; }
.how-stores-title { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.how-stores .section-sub { margin-bottom: 20px; }

.store-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); column-gap: 40px; border-top: 1px solid var(--line); }
.store-item { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.store-name { font-weight: 500; }
.store-domain { grid-column: 1; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.store-cap { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 13px; color: var(--text-3); text-align: right; max-width: 18ch; }
.store-cap.is-live { color: var(--text-2); }
.store-blocked { margin-top: 20px; font-size: 13px; color: var(--text-3); max-width: 90ch; }

/* ===== Grilla y tarjeta ===== */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 28px; }
.grid.is-refreshing { opacity: 0.45; pointer-events: none; transition: opacity var(--t) ease; }
.card-skel { aspect-ratio: 3 / 4.3; border-radius: var(--r-lg); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: shimmer 1.6s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.card {
  position: relative; display: flex; flex-direction: column;
  cursor: pointer; border-radius: var(--r-lg);
  animation: rise 500ms var(--ease) backwards;
}
.card:nth-child(2) { animation-delay: 40ms; } .card:nth-child(3) { animation-delay: 80ms; } .card:nth-child(4) { animation-delay: 120ms; } .card:nth-child(n+5) { animation-delay: 160ms; }
/* Solo movimiento: la tarjeta es visible aunque la animación no corra */
@keyframes rise { from { transform: translateY(10px); } }
.card-media { aspect-ratio: 1; border-radius: 22px; box-shadow: 0 0 0 1px var(--line); transition: box-shadow var(--t) var(--ease); }
.card-media img { padding: 14px; transition: scale 600ms var(--ease); }
.card-media .pill { position: absolute; top: 12px; left: 12px; }
.save-btn {
  position: absolute; z-index: 1; top: 8px; right: 8px; width: 40px; height: 40px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgb(251 250 248 / 0.92); color: var(--text-3); box-shadow: 0 0 0 1px var(--line);
  transition: color var(--t-fast) ease, transform var(--t-fast) var(--ease);
}
.save-btn:hover { color: var(--text); }
.save-btn:active { transform: scale(0.92); }
.save-btn.on { color: var(--text); }
.save-btn.on svg { fill: url(#holo); }

.card-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 2px 0; flex: 1; }
.card-title { font-size: 15px; font-weight: 500; line-height: 1.35; min-height: calc(15px * 1.35 * 2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* La tarjeta entera abre la ficha mediante el botón del título (sin un botón dentro de otro) */
.card-open { font: inherit; color: inherit; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
.card-open::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-lg); }
.card-open:focus-visible { outline: none; }
.card:has(.card-open:focus-visible) { outline: 2px solid var(--text); outline-offset: 4px; }
.card-price { margin-top: 4px; font-family: var(--display); font-size: 21px; font-weight: 400; letter-spacing: -0.015em; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-price .from { font-family: var(--ui); font-size: 12px; color: var(--text-3); letter-spacing: 0; }
.card-price s { font-family: var(--ui); font-size: 13px; color: var(--text-3); letter-spacing: 0; }

.sizes { display: flex; align-items: center; gap: 4px; margin-top: 4px; min-width: 0; overflow: hidden; }
.sizes-sys { margin-right: 2px; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.sz, .sz-more { flex-shrink: 0; height: 24px; min-width: 0; padding: 0 4px; display: grid; place-items: center; border-radius: 5px; font-family: var(--mono); font-size: 12px; }
.sz { color: var(--text-2); }
.sz.me { background: var(--holo); color: var(--text); }
.sz-more { min-width: 0; color: var(--text-3); }
.sizes-note { margin-top: 4px; min-height: 24px; display: flex; align-items: center; font-size: 13px; color: var(--text-3); } /* mismo alto que .sizes: al llegar las tallas la tarjeta no salta */
.card-meta { margin-top: 4px; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-3); }
.card-meta span:last-child { color: var(--text-2); }

@media (hover: hover) and (pointer: fine) {
  .card:hover .card-media { box-shadow: 0 0 0 1px var(--line-2), 0 26px 50px -34px rgb(28 29 32 / 0.45); }
  .card:hover .card-media img { scale: 1.04; }
}

/* ===== Carga ===== */
#loadingView { padding: 48px 0 96px; }
.loading-head { margin-bottom: 32px; max-width: 720px; }
.progress { height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; margin-bottom: 28px; }
.progress span { display: block; width: 35%; height: 100%; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--holo-a), var(--holo-b), transparent); animation: sweep 1.3s var(--ease) infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.loading-title { font-family: var(--display); font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 400; letter-spacing: -0.025em; }
.loading-sub { margin-top: 8px; color: var(--text-2); }

/* ===== Resultados ===== */
#resultsView { padding: 40px 0 96px; }
.answer { margin-bottom: 28px; }
.answer-line { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 2.8vw, 2.4rem); line-height: 1.2; letter-spacing: -0.03em; max-width: 30ch; text-wrap: balance; }
.answer-line em { font-style: normal; background: linear-gradient(transparent 62%, rgb(143 184 255 / 0.45) 62%, rgb(199 166 255 / 0.45)); }
.answer-meta { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.answer-meta .link { font-family: var(--ui); font-size: 14px; }
.stores-panel { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 24px; border-top: 1px solid var(--line); }
.stores-panel li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text-3); }
.stores-panel li.hit { color: var(--text); }
.stores-panel li.hit b { color: var(--mint); font-family: var(--mono); font-size: 12px; }
.stores-panel li.err b { color: var(--rose); }
.stores-panel b { font-weight: 500; }

.filterbar {
  position: sticky; top: var(--header-h); z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin: 0 calc(var(--gutter) * -1) 8px; padding: 12px var(--gutter);
  background: rgb(242 241 238 / 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.filters-main { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; min-width: 0; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
/* "Para": control segmentado siempre visible; mismo alto que .fchip (38 px) */
.aud { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.aud-label { font-size: 14px; color: var(--text-3); }
.aud-seg { padding: 3px; }
.aud .aud-btn { height: 30px; min-width: 0; padding: 0 14px; font-family: inherit; font-size: 14px; font-weight: 500; transition: color var(--t-fast) ease, background-color var(--t-fast) ease; }
.aud-btn:hover { color: var(--text); }
.aud-btn[aria-checked="true"]:hover { color: var(--ink); }
.fchip {
  height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: border-color var(--t-fast) ease, color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.fchip b { color: var(--text); font-weight: 500; }
.fchip:hover { border-color: var(--line-3); color: var(--text); }
.fchip.is-on { background: var(--white); border-color: var(--white); color: var(--ink); }
.fchip.is-on b { color: var(--ink); }
.m-only, .meta-short { display: none; }
.aud-sheet { display: flex; }
.aud-sheet .aud-btn { flex: 1; height: 44px; font-family: inherit; font-size: 15px; font-weight: 500; }
.sort { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; font-size: 14px; color: var(--text-3); }
.count-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0 20px; }
.result-count { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
/* Orden como texto-selector: "Orden: Relevancia ▾", con el select nativo transparente encima (área de 44 px) */
.sort-m { position: relative; min-height: 44px; flex-shrink: 0; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.sort-m b { font-weight: 500; color: var(--text); }
.sort-m::after { content: "▾"; font-size: 11px; color: var(--text-3); }
.sort-m select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; }

.more-row { display: flex; justify-content: center; margin-top: 32px; }
.more-row:has(> [hidden]) { display: none; }
.state-panel { margin-top: 8px; padding: 48px 32px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.state-panel h2 { font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: -0.02em; }
.state-panel p { max-width: 56ch; color: var(--text-2); }
.state-panel .chips { justify-content: center; margin-top: 6px; }

/* ===== Ficha ===== */
.sheet-backdrop, .dialog-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgb(28 29 32 / 0.28); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fade var(--t) ease both;
}
@keyframes fade { from { opacity: 0; } }
.sheet-backdrop { display: flex; justify-content: flex-end; }
.sheet {
  width: min(640px, 100%); height: 100%; display: flex; flex-direction: column;
  background: var(--bg-2); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-2);
  animation: slideIn 420ms var(--ease) both;
}
@keyframes slideIn { from { transform: translateX(48px); opacity: 0.4; } }
.sheet-bar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sheet-body { flex: 1; overflow-y: auto; padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 36px; scrollbar-width: thin; }

/* Ficha en el orden de la decisión: foto | qué es, precio, color, talla; debajo, dónde comprar. La compra, en la barra fija */
.sheet-top { display: flex; flex-direction: column; gap: 28px; }
.sheet-main { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.sheet-media { min-width: 0; }

/* Galería de la ficha: pista con scroll-snap (alto reservado por aspect-ratio, sin saltos) y miniaturas debajo */
.gallery { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gallery-stage { position: relative; }
.gallery-track {
  display: flex; aspect-ratio: 3 / 2; border-radius: var(--r); overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track:focus-visible { outline-offset: 3px; border-radius: var(--r); }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.gallery-slide img { padding: 14px; }
.gallery-count {
  position: absolute; right: 12px; bottom: 12px; display: none; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line);
}
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; }
.gallery-thumb {
  flex: 0 0 64px; height: 64px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; transition: border-color 160ms var(--ease);
}
.gallery-thumb img { padding: 4px; }
.gallery-thumb:hover { border-color: var(--text-3); }
.gallery-thumb[aria-current="true"] { border: 2px solid var(--text); }
.sheet-id { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sheet-meta { font-size: 14px; color: var(--text-3); } /* marca, línea y color no son lecturas en vivo: sin mono */
.sheet-title { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }
.sheet-price-k { margin-top: 10px; font-size: 13px; color: var(--text-3); }
.sheet-prices { margin-top: 6px; color: var(--text-3); }
.sheet-price { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: -0.03em; }
.sheet-note { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.sheet-mline { display: none; margin-top: 6px; color: var(--text-3); }
.sheet-title:focus { outline: none; } /* recibe el foco al abrir (tabindex -1), no se navega con Tab */

/* Talla plegada (móvil, con tu talla elegida y disponible): una fila de papel que despliega la grilla en su lugar */
.size-fold {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  width: 100%; min-height: 56px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); text-align: left;
}
.fold-k { grid-column: 1; font-size: 13px; line-height: 1.3; color: var(--text-3); }
.fold-v { grid-column: 1; font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fold-v b { font-size: 17px; font-weight: 500; color: var(--text); }
.fold-v .dot { margin: 0 6px; vertical-align: 2px; }
.fold-cta { grid-column: 2; grid-row: 1 / 3; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; }

.sheet-sec { display: flex; flex-direction: column; gap: 14px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sec-head h3 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.sec-head .muted { font-size: 13px; font-weight: 400; }

/* Tallas: el número en el sistema activo y su precio; las cuatro medidas van en la lectura de abajo */
.seg-sm { padding: 3px; }
.seg-sm .seg-btn { height: 30px; min-width: 40px; padding: 0 10px; }
.seg-sm .seg-btn[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.sizes-sub { font-size: 13px; color: var(--text-2); margin-top: -6px; }
.sheet-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; scroll-margin-bottom: 92px; }
.ssz {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 56px;
  padding: 8px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); text-align: left;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease;
}
.one-price .ssz { min-height: 44px; }
.ssz b { font-family: var(--display); font-size: 20px; font-weight: 400; line-height: 1.1; letter-spacing: -0.01em; white-space: nowrap; }
.ssz b.rng { font-size: 14px; } /* "36,5–37,5": tallas entre dos filas de la tabla */
.ssz span { font-family: var(--mono); font-size: 11px; color: var(--text-2); white-space: nowrap; }
.ssz:hover:not(:disabled) { border-color: var(--line-3); }
/* Tu talla: borde iridiscente y un punto (no depende solo del color: también lo dice la cabecera) */
.ssz.mine { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--holo) border-box; }
.ssz.mine b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; vertical-align: middle; border-radius: 50%; background: var(--holo); }
.ssz.on { background: var(--white); border-color: var(--white); color: var(--ink); }
.ssz.on span { color: rgb(251 250 248 / 0.75); }
.ssz.on.mine { border: 2px solid transparent; background: linear-gradient(var(--white), var(--white)) padding-box, var(--holo) border-box; }
/* Agotada: sin opacidad; se distingue por el borde punteado, el tachado y la palabra */
.ssz:disabled { cursor: not-allowed; background: transparent; border-style: dashed; color: var(--text-3); }
.ssz:disabled b { text-decoration: line-through; text-decoration-thickness: 1px; }
.ssz:disabled span { color: var(--text-3); }
.sizes-read { font-size: 13px; color: var(--text-3); }
.sizes-read.mono { font-size: 12px; color: var(--text-2); }
.sizes-save { align-self: flex-start; font-size: 13px; }
.sheet-brand { margin-right: auto; padding-left: 10px; }

/* Color: miniaturas con foto (mismo trato que las de la galería); la elegida con borde de 2px */
.color-name { font-weight: 500; }
.color-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; }
.color-row::-webkit-scrollbar { display: none; }
.color-opt { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.color-img { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; display: grid; place-items: center; transition: border-color 160ms var(--ease); }
.color-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.color-opt:hover .color-img { border-color: var(--text-3); }
.color-opt[aria-pressed="true"] .color-img { border: 2px solid var(--text); }
.color-opt:focus-visible { outline: none; }
.color-opt:focus-visible .color-img { outline: 2px solid var(--text); outline-offset: 2px; }
.color-price { font-size: 12px; color: var(--text-2); }

/* Dónde comprar este color: filas del comparador en vivo; la más barata con el filete iridiscente */
.offer-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.offer-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 14px;
  padding: 12px 0 12px 16px; border-bottom: 1px solid var(--line);
}
.offer-row.best::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--holo); }
.or-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.or-store { font-size: 15px; font-weight: 500; line-height: 1.3; }
.or-deliv { color: var(--text-3); }
.or-note { font-size: 12px; color: var(--text-2); }
.or-pick summary { cursor: pointer; font-size: 13px; color: var(--text-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.or-pick summary::-webkit-details-marker { display: none; }
.or-pick summary::after, .offers-out > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform var(--t-fast) ease; }
.or-pick[open] summary::after, .offers-out[open] > summary::after { transform: rotate(-135deg); }
.pickups { margin: 8px 0 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; color: var(--text-3); font-size: 13px; }
.or-buy { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.or-price { font-family: var(--display); font-size: 21px; font-weight: 400; letter-spacing: -0.015em; white-space: nowrap; }
.or-card { font-size: 12px; color: var(--text-3); }
/* Tiendas sin la talla: plegadas al final, sin opacidad (el texto mantiene su contraste) */
.offers-out > summary { cursor: pointer; padding: 12px 0; font-size: 14px; color: var(--text-2); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.offers-out > summary::-webkit-details-marker { display: none; }

/* Barra de compra fija al pie de la ficha: la única acción grafito; cambia sola con el color y la talla */
.sheet-buy {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px;
  padding: 14px 28px; border-top: 1px solid var(--line); background: var(--bg-2);
}
.sheet-buy:empty { display: none; }
.buy-info { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.buy-price { font-family: var(--display); font-size: 21px; letter-spacing: -0.015em; white-space: nowrap; }
.buy-meta { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buy-cta { flex: 0 0 auto; min-width: 0; max-width: 62%; white-space: nowrap; }
.buy-store { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.buy-none { font-size: 14px; color: var(--text-2); }
.sheet-details dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; padding-top: 20px; border-top: 1px solid var(--line); }
.sheet-details dt { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.sheet-details dd { margin: 4px 0 0; font-weight: 500; text-transform: capitalize; }
.copy { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font-weight: 500; text-transform: none; color: var(--text); }
.copy:hover { color: var(--mint); }

/* ===== Diálogos ===== */
.dialog-backdrop { display: grid; place-items: center; padding: 24px; }
.dialog {
  width: min(520px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  animation: pop 320ms var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: -0.02em; }
.dialog-body { padding: 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.dialog-lead { color: var(--text-2); font-size: 15px; }
/* Pie fijo de la hoja: las acciones siempre a la vista, fuera del cuerpo que se desplaza */
.dialog-actions { flex-shrink: 0; display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }
.dialog-actions:has(> .link) { justify-content: space-between; }
.gender-seg .seg-btn { font-family: var(--ui); font-size: 14px; font-weight: 500; }

.size-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border: 1px solid var(--line-2); border-radius: 999px; }
.seg-btn { height: 34px; min-width: 48px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-family: var(--mono); font-size: 12px; }
.seg-btn[aria-checked="true"] { background: var(--white); color: var(--ink); }
/* En la vitrina y Explorar el elegido va en gris claro: el único grafito sobre el pliegue es el botón Buscar */
#destacados .seg-btn[aria-checked="true"], #explorar .seg-btn[aria-checked="true"], #exploreView .seg-btn[aria-checked="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
#destacados .seg-btn[aria-checked="true"]:hover, #explorar .seg-btn[aria-checked="true"]:hover, #exploreView .seg-btn[aria-checked="true"]:hover { color: var(--text); }
.size-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.size-opt { height: 46px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-family: var(--mono); font-size: 13px; }
.size-opt:hover { border-color: var(--line-3); }
.size-opt[aria-checked="true"] { background: var(--white); border-color: var(--white); color: var(--ink); }
.equiv { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r-sm); min-height: 66px; }
.equiv > div { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 4px; }
.equiv > div + div { border-left: 1px solid var(--line); }
.equiv span { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.equiv b { font-family: var(--display); font-size: 20px; font-weight: 400; }
.equiv > .muted { grid-column: 1 / -1; display: grid; place-items: center; font-size: 14px; padding: 0 16px; text-align: center; }

.quick-row { display: flex; gap: 20px; }
.check-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.check { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--text); grid-row: 1 / 3; }
.check-name { font-weight: 500; }
.check-cap { font-size: 12px; color: var(--text-3); }

.saved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.saved-list li { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.saved-thumb { width: 64px; height: 48px; border-radius: var(--r-xs); }
.saved-thumb img { padding: 4px; }
.saved-info { display: flex; flex-direction: column; min-width: 0; }
.saved-info b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-info span { font-size: 13px; color: var(--text-3); }
.saved-act { display: flex; align-items: center; gap: 12px; }
.empty-note { color: var(--text-2); }

/* Sugerencias del buscador */
.suggest {
  position: absolute; top: calc(100% + 12px); left: -6px; right: -6px; z-index: 60;
  margin: 0; padding: 6px; list-style: none; max-height: 380px; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-2);
}
.hsearch .suggest { left: 0; right: -200px; }
.suggest-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px 4px; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.suggest-clear { border: 0; background: none; padding: 4px 0; color: var(--text-2); font-family: var(--ui); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.suggest-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r-xs); font-size: 15px; cursor: pointer; }
.suggest-item::before { content: ""; flex-shrink: 0; width: 15px; height: 15px; background: var(--text-3); -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.suggest-item.recent { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.suggest-item.pop { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E"); }
.suggest-item:hover, .suggest-item[aria-selected="true"] { background: var(--surface-2); }
.suggest-item[aria-selected="true"]::before { background: var(--text); }

/* Pie */
.site-footer { border-top: 1px solid var(--line); margin-top: auto; }
.footer-row { padding-top: 32px; padding-bottom: 40px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.footer-row p { max-width: 72ch; }
.footer-row strong { color: var(--text-2); font-weight: 500; letter-spacing: 0.2em; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 999px; background: var(--white); color: var(--ink);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-2); animation: pop 260ms var(--ease) both;
}
#sheet:not(.hidden) ~ .toast { bottom: calc(92px + env(safe-area-inset-bottom)); } /* sobre la barra de compra, no encima */

/* Entrada de la portada: un solo momento y solo movimiento; nada que se lea entra desde opacidad 0 */
.hero-title, .hero-sub, .search { animation: lift 800ms var(--ease) both; }
.hero-sub { animation-delay: 80ms; }
.search { animation-delay: 160ms; }
@keyframes lift { from { transform: translateY(8px); } }

/* ===== Vitrina: título y fuente del orden ===== */
#destacados .featured-source { margin-top: 10px; min-height: 18px; color: var(--text-3); }
#destacados .title-row { margin-top: 18px; }

/* ===== Explorar: caminos, no productos ===== */
.explore-hint { margin-top: 12px; font-size: 14px; color: var(--text-3); }
.explore-head { align-items: flex-end; }
.explore-meta { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; justify-content: flex-end; }
.explore-time { color: var(--text-3); min-width: 9ch; }
.explore-save { font-size: 14px; }
.explore-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; } /* 56 px entre lentes; minmax: la fila de marcas no ensancha la grilla */
.explore-page { padding-top: 48px; }
.explore-h1 { font-size: clamp(2rem, 3.4vw, 3rem); }

/* Puerta: placa de papel 4:3, nombre con flecha, bajada y una línea mono */
.doors { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 28px; }
.door { display: flex; flex-direction: column; color: inherit; text-decoration: none; border-radius: 22px; transition: transform var(--t-fast) var(--ease); }
.door-plate { aspect-ratio: 4 / 3; border-radius: 22px; box-shadow: 0 0 0 1px var(--line); transition: box-shadow 240ms var(--ease); }
.door-plate img { padding: 8%; transition: scale 320ms var(--ease); }
.door-name { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; color: var(--text); }
.door-name svg { color: var(--text-3); transition: transform var(--t-fast) var(--ease); }
.door-blurb { margin-top: 4px; font-size: 14px; color: var(--text-2); }
.door-line { margin-top: 8px; color: var(--text-3); }
.door-line.warn { color: var(--amber); }
.door:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.door:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) {
  .door:hover .door-plate { box-shadow: var(--shadow-2); }
  .door:hover .door-plate img { scale: 1.04; }
  .door:hover .door-name svg { transform: translateX(2px); }
}
.door.is-loading .door-plate, .budget.is-loading, .door-bar {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.door-bar { display: block; width: 120px; height: 14px; margin-top: 16px; border-radius: 6px; }
.door.is-loading { min-height: 0; }
.door.is-loading .door-bar { margin-bottom: 58px; } /* alto de nombre + bajada + línea: al llegar las puertas no salta */

/* Tramo de presupuesto: fila de papel de 72 px con regla de 1 px */
.budgets { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.budgets li + li { border-left: 1px solid var(--line); }
.budget { height: 72px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: inherit; text-decoration: none; background: var(--surface); transition: background-color var(--t-fast) ease; }
.budget.is-loading { height: 72px; }
.budget-amt { font-size: 21px; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; }
.budget .mono { color: var(--text-3); white-space: nowrap; }
.budget:hover { background: var(--surface-2); }
.budget:focus-visible { outline-offset: -2px; }

/* Marcas: chips de 36 px con conteo; salto de línea en escritorio, una fila desplazable en móvil */
.brands { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; min-height: 36px; }
.brand-chips { list-style: none; padding: 0; margin: 0; }
.brand-chips .chip { display: inline-flex; align-items: center; text-decoration: none; }
.brands > .door-bar { margin-top: 0; width: 320px; height: 36px; border-radius: 999px; }
.explore-empty-label { margin-top: 32px; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.state-panel .doors { margin-top: 16px; text-align: left; align-self: stretch; }

@media (max-width: 960px) {
  .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .budget { flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; } /* monto y conteo apilados: caben 3 en fila */
  .explore-meta { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .doors { gap: 24px 14px; }
  .door-plate { aspect-ratio: 1; border-radius: 18px; }
  .door { border-radius: 18px; }
  .door-name { margin-top: 10px; font-size: 15px; gap: 4px; }
  .door-blurb { display: none; }
  .door-line { margin-top: 4px; }
  .door.is-loading .door-bar { margin-bottom: 20px; }
  .budgets { grid-template-columns: 1fr; }
  .budgets li + li { border-left: 0; border-top: 1px solid var(--line); }
  .budget { flex-direction: row; justify-content: space-between; align-items: center; }
  .brands { flex-wrap: nowrap; }
  .brand-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .brand-chips li { flex-shrink: 0; }
  .brands > .link { flex-shrink: 0; white-space: nowrap; }
}

/* ===== Táctil ===== */
@media (pointer: coarse) {
  .chip, .tab, .fchip, .sort, .seg-btn, .btn-sm, .nav-link, .icon-btn, .hsearch-size, .select select, .sort select { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .save-btn { width: 44px; height: 44px; top: 6px; right: 6px; }
  .link { padding: 11px 0; }
  /* 44 px también en resúmenes desplegables y botones de copiar; el margen negativo no mueve la línea */
  .or-pick summary, .copy { min-height: 44px; }
  .suggest-clear { padding: 12px 0; margin: -12px 0; }
  .brand { min-height: 44px; }
  .ssz { min-height: 56px; } .one-price .ssz { min-height: 48px; } .seg-sm .seg-btn { height: 38px; }
}

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Tablet: una columna, el comparador debajo, centrado */
  /* La barra de confianza va al final de la columna: el comparador queda entero sobre el pliegue */
  .hero-grid { display: flex; flex-direction: column; }
  .hero-copy { display: contents; }
  .hero-title { margin-top: 48px; }
  .hero-side { order: 1; margin-top: 40px; border-left: 0; border-top: 1px solid var(--line); padding: 24px 0; justify-content: center; }
  .trust { order: 2; padding-bottom: 20px; }
  .live { max-width: 560px; }
}

@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps li { padding-left: 56px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
  .step-n { position: absolute; left: 0; top: 20px; }
  .steps h3 { margin-top: 6px; }
  .header-row { gap: 12px; }
  .hsearch .suggest { right: 0; }
  /* Tablet: la barra de filtros apilada mide ~165 px; fija junto a la cabecera tapaba un cuarto de la pantalla */
  .filterbar { position: static; flex-direction: column; align-items: stretch; gap: 10px; }
  /* La talla ya está en el chip de filtros: en la cabecera salía dos veces */
  .hsearch-size { display: none; }
  .filters-main { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px; }
  .aud-seg { flex: 1; }
  .aud .aud-btn { flex: 1; }
  #destacados .title-row { flex-wrap: wrap; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .sort { justify-content: flex-end; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; --header-h: 56px; }
  body { font-size: 15px; }
  .brand-logo { width: 88px; height: auto; }
  .nav-link, .fav-label { display: none; }
  /* En la portada la cabecera móvil tiene espacio: Explorar queda a la vista (en resultados va el buscador) */
  body.is-home .nav-link[href="/explorar"] { display: inline-flex; }
  .fav-btn { width: 44px; padding: 0; }
  .fav-btn .fav-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; background: var(--holo); color: var(--text); font-size: 11px; }
  /* Resultados: una fila de 56 px; logo 88, buscador flexible de 44 (Enter busca) y corazón 44 */
  .header-row { gap: 8px; }
  .hsearch { max-width: none; min-width: 0; height: 44px; padding: 0; }
  .hsearch-size { display: none; }
  .hsearch input { padding-left: 38px; padding-right: 8px; }
  .hsearch .field-ico { left: 13px; }
  /* Una barra a la vez: la cabecera y la fila de chips se esconden juntas al bajar y vuelven juntas al subir */
  .filterbar { position: sticky; top: var(--header-h); transition: transform 200ms ease; }
  .site-header { transition: transform 200ms ease; }
  body.header-away .site-header { transform: translateY(-100%); }
  body.header-away .filterbar { transform: translateY(calc(-100% - var(--header-h))); }
  .filterbar .sort { display: none; } /* el orden va en la línea del conteo */
  .count-row { margin: 12px 0 16px; }
  .hsearch .btn { display: none; }
  /* Filtros: una sola fila de chips con scroll; Para y Filtros abren hojas inferiores */
  .m-only { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
  .filterbar { flex-direction: row; align-items: center; gap: 8px; margin-bottom: 0; padding-top: 4px; padding-bottom: 4px; border-bottom: 0; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .filters-main, .filters { display: contents; }
  .aud, #fMySize, #fShip, #fPickup, #fStores, #fClear { display: none; }
  /* Vitrina: "Para" a la izquierda y el orden como texto-selector a la derecha, en una sola fila */
  #destacados .title-row { flex-wrap: nowrap; justify-content: space-between; }
  #destacados .featured-source { min-height: 0; }
  /* Pasado el buscador grande, la cabecera de la portada muestra el buscador compacto en lugar de "Explorar" */
  body.is-home.hsearch-on .nav-link[href="/explorar"] { display: none; }
  /* Tiendas conectadas: 6 y "Ver las N tiendas" */
  .store-list:not(.open) .store-item:nth-child(n+7) { display: none; }
  .store-more { margin-top: 8px; }
  /* Puertas de Explorar: conteo y precio en dos líneas fijas, sin "·" */
  .door-line > span { display: block; }
  .door-line .dl-sep { display: none; }
  .fchip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; }
  .caret::after, #fSize::after, .sort > span::after { content: "▾"; font-size: 11px; color: var(--text-3); }
  .sort { position: relative; height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
  .sort > span { display: inline-flex; align-items: center; gap: 4px; }
  .sort select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
  /* Respuesta: 24 px, máximo 3 líneas, y una línea mono corta debajo */
  .answer { margin-bottom: 12px; }
  .answer-line { font-size: 24px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .answer-meta { margin-top: 8px; gap: 0 8px; }
  .meta-long { display: none; }
  .meta-short { display: inline; }
  #storesToggle { padding-block: 12px; margin-block: -12px; font-family: var(--mono); font-size: 12px; } /* 44 px de área sin mover la línea */
  #storesToggle::before { content: "· "; display: inline-block; white-space: pre; color: var(--text-3); }
  #resultsView { padding-top: 20px; }
  .hero-title { margin-top: 36px; }
  /* Móvil: el comparador grande no se muestra; queda la tira de 88 px bajo "Prueba con" */
  .hero-side { display: none; }
  .live-strip {
    display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center;
    height: 88px; margin-top: 16px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
    color: var(--text); text-decoration: none;
  }
  .live-strip .plate { width: 64px; height: 64px; border-radius: 12px; }
  .live-strip .plate img { padding: 4px; }
  .live-strip-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .live-strip-txt b { font-size: 15px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .live-strip-txt b.sk { height: 18px; width: 90%; }
  .live-strip-txt .mono { color: var(--text-3); }
  .live-strip-txt .mono.sk { height: 14px; width: 50%; }
  .deals th:nth-child(2), .deals td:nth-child(2), .deals th:nth-child(3), .deals td:nth-child(3), .dbar { display: none; }
  /* a 375 px la tabla medía 352 px en 320 de espacio y la página se desplazaba de lado */
  .deals th, .deals td { padding-left: 6px; padding-right: 6px; }
  .deals td:first-child { overflow-wrap: anywhere; }
  .dm { gap: 12px; }
  .dm .plate { width: 48px; height: 48px; }
  .hero-sub { font-size: 16px; margin-top: 14px; }
  /* 16 px mínimo en campos: iOS no hace zoom al enfocarlos */
  .field input, .select select, .sort select { font-size: 16px; }
  .popular { flex-wrap: nowrap; gap: 10px; }
  .popular-label { flex-shrink: 0; }
  .popular .chips { flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; padding-right: 24px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .popular .chip { flex-shrink: 0; white-space: nowrap; }
  .search { margin-top: 24px; flex-wrap: wrap; border-radius: var(--r-lg); padding: 6px; }
  .search-field { flex-basis: 100%; height: 52px; }
  .search-size { flex: 1; height: 52px; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 0; padding-left: 16px; }
  .search-go { flex: 1.4; height: 52px; }
  /* Barra de confianza: 3 datos en fila con "·" (2 líneas como máximo); la tira en vivo y el buscador dicen el resto */
  .trust { display: block; line-height: 1.7; }
  .trust > span { display: inline; white-space: nowrap; } /* cada dato salta entero ("Sin / registro" se partía a 320 px) */
  .trust > span:nth-child(2), .trust > span:nth-child(3) { display: none; }
  .trust > span:not(:last-child)::after { content: "·"; margin: 0 8px; } /* el punto cierra la línea, nunca la abre */
  .section { padding: 56px 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .card-media { border-radius: 18px; }
  .card-media img { padding: 10px; }
  .card-body { padding: 12px 2px 0; }
  .card-title { font-size: 14px; min-height: calc(14px * 1.35 * 2); }
  .card-price { font-size: 18px; }
  /* Tarjeta más corta: la meta en una línea y sin la entrega (está en la ficha) */
  .card-meta > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card-deliv { display: none; }
  /* Corazón liviano: área de 44 px, círculo dibujado de 32 */
  .save-btn { background: none; box-shadow: none; }
  .save-btn::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: rgb(251 250 248 / 0.92); box-shadow: 0 0 0 1px var(--line); }
  .save-btn svg { position: relative; }
  .sheet { width: 100%; border-left: 0; }
  .sheet-body { padding: 18px 16px 40px; gap: 28px; }
  .sheet-top, .sheet-main { gap: 20px; }
  .sheet-bar { padding: 6px 12px; }
  /* Primera pantalla compacta: foto de 240 px como máximo, así las miniaturas de color quedan enteras sobre la barra */
  .gallery-track { aspect-ratio: auto; height: min(34vh, 240px); height: min(34svh, 240px); gap: 8px; border-radius: 0; }
  /* La foto siguiente asoma 20 px: invita a deslizar sin texto ni flecha */
  .gallery-slide { flex: 0 0 calc(100% - 28px); border-radius: var(--r); }
  .gallery-slide:only-child { flex-basis: 100%; }
  .gallery-slide:last-child { scroll-snap-align: end; }
  .gallery-thumbs { display: none; } /* en móvil se desliza: el contador reemplaza a las miniaturas */
  .gallery-count { display: block; right: 40px; } /* dentro de la foto visible, no sobre el asomo */
  .sheet-price-k, .sheet-prices { display: none; }
  .sheet-mline { display: block; }
  .color-img { width: 48px; height: 48px; }
  .sheet-sizes.one-price { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); } /* sin precios: 5 columnas */
  .offer-row { padding-left: 12px; column-gap: 10px; }
  .sheet-buy { min-height: 72px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  /* El botón toma primero su ancho: se recorta la línea mono, después la tienda; el precio nunca */
  .buy-info { flex: 1 1 0; min-width: 88px; }
  .buy-when { display: none; }
  .buy-cta { min-height: 48px; max-width: none; flex: 0 1 auto; min-width: 0; } /* se achica: a 320 px recorta la tienda, no se sale */
  /* Fila de tienda: tienda, precio e "Ir" arriba; la entrega a todo el ancho debajo (a 320 px quedaba en 7 líneas de 100 px) */
  .offer-row { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 3px; }
  .offer-row > .or-main { display: contents; }
  .or-store { grid-row: 1; grid-column: 1; align-self: center; }
  .offer-row > .or-buy { grid-row: 1; grid-column: 2; }
  .offer-row > .or-go { grid-row: 1; grid-column: 3; }
  .or-main > :not(.or-store) { grid-column: 1 / -1; }
  /* Las sugerencias de la portada abren bajo el formulario entero: antes tapaban "Buscar" */
  .search .suggest { top: calc(100% + 76px); }
  .dialog-backdrop { padding: 0; place-items: end center; }
  .dialog { width: 100%; max-height: 88vh; max-height: 88dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .dialog-actions { justify-content: space-between; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .dialog-actions > .btn-primary:only-child { flex: 1; }
  /* Sistema y género a todo el ancho, cada uno en su fila: no se parten en dos líneas */
  .size-controls .seg { flex: 1 1 100%; }
  .size-controls .seg-btn { flex: 1; }
  .size-grid { grid-template-columns: repeat(4, 1fr); }
  .stores-panel { grid-template-columns: 1fr; }
}

@media (min-width: 1181px) {
  .sheet { width: min(960px, calc(100vw - 360px)); }
  .sheet-body { padding: 28px 32px 48px; }
  .sheet-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 1fr); gap: 40px; align-items: start; }
  .sheet-media { position: sticky; top: 0; }
  .gallery-track { aspect-ratio: 1; }
  .sheet-buy { padding: 14px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* Página "Quiénes somos, precios y privacidad" (/acerca): columna de lectura */
.doc { max-width: 72ch; padding-top: 40px; padding-bottom: 64px; }
.doc section { margin-bottom: 48px; scroll-margin-top: 24px; }
.doc .section-title { margin-bottom: 16px; }
.doc p, .doc li { line-height: 1.6; color: var(--text-2); margin-bottom: 10px; }
.doc ul { padding-left: 1.2em; }
.doc-date { font-size: 12px; color: var(--text-3); }

/* Precio máximo: chip con un select invisible encima (como .sort-m) y el campo "Otro monto" al lado */
.fprice { position: relative; }
.fprice select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; }
.fprice:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.fprice-other { width: 9.5em; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.mprice { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
@media (max-width: 640px) { #fPrice, .filters > .fprice-other { display: none; } }
