/* ==========================================================================
   Mare Expresión · estilos (mobile first)
   ========================================================================== */

:root {
  --rojo: #e71012;
  --rojo-700: #b80d0f;
  --verde: #2b9b26;
  --verde-700: #1f7a1b;
  --verde-50: #ecfaee;
  --grad-a: linear-gradient(135deg, #59fa7b 0%, #27a22e 100%);

  --ink: #1b1d1c;
  --ink-2: #545a57;
  --ink-3: #8a908d;
  --line: #e7ebe8;
  --bg: #ffffff;
  --bg-soft: #f5f7f5;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --shadow: 0 6px 24px rgba(20, 40, 25, .10);
  --shadow-lg: 0 18px 50px rgba(20, 40, 25, .22);

  --header-h: 116px;
  --wrap: 1200px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
html, body { overflow-x: clip; }
body.locked { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.muted { color: var(--ink-3); }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.i { width: 22px; height: 22px; flex: none; }
.i.sm { width: 16px; height: 16px; vertical-align: -3px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--rojo); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--grad-a);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

.header-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "logo . cart" "search search search";
  align-items: center;
  gap: 8px 12px;
  padding-top: 10px; padding-bottom: 10px;
}
.logo { grid-area: logo; display: block; }
.logo img { height: 52px; width: auto; }
.cart-btn { grid-area: cart; }
.search { grid-area: search; position: relative; }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
.badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px;
  background: var(--rojo); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
}

.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; height: 46px;
  padding: 0 44px 0 44px;
  border: 0; border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  font-size: 15px;
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: 3px solid rgba(231, 16, 18, .35); outline-offset: 0; }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent;
  display: grid; place-items: center; color: var(--ink-2);
}
.search-clear .i { position: static; transform: none; width: 18px; height: 18px; }

.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: #fff; border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  max-height: min(70vh, 520px); overflow-y: auto;
  padding: 6px;
  z-index: 40;
}
.sr-group { padding: 10px 10px 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.sr-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
  padding: 8px 10px; border-radius: 12px; text-decoration: none;
}
.sr-item:hover, .sr-item[aria-selected="true"] { background: var(--bg-soft); }
.sr-item img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.sr-name { font-weight: 500; font-size: 14px; line-height: 1.3; }
.sr-cat { font-size: 12px; color: var(--ink-3); }
.sr-price { font-weight: 600; font-size: 14px; }
.sr-name mark { background: #fff3a8; color: inherit; border-radius: 3px; }
.sr-empty { padding: 16px 12px 6px; color: var(--ink-2); font-size: 14px; }
.sr-all { display: block; margin: 4px; padding: 12px; text-align: center; font-weight: 600; color: var(--verde-700); border-radius: 12px; text-decoration: none; }
.sr-all:hover { background: var(--verde-50); }

/* ---------- Chips de categorías (menú deslizable) ---------- */
.chips-bar { background: rgba(255, 255, 255, .96); border-top: 1px solid rgba(0, 0, 0, .04); }
.chips {
  display: flex; gap: 8px;
  overflow-x: auto; scroll-snap-type: x proximity;
  padding-top: 10px; padding-bottom: 10px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  padding: 8px 16px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: #fff;
  font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--verde); }
.chip[aria-current="page"] { background: var(--rojo); border-color: var(--rojo); color: #fff; }

/* ---------- Hero slider ---------- */
.hero { position: relative; margin-top: 16px; }
.hero-track {
  display: flex; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-inline: 16px;
  scroll-padding-inline: 16px;
}
.hero-track::-webkit-scrollbar { display: none; }
.slide {
  position: relative; flex: 0 0 100%;
  scroll-snap-align: center;
  min-height: 210px;
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px;
  color: #fff; text-decoration: none;
  isolation: isolate;
}
.slide::after { /* gato decorativo */
  content: ""; position: absolute; right: -30px; top: -10px;
  width: 190px; height: 240px;
  background: url(../img/gato.webp) center / contain no-repeat;
  opacity: .22; z-index: -1; transform: rotate(8deg);
}
.slide[data-theme="rojo"] { background: linear-gradient(135deg, #ff4a3d, var(--rojo) 55%, #8f0709); }
.slide[data-theme="noche"] { background: linear-gradient(135deg, #3b2a55, #1a1422 70%); }
.slide[data-theme="verde"] { background: linear-gradient(135deg, #59fa7b, #27a22e 70%); }
.slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.slide.has-img::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,0) 70%); }
.slide.has-img::after { display: none; }
.slide h2 { font-size: 26px; font-weight: 800; max-width: 16ch; }
.slide p { margin: 6px 0 14px; font-size: 14px; max-width: 34ch; opacity: .95; }
.slide .btn { align-self: flex-start; }
.hero-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.hero-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: #cfd6d1; transition: width .25s var(--ease), background .25s; }
.hero-dots button[aria-current="true"] { width: 22px; background: var(--rojo); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border: 0; border-radius: 999px;
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform .1s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--rojo); color: #fff; }
.btn-primary:hover { background: var(--rojo-700); }
.btn-wa { background: #25d366; color: #0b3d1f; }
.btn-wa:hover { background: #1fbe5b; }
.btn-light { background: #fff; color: var(--ink); }
.btn-ghost { background: var(--bg-soft); color: var(--ink); }
.btn-outline-light { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .6); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 16px; }

/* ---------- Secciones ---------- */
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 20px; font-weight: 700; }
.section-head a { font-size: 14px; font-weight: 600; color: var(--verde-700); text-decoration: none; white-space: nowrap; }
.section-head a:hover { text-decoration: underline; }

/* Grupos (catrina / zombie / complementos) */
.groups { display: grid; gap: 12px; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.groups::-webkit-scrollbar { display: none; }
.group-card {
  scroll-snap-align: start;
  position: relative; min-height: 150px;
  border-radius: var(--r);
  padding: 16px;
  display: flex; flex-direction: column; justify-content: flex-end;
  color: #fff; text-decoration: none; overflow: hidden;
}
.group-card[data-g="corporal"] { background: linear-gradient(160deg, #ff7a59, var(--rojo)); }
.group-card[data-g="efectos"] { background: linear-gradient(160deg, #4a3a5e, #16121c); }
.group-card[data-g="complementos"] { background: linear-gradient(160deg, #59fa7b, var(--verde-700)); }
.group-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.group-card.has-img::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(0,0,0,.65), rgba(0,0,0,0) 75%); }
.group-card { isolation: isolate; }
.group-card .ph { position: absolute; top: 12px; right: 12px; font-size: 11px; padding: 3px 8px; border: 1px dashed rgba(255, 255, 255, .7); border-radius: 6px; opacity: .85; }
.group-card h3 { font-size: 18px; font-weight: 700; }
.group-card p { margin: 2px 0 0; font-size: 13px; opacity: .9; }

/* ---------- Carretes ---------- */
.rail { position: relative; }
.rail-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 44%;
  gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 6px;
  scroll-padding-inline: 16px;
  margin-inline: -16px; padding-inline: 16px;
}
.rail-track::-webkit-scrollbar { display: none; }
.rail-track > * { scroll-snap-align: start; }
.rail-arrow {
  display: none;
  position: absolute; top: 34%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: #fff; box-shadow: var(--shadow);
  place-items: center; z-index: 2;
}
.rail-arrow.prev { left: -14px; }
.rail-arrow.next { right: -14px; }
.rail-arrow[disabled] { opacity: 0; pointer-events: none; }
.see-all {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  aspect-ratio: 1; border-radius: var(--r);
  background: var(--verde-50); color: var(--verde-700);
  font-weight: 600; text-decoration: none; text-align: center; padding: 12px;
}
.see-all .circle { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: var(--shadow); }

/* ---------- Tarjeta de producto ---------- */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card-link { text-decoration: none; display: block; }
.card-img {
  position: relative; aspect-ratio: 1;
  border-radius: var(--r); overflow: hidden;
  background: var(--bg-soft);
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.card-link:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 8px 2px 0; }
.card-name { font-size: 14px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.price { font-weight: 700; }
.price s { font-weight: 400; color: var(--ink-3); font-size: .85em; margin-left: 6px; }
.card .price { font-size: 15px; margin-top: 2px; display: block; }
.tag {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: #fff; color: var(--ink);
}
.tag.sale { background: var(--rojo); color: #fff; }
.tag.out { background: var(--rojo); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 5px 11px; box-shadow: 0 2px 8px rgba(231,16,18,.35); z-index: 1; }
.tag-lg { top: 14px; left: 14px; font-size: 14px; padding: 7px 14px; }
.card.is-out .card-img img, .pd-page.is-out .pd-img img, .is-out-img { filter: grayscale(.6); opacity: .4; }
.card.is-out .card-name, .card.is-out .price { color: var(--ink-3); }
.quick-add {
  position: absolute; right: 8px; top: calc(100% - 0px);
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: #fff; color: var(--ink); box-shadow: var(--shadow);
  display: grid; place-items: center;
  transform: translateY(-120%);
}
.card-img-wrap { position: relative; }
.quick-add:hover { background: var(--rojo); color: #fff; }

/* ---------- Catálogo / grid ---------- */
.page-head { padding-top: 20px; }
.crumbs { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-head h1 { font-size: 24px; font-weight: 700; margin-top: 4px; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.toolbar {
  position: sticky; top: var(--header-h); z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; margin-top: 8px;
  background: rgba(255, 255, 255, .96);
}
.toolbar .count { white-space: nowrap; font-size: 13px; color: var(--ink-3); margin-right: auto; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 14px; font-weight: 500;
}
.pill-btn .n { background: var(--rojo); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; line-height: 18px; }
.select-wrap { min-width: 0; flex: 0 1 auto; }
.select-wrap select { max-width: 100%; height: 38px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-size: 14px; }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.active-filters button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--verde-50); color: var(--verde-700); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 500; }
.active-filters .i { width: 14px; height: 14px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-2); }
.empty img { width: 90px; margin: 0 auto 12px; opacity: .5; }

/* ---------- Banda de cita y redes ---------- */
.band {
  margin-top: 36px;
  border-radius: var(--r-lg);
  background: var(--verde-50);
  padding: 22px;
  display: grid; gap: 16px;
}
.band h2 { font-size: 20px; }
.band p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.band-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.socials { display: flex; gap: 10px; }
.social {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--ink); text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
.social:hover { background: var(--rojo); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; background: #151816; color: #d9dfdb; padding: 36px 0 110px; font-size: 14px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 28px; }
.footer-logo { width: 180px; height: auto; margin-bottom: 10px; }
.footer-h { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: #8f9893; margin-bottom: 10px; font-weight: 600; }
.site-footer .muted { color: #b8c0bb; margin: 0 0 12px; }
.site-footer .social { background: #262a27; color: #fff; box-shadow: none; }
.site-footer .social:hover { background: var(--rojo); }
.footer-bottom { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; padding-top: 18px; border-top: 1px solid #2a2f2c; font-size: 12px; }
.footer-bottom .muted { color: #8f9893; }

/* ---------- Barra flotante del carrito ---------- */
.cart-bar {
  position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 25;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 18px;
  border: 0; border-radius: 999px;
  background: var(--rojo); color: #fff;
  box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 15px;
  animation: pop-in .35s var(--ease);
}
.cart-bar span:nth-child(2) { margin-right: auto; }
.cart-bar-count { background: rgba(255, 255, 255, .22); border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; font-size: 13px; }
@keyframes pop-in { from { transform: translateY(30px); opacity: 0; } }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(10, 15, 12, .5); opacity: 0; transition: opacity .25s; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform .32s var(--ease);
}
.sheet.show { transform: none; }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: #d8ddda; margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px 12px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-head h2 { font-size: 18px; font-weight: 700; margin-right: auto; }
.sheet-close { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg-soft); display: grid; place-items: center; flex: none; }
.sheet-body { overflow-y: auto; padding: 16px; flex: 1; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; flex: none; }

/* Producto */
.sheet-product .sheet-body { padding: 0; }
.sheet-product .sheet-close.floating { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow); }
.pd-img { aspect-ratio: 1; max-height: 46vh; width: 100%; background: var(--bg-soft); }
.pd-img img { width: 100%; height: 100%; object-fit: contain; }
.pd-info { padding: 16px; }
.pd-cat { font-size: 13px; color: var(--verde-700); font-weight: 600; text-decoration: none; }
.pd-info h2 { font-size: 22px; font-weight: 700; margin: 2px 0 6px; }
.pd-price { font-size: 20px; }
.stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; margin-top: 6px; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--verde); }
.stock.low::before { background: #f0a500; }
.stock.out { color: var(--rojo); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.stock.out::before { background: var(--rojo); }
.stock.checking::before { background: #cfd6d1; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.pd-label { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
.pd-label span { font-weight: 400; color: var(--ink-2); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--line);
  padding: 0;
}
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2.5px var(--rojo); }
.swatch[data-out="1"]::after { content: ""; position: absolute; inset: 50% -2px auto; height: 2px; background: var(--ink-2); transform: rotate(-45deg); }
.swatch[data-out="1"] { opacity: .5; }
.pd-desc { font-size: 14px; color: var(--ink-2); margin-top: 16px; }
.note { font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.pd-foot { display: flex; gap: 10px; align-items: center; }
.pd-foot .btn { flex: 1; }
.qty { display: inline-flex; align-items: center; border-radius: 999px; background: var(--bg-soft); height: 48px; flex: none; }
.qty button { width: 44px; height: 48px; border: 0; background: transparent; display: grid; place-items: center; border-radius: 50%; }
.qty button[disabled] { opacity: .3; }
.qty output { min-width: 26px; text-align: center; font-weight: 600; }
.qty.sm { height: 36px; }
.qty.sm button { width: 34px; height: 36px; }
.qty.sm .i { width: 16px; height: 16px; }
.related { padding: 0 16px 20px; }
.related h3 { font-size: 16px; margin-bottom: 10px; }

/* Carrito */
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.cart-line h3 { font-size: 14px; font-weight: 500; }
.cart-line .var { font-size: 12px; color: var(--ink-3); }
.cart-line .line-end { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; }
.cart-line .warn { font-size: 12px; color: var(--rojo); font-weight: 500; }
.link-btn { border: 0; background: none; padding: 4px; color: var(--ink-3); display: inline-flex; }
.link-btn:hover { color: var(--rojo); }
.totals { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 4px; }
.totals strong { font-size: 18px; }

/* Formulario de pedido */
.seg { display: grid; gap: 8px; }
.seg label {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer;
}
.seg label:has(input:checked) { border-color: var(--rojo); background: #fff6f6; }
.seg input { grid-row: span 2; accent-color: var(--rojo); width: 18px; height: 18px; margin: 0; }
.seg b { font-weight: 600; font-size: 14px; }
.seg small { color: var(--ink-3); font-size: 12px; }
.fieldset { border: 0; padding: 0; margin: 20px 0 0; }
.fieldset legend { font-weight: 700; font-size: 15px; margin-bottom: 10px; padding: 0; }
.fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.f { grid-column: span 6; display: flex; flex-direction: column; gap: 4px; }
.f.half { grid-column: span 3; }
.f.third { grid-column: span 2; }
.f label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.f label .opt { font-weight: 400; color: var(--ink-3); }
.f input, .f select, .f textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff;
  font-size: 16px; /* evita zoom en iOS */
}
.f textarea { min-height: 70px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(43, 155, 38, .15); }
.f.invalid input, .f.invalid select { border-color: var(--rojo); }
.f .err { font-size: 12px; color: var(--rojo); display: none; }
.f.invalid .err { display: block; }
.geo { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-sm); background: var(--bg-soft); grid-column: span 6; }
.geo .status { font-size: 13px; color: var(--ink-2); }
.geo .status a { color: var(--verde-700); font-weight: 600; }
.geo .status.ok { color: var(--verde-700); font-weight: 500; }
.summary { background: var(--bg-soft); border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; color: var(--ink-2); }
.summary b { color: var(--ink); }
.done { text-align: center; padding: 24px 8px; }
.done img { width: 110px; margin: 0 auto 12px; }
.done h3 { font-size: 20px; margin-bottom: 6px; }
.done p { color: var(--ink-2); font-size: 14px; }

/* Filtros */
.filter-group { padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.filter-group:last-child { border-bottom: 0; }
.filter-group h3 { font-size: 15px; margin-bottom: 10px; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-list label { position: relative; }
.check-list input { position: absolute; opacity: 0; }
.check-list span { display: inline-block; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; cursor: pointer; }
.check-list input:checked + span { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.check-list input:focus-visible + span { outline: 3px solid var(--rojo); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch-row input { flex: none; width: 24px; height: 24px; accent-color: var(--verde); }
.price-inputs { display: flex; gap: 10px; align-items: center; }
.price-inputs input { flex: 1; min-width: 0; width: 100%; height: 44px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font-size: 16px; }
.filter-foot { display: flex; gap: 10px; }
.filter-foot .btn { flex: 1; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 90px; z-index: 80;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px);
  animation: pop-in .25s var(--ease);
}

/* ==========================================================================
   Tablet / escritorio
   ========================================================================== */
@media (min-width: 640px) {
  .rail-track { grid-auto-columns: 30%; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .groups { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .group-card { min-height: 190px; }
  .slide { flex-basis: 100%; min-height: 280px; padding: 36px; }
  .slide h2 { font-size: 34px; }
  .slide::after { width: 280px; height: 340px; right: 10px; }
  .band { grid-template-columns: 1fr auto; align-items: center; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 900px) {
  :root { --header-h: 124px; }
  body { font-size: 16px; }
  .header-row { grid-template-columns: auto minmax(0, 560px) auto; grid-template-areas: "logo search cart"; justify-content: space-between; gap: 24px; padding-top: 12px; padding-bottom: 12px; }
  .logo img { height: 52px; }
  .rail-track { grid-auto-columns: calc((100% - 4 * 16px) / 5); gap: 16px; margin-inline: 0; padding-inline: 0; }
  .rail-arrow { display: grid; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 16px; }
  .hero-track { padding-inline: max(16px, calc((100vw - var(--wrap)) / 2 + 16px)); scroll-padding-inline: max(16px, calc((100vw - var(--wrap)) / 2 + 16px)); }
  .slide { flex-basis: min(100%, calc(var(--wrap) - 32px)); min-height: 340px; padding: 48px; }
  .slide h2 { font-size: 44px; }
  .section { margin-top: 44px; }
  .section-head h2 { font-size: 24px; }
  .page-head h1 { font-size: 32px; }
  .cart-bar { left: auto; right: 24px; width: 340px; }

  /* Sheets como modal centrado */
  .sheet {
    left: 50%; top: 50%; bottom: auto; right: auto;
    width: min(560px, calc(100vw - 48px));
    max-height: min(88vh, 860px);
    border-radius: var(--r-lg);
    transform: translate(-50%, -46%) scale(.98); opacity: 0;
    transition: transform .25s var(--ease), opacity .2s;
  }
  .sheet.show { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grip { display: none; }
  .sheet-product { width: min(920px, calc(100vw - 48px)); }
  .sheet-product .pd-top { display: grid; grid-template-columns: 1fr 1fr; }
  .sheet-product .pd-img { max-height: none; height: 100%; min-height: 420px; }
  .sheet-product .pd-info { padding: 32px 28px; }
  #sheet-cart { left: auto; right: 0; top: 0; bottom: 0; height: 100vh; max-height: none; border-radius: var(--r-lg) 0 0 var(--r-lg); transform: translateX(100%); opacity: 1; width: 420px; }
  #sheet-cart.show { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Página de producto ---------- */
.pd-crumbs { padding-top: 16px; }
.pd-crumbs span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.pd-page { display: grid; gap: 20px; margin-top: 12px; }
.pd-page .pd-img { position: relative; border-radius: var(--r-lg); overflow: hidden; max-height: none; aspect-ratio: 1; }
.pd-page .pd-info { padding: 0; }
.pd-page h1 { font-size: 24px; font-weight: 700; margin: 2px 0 6px; }
.pd-buy { display: flex; gap: 10px; margin-top: 20px; }
.pd-buy .btn { flex: 1; }
.ask-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 14px; font-weight: 500; color: var(--verde-700); text-decoration: none; }
.ask-link:hover { text-decoration: underline; }
.pd-desc p { margin: 0 0 10px; }
.pd-desc ul { padding-left: 20px; margin: 0 0 10px; }

/* Opciones (otros tonos / tamaños del mismo producto) */
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 6px 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer;
}
.opt:hover { border-color: var(--verde); }
.opt[aria-current="true"] { border-color: var(--rojo); box-shadow: 0 0 0 1px var(--rojo); background: #fff6f6; }
.opt[data-out="1"] { color: var(--ink-3); text-decoration: line-through; }
.opt .dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); flex: none; }

@media (min-width: 900px) {
  .pd-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; margin-top: 20px; align-items: start; }
  .pd-page .pd-img { position: sticky; top: calc(var(--header-h) + 16px); }
  .pd-page h1 { font-size: 32px; }
}

body:has(.cart-bar:not([hidden])) main { padding-bottom: 76px; }
.sr-ico { width: 52px; height: 36px; display: grid; place-items: center; color: var(--ink-3); }
.sr-cat-item { grid-template-columns: 52px 1fr auto; }
.sr-out { color: var(--rojo); }
.pd-top.is-out .pd-img { position: relative; }
.sheet-product .pd-img { position: relative; }
.note a { color: var(--verde-700); font-weight: 600; }
.cart-line h3 a { text-decoration: none; }
