/* ===== Cesta — sistema de diseño ===== */
:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #f0f2ef;
  --surface-3: #e7eae6;
  --text: #15201b;
  --text-2: #4a5650;
  --muted: #76827c;
  --border: #e2e6e2;
  --border-strong: #cdd3ce;
  --brand: #0b7a53;
  --brand-2: #0e9466;
  --brand-soft: #e3f3ec;
  --on-brand: #ffffff;
  --down: #0b8a4f;
  --down-soft: #e2f5ea;
  --up: #c2410c;
  --up-soft: #fdecdf;
  --offer: #d9480f;
  --offer-soft: #fff0e6;
  --focus: #2f80ed;
  --shadow-sm: 0 1px 2px rgb(16 24 20 / .06);
  --shadow: 0 1px 2px rgb(16 24 20 / .05), 0 4px 14px rgb(16 24 20 / .06);
  --shadow-lg: 0 10px 40px rgb(16 24 20 / .18);
  --radius: 14px;
  --radius-sm: 10px;
  --c-mercadona: #1f9d55;
  --c-consum: #e8590c;
  --c-ahorramas: #1c64f2;
  --c-gadis: #8b5cf6;
  --c-aldi: #0891b2;
  --c-bonarea: #e11d48;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hdr-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1412;
    --surface: #151c19;
    --surface-2: #1b2420;
    --surface-3: #232e29;
    --text: #e8efeb;
    --text-2: #b7c2bc;
    --muted: #8b9892;
    --border: #25302b;
    --border-strong: #34413b;
    --brand: #2bb67f;
    --brand-2: #3fcf93;
    --brand-soft: #143528;
    --on-brand: #06130d;
    --down: #3fcf93;
    --down-soft: #143528;
    --up: #fb8a52;
    --up-soft: #3a2216;
    --offer: #ff8a4c;
    --offer-soft: #3a2216;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgb(255 255 255 / .03);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / .6);
    --c-mercadona: #4ade80;
    --c-consum: #fb923c;
    --c-ahorramas: #60a5fa;
    --c-gadis: #c4b5fd;
    --c-aldi: #22d3ee;
    --c-bonarea: #fb7185;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr-h) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.num { font-variant-numeric: tabular-nums; }

/* ===== Cabecera ===== */
.hdr {
  position: sticky; top: 0; z-index: 30; height: var(--hdr-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.hdr-in { height: 100%; display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; flex: none; }
.logo svg { width: 34px; height: 34px; }
.logo svg rect { fill: var(--brand); stroke: none; }
.logo svg path { stroke: #fff; stroke-width: 2.2; }
.search { position: relative; flex: 1; max-width: 520px; }
.search .i { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); width: 18px; height: 18px; }
.search input {
  width: 100%; height: 42px; padding: 0 40px 0 42px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); outline: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.search .clear { position: absolute; right: 6px; top: 50%; translate: 0 -50%; border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 99px; display: grid; }
.search .clear svg { width: 16px; height: 16px; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  background: var(--brand); color: var(--on-brand); border-radius: 999px; font-weight: 600; font-size: 14px; flex: none;
  box-shadow: var(--shadow-sm); transition: background .15s;
}
.cart-btn:hover { background: var(--brand-2); }
.cart-btn.active { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 2px; }
.badge-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--on-brand); color: var(--brand); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

/* ===== Carga ===== */
.loading { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== Botones y chips ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 14px;
  transition: background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { border: 0; background: var(--surface-2); width: 36px; height: 36px; border-radius: 99px; display: grid; place-items: center; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 500; color: var(--text-2);
  white-space: nowrap; transition: all .15s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--surface); }
.store { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.store i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.pill.offer { background: var(--offer); color: #fff; }
.pill.best { background: var(--down); color: #fff; }
.pill.soft { background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.pill.multi { background: var(--brand-soft); color: var(--brand); }
.trend { font-size: 12px; font-weight: 700; }
.trend.down { color: var(--down); }
.trend.up { color: var(--up); }

/* ===== Portada ===== */
.hero {
  margin: 24px 0 8px; padding: 44px 40px; border-radius: 22px; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand) 24%, transparent), transparent 55%),
              linear-gradient(135deg, var(--brand-soft), var(--surface));
  border: 1px solid var(--border);
}
.hero h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; max-width: 720px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { margin: 14px 0 22px; color: var(--text-2); font-size: 17px; max-width: 620px; }
.hero-search { max-width: 620px; }
.hero-search input { height: 54px; font-size: 16px; background: var(--surface); box-shadow: var(--shadow); }
.hero .stores-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.suggest span { color: var(--muted); font-size: 13px; margin-right: 2px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 0; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi b { display: block; font-size: 22px; letter-spacing: -.02em; }
.kpi span { color: var(--muted); font-size: 13px; }

.block { margin: 36px 0 0; }
.block-hd { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.block-hd h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.block-hd p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.link { color: var(--brand); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.section-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.section-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.section-tile .em { font-size: 26px; line-height: 1; }
.section-tile b { font-size: 14px; font-weight: 600; line-height: 1.25; }
.section-tile small { color: var(--muted); font-size: 12px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
.pb-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* ===== Explorar ===== */
.explore { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; margin-top: 24px; align-items: start; }
.filters { position: sticky; top: calc(var(--hdr-h) + 16px); display: grid; gap: 22px; max-height: calc(100vh - var(--hdr-h) - 32px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.filters h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; }
.opt:hover { background: var(--surface-2); color: var(--text); }
.opt input { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; }
.opt .n { margin-left: auto; color: var(--muted); font-size: 12px; }
.opt.on { color: var(--text); font-weight: 600; background: var(--surface-2); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--text-2); cursor: pointer; padding: 6px 8px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.results-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.results-hd h1 { font-size: 22px; margin: 0; letter-spacing: -.02em; }
.results-hd p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.select { height: 38px; padding: 0 34px 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376827c' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; appearance: none; font-size: 14px; font-weight: 500; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.active-filters .chip { height: 30px; font-size: 13px; padding: 0 10px 0 12px; }
.active-filters .chip svg { width: 14px; height: 14px; }
.filters-btn { display: none; }

/* ===== Tarjetas ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; text-align: left; padding: 0;
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-2px); }
.card .media { aspect-ratio: 1 / .86; background: #fff; display: grid; place-items: center; padding: 14px; position: relative; border-bottom: 1px solid var(--border); }
.card .media img { max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.card .noimg { font-size: 40px; opacity: .35; }
.card .tags { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .nm { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card .meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.price { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.price.offer { color: var(--offer); }
.price small { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 2px; letter-spacing: 0; }
.old { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.per { color: var(--muted); font-size: 12px; }
.card .stores-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.card .stores-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 3px 6px; border-radius: 6px; }
.card .stores-list li.best { background: var(--down-soft); font-weight: 700; }
.card .stores-list b { font-weight: 700; }
.card .stores-list .offer { color: var(--offer); }
.card .hint { font-size: 12px; color: var(--down); font-weight: 600; margin-top: 6px; }
.add-btn {
  position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; color: var(--brand); box-shadow: var(--shadow-sm);
  transition: transform .15s, background .15s; z-index: 2;
}
.add-btn:hover { transform: scale(1.08); background: var(--brand-soft); }
.add-btn.in { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.add-btn svg { width: 18px; height: 18px; stroke-width: 2.4; }
.more { display: flex; justify-content: center; padding: 24px 0 8px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 64px 20px; color: var(--muted); }
.empty .em { font-size: 44px; }
.empty h3 { color: var(--text); margin: 10px 0 4px; }

/* ===== Marcas blancas ===== */
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.eq-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; text-align: left; transition: box-shadow .18s, border-color .18s; display: flex; flex-direction: column; gap: 10px; }
.eq-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.eq-card .top { display: flex; gap: 12px; align-items: center; }
.eq-card .top img { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--border); padding: 4px; }
.eq-card h3 { margin: 0; font-size: 15px; line-height: 1.25; }
.eq-card .sub { color: var(--muted); font-size: 12.5px; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; border-radius: 99px; background: var(--c); opacity: .85; }
.bar-row.best { font-weight: 700; }
.bar-row .v { font-variant-numeric: tabular-nums; }
.eq-foot { font-size: 12.5px; color: var(--muted); }
.eq-foot b { color: var(--up); }

/* ===== Cambios ===== */
.changes-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.change-list { display: grid; gap: 8px; }
.change {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; text-align: left;
}
.change:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.change img { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 8px; }
.change .n { font-weight: 600; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.change .v { text-align: right; font-size: 13px; white-space: nowrap; }
.h2-down { color: var(--down); } .h2-up { color: var(--up); }

/* ===== Lista de la compra ===== */
.list-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; margin-top: 24px; align-items: start; }
.list-items { display: grid; gap: 10px; }
.li {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
}
.li img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 10px; }
.li .n { font-weight: 600; font-size: 14px; line-height: 1.3; cursor: pointer; }
.li .n:hover { color: var(--brand); }
.li .where { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.li .where .best { color: var(--down); font-weight: 700; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 999px; height: 34px; }
.qty button { border: 0; background: none; width: 34px; height: 32px; display: grid; place-items: center; color: var(--text-2); border-radius: 99px; }
.qty button:hover { background: var(--surface-2); }
.qty button svg { width: 16px; height: 16px; }
.qty span { min-width: 22px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.li .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.li .side .price { font-size: 17px; }
.summary { position: sticky; top: calc(var(--hdr-h) + 16px); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.summary h2 { margin: 0 0 4px; font-size: 18px; }
.summary .lead { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.totals { display: grid; gap: 8px; }
.total-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.total-row.partial { opacity: .62; }
.total-row.best { border-color: color-mix(in srgb, var(--down) 45%, transparent); background: var(--down-soft); }
.total-row .t { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.total-row .miss { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.total-row .bar { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.total-row .bar i { display: block; height: 100%; background: var(--c); }
.combo { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.combo h3 { margin: 0 0 4px; font-size: 14px; }
.combo .t { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.combo ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.combo li { display: flex; justify-content: space-between; gap: 8px; }
.list-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ===== Hoja de detalle ===== */
.sheet { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; margin: 0; }
.sheet::backdrop { background: rgb(8 12 10 / .5); backdrop-filter: blur(2px); }
.sheet[open] { display: grid; place-items: center; }
.sheet-in {
  position: relative; width: min(860px, calc(100vw - 40px)); max-height: calc(100vh - 60px); overflow-y: auto;
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 28px; overscroll-behavior: contain;
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.sheet-close { position: absolute; top: 16px; right: 16px; z-index: 2; }
.detail { display: grid; grid-template-columns: 260px 1fr; gap: 28px; }
.detail .media { background: #fff; border-radius: 16px; border: 1px solid var(--border); aspect-ratio: 1; display: grid; place-items: center; padding: 18px; }
.detail .media img { max-height: 100%; object-fit: contain; }
.detail h2 { margin: 6px 0 6px; font-size: 24px; letter-spacing: -.02em; line-height: 1.2; padding-right: 36px; }
.detail .sub { color: var(--muted); font-size: 14px; }
.detail .big { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 2px; flex-wrap: wrap; }
.detail .big .price { font-size: 32px; }
.detail .actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.sheet h3 { font-size: 15px; margin: 26px 0 10px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.cmp td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cmp tr:last-child td { border-bottom: 0; }
.cmp .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cmp tr.best td { background: var(--down-soft); }
.cmp tr.best td:first-child { border-radius: 10px 0 0 10px; }
.cmp tr.best td:last-child { border-radius: 0 10px 10px 0; }
.cmp .pn { font-size: 13px; color: var(--text-2); }
.cmp .go { color: var(--brand); font-weight: 600; font-size: 13px; white-space: nowrap; }
.chart svg { width: 100%; height: auto; }
.chart .gl { stroke: var(--border); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; stroke: none; font-family: var(--font); }
.chart .ln { fill: none; stroke-width: 2.4; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.note { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; color: var(--text-2); font-size: 13.5px; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 28px; translate: -50% 0; z-index: 60; background: var(--text); color: var(--surface);
  padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px; animation: up .2s ease-out;
}
.toast a { color: var(--brand-2); font-weight: 700; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

/* ===== Pie ===== */
.ftr { padding: 48px 20px 40px; font-size: 13px; color: var(--text-2); }
.ftr p { margin: 4px 0; max-width: 760px; }

/* ===== Barra inferior (móvil) ===== */
.tabbar { display: none; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .nav a { padding: 8px 10px; }
  .cart-label { display: none; }
  .cart-btn { width: 44px; padding: 0; justify-content: center; }
  .badge-count { position: absolute; top: -4px; right: -4px; border: 2px solid var(--surface); }
}
@media (max-width: 900px) {
  :root { --hdr-h: 60px; }
  .nav, .cart-btn { display: none; }
  .hdr-in { gap: 12px; }
  .logo span { display: none; }
  .search { max-width: none; }
  .explore { grid-template-columns: 1fr; gap: 0; }
  .filters {
    position: fixed; inset: auto 0 0 0; top: auto; z-index: 50; max-height: 78vh; background: var(--surface);
    border-radius: 22px 22px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg);
    transform: translateY(105%); transition: transform .25s ease; overflow-y: auto;
  }
  .filters.open { transform: none; box-shadow: 0 0 0 100vmax rgb(8 12 10 / .45), var(--shadow-lg); }
  .filters-btn { display: inline-flex; }
  .filters-close { display: flex !important; }
  .list-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .changes-cols { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; gap: 16px; }
  .detail .media { max-width: 170px; margin: 0 auto; width: 100%; padding: 12px; }
  .detail h2 { font-size: 21px; }
  .detail .big .price { font-size: 28px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--brand); }
  .dot-count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--brand); color: var(--on-brand); font-size: 10.5px; font-style: normal; font-weight: 700; display: grid; place-items: center; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .sheet[open] { place-items: end center; }
  .sheet-in { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); animation: slide .22s ease-out; }
  @keyframes slide { from { transform: translateY(40px); opacity: .6; } }
}
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .hero { padding: 28px 20px; margin-top: 14px; border-radius: 18px; }
  .hero p { font-size: 15px; }
  .suggest { flex-wrap: nowrap; overflow-x: auto; margin-right: -20px; padding-right: 20px; scrollbar-width: none; }
  .suggest::-webkit-scrollbar { display: none; }
  .suggest span { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card .body { padding: 10px; }
  .card .media { padding: 10px; }
  .price { font-size: 18px; }
  .add-btn { width: 32px; height: 32px; right: 8px; top: 8px; }
  .sections { grid-template-columns: repeat(2, 1fr); }
  .eq-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 80px 1fr auto; }
  .li { grid-template-columns: 52px minmax(0, 1fr); }
  .li img { width: 52px; height: 52px; }
  .li .side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .cmp .pn-col { display: none; }
  .block-hd h2 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
