/* ============================================================
   Selvana — catálogo virtual
   Mobile-first. Paleta y reglas en DESIGN.md
   ============================================================ */

:root {
  /* color */
  --green-900: #14291d;
  --green-800: #1e4d33;
  --green-700: #2f6b48;
  --green-600: #3e8359;
  --sage-200: #dce7da;
  --sage-100: #eaf0e6;
  --bg: #f5f7f2;
  --surface: #ffffff;
  --ink: #18241b;
  --ink-soft: #4c5a50;
  --line: #e2e8de;
  --amber-700: #7a4e1d;
  --amber-600: #a96a1f;
  --amber-100: #f6e8ce;
  --danger: #b3382b;
  --wa: #1f7a4d;

  /* type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* espacio (escala 4px) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  /* radio */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* sombras y movimiento */
  --shadow-card: 0 1px 2px rgba(20, 41, 29, 0.06), 0 6px 18px rgba(20, 41, 29, 0.07);
  --shadow-drawer: -8px 0 32px rgba(20, 41, 29, 0.18);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

* { box-sizing: border-box; }

/* `hidden` siempre gana sobre display:flex/block de los estilos */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
.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; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--s-4); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--green-800); color: #fff; padding: 8px 16px; border-radius: 0 0 var(--r-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; border-radius: var(--r-sm); }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(245, 247, 242, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; box-shadow: 0 1px 3px rgba(20, 41, 29, 0.18); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.01em; }
.brand-text small { font-size: 0.72rem; color: var(--ink-soft); letter-spacing: 0.02em; }

.cart-button {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: var(--r-pill);
  background: var(--green-800); color: #fff; border: none; cursor: pointer;
  font: inherit; font-weight: 600;
  transition: background-color 0.2s var(--ease);
}
.cart-button:hover { background: var(--green-700); }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--amber-600); color: #fff;
  font-size: 0.72rem; font-weight: 700; border-radius: var(--r-pill);
  border: 2px solid var(--bg);
}
.cart-total-mini { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.01em; }
@media (max-width: 759px) { .cart-total-mini { display: none; } }

/* ===== Mini carrito flotante ===== */
.mini-cart {
  position: fixed; z-index: 45;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 10px;
  background: var(--green-800); color: #fff;
  border: none; border-radius: var(--r-md);
  min-height: 64px; padding: 12px 14px; cursor: pointer;
  box-shadow: 0 10px 28px rgba(20, 41, 29, 0.35);
  transform: translateY(calc(100% + 80px));
  transition: transform 0.25s var(--ease);
}
.mini-cart.show { transform: translateY(0); }
@media (max-width: 759px) {
  body.cart-has-items { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}
.mini-cart-icon { position: relative; display: inline-flex; flex: 0 0 auto; }
.mini-cart-badge {
  position: absolute; top: -7px; right: -9px;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--amber-600); color: #fff;
  font-size: 0.68rem; font-weight: 700; border-radius: var(--r-pill);
}
.mini-cart-info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.mini-cart-info strong { font-size: 1.02rem; }
.mini-cart-info small { font-size: 0.72rem; opacity: 0.85; }
.mini-cart-cta {
  margin-left: auto;
  background: #fff; color: var(--green-800);
  font-size: 0.82rem; font-weight: 700;
  padding: 8px 14px; border-radius: var(--r-sm);
  flex: 0 0 auto;
}
.mini-cart.pulse { animation: miniPulseY 0.35s var(--ease); }
@keyframes miniPulseY {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(0) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

@media (min-width: 760px) {
  .mini-cart {
    left: auto; right: 24px; bottom: 24px;
    min-width: 240px;
    transform: translateX(calc(100% + 60px));
  }
  .mini-cart.show { transform: translateX(0); }
  .mini-cart.pulse { animation-name: miniPulseX; }
  @keyframes miniPulseX {
    0% { transform: translateX(0) scale(1); }
    50% { transform: translateX(0) scale(1.05); }
    100% { transform: translateX(0) scale(1); }
  }
}

/* ===== Hero ===== */
.hero {
  padding: var(--s-5) 0;
  background:
    radial-gradient(600px 300px at 85% -10%, rgba(220, 231, 218, 0.9), transparent 70%),
    radial-gradient(500px 280px at -10% 110%, rgba(246, 232, 206, 0.6), transparent 70%);
}
.hero-grid { display: grid; gap: var(--s-5); align-items: center; }
.eyebrow {
  margin: 0 0 var(--s-2);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--green-700);
}
.hero h1 {
  font-size: clamp(2rem, 7vw, 3.5rem);
  font-weight: 600; max-width: 15ch; letter-spacing: -0.025em;
}
.hero-sub { margin: var(--s-3) 0 0; max-width: 48ch; color: var(--ink-soft); font-size: 0.98rem; }
.hero-actions { margin-top: var(--s-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.hero-secondary { color: var(--green-800); font-size: 0.9rem; font-weight: 700; text-decoration: none; padding: 10px 0; }
.hero-secondary:hover { text-decoration: underline; }
.hero-pills { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.pill {
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.73rem; font-weight: 600; color: var(--ink-soft);
}
.hero-feature { display: flex; align-items: center; gap: var(--s-3); min-width: 0; padding: var(--s-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); color: var(--ink); text-decoration: none; }
.hero-feature-image { display: block; width: 82px; height: 82px; flex: 0 0 auto; border-radius: var(--r-md);
  background: var(--sage-100) url("../img/optimized/pack-4-720.webp") center / cover no-repeat; }
.hero-feature-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.hero-feature-text strong { font-family: var(--font-display); font-size: 1rem; }
.hero-feature-text small { color: var(--ink-soft); font-size: 0.76rem; }
.hero-feature-arrow { margin-left: auto; align-self: flex-start; color: var(--green-800); font-size: 1.25rem; font-weight: 700; }
.hero-feature:hover { border-color: var(--green-700); box-shadow: var(--shadow-drawer); }
@media (max-width: 759px) {
  .hero { padding: var(--s-4) 0; }
  .hero-feature, .hero-pills { display: none; }
}

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-md);
  font: inherit; font-weight: 600; font-size: 0.95rem;
  border: none; cursor: pointer; text-decoration: none;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--green-800); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-secondary { background: var(--surface); color: var(--green-800); border: 1.5px solid var(--green-700); }
.btn-secondary:hover { background: var(--sage-100); }
.btn-whatsapp { background: var(--wa); color: #fff; }
.btn-whatsapp:hover { background: #17683f; }
.btn-block { width: 100%; }

/* ===== Catálogo ===== */
.catalog { padding: var(--s-5) 0 var(--s-7); scroll-margin-top: 72px; }
.catalog-head {
  display: flex; flex-direction: column; gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.section-kicker { margin: 0 0 var(--s-1); color: var(--green-700); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.catalog-head h2 { font-size: 1.5rem; font-weight: 600; }
.catalog-count {
  margin-left: var(--s-2);
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
  color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--line); padding: 4px 10px;
  border-radius: var(--r-pill); vertical-align: middle; white-space: nowrap;
}
.catalog-search { display: flex; align-items: center; gap: var(--s-2); width: 100%; padding: 0 var(--s-3);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); color: var(--green-800); }
.catalog-search:focus-within { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(47, 107, 72, 0.14); }
.catalog-search input { width: 100%; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.catalog-search input::placeholder { color: var(--ink-soft); opacity: 0.85; }
.filter-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-bottom: var(--s-4); }
.chip {
  min-height: 44px; padding: 8px 10px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  font: inherit; font-size: 0.83rem; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; transition: all 0.2s var(--ease);
}
.chip:hover { border-color: var(--green-600); color: var(--green-800); }
.chip.active { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.subfilters { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: calc(-1 * var(--s-2)) 0 var(--s-4); }
.subchip { min-height: 40px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.subchip.active { background: var(--sage-200); border-color: var(--green-700); color: var(--green-800); }

.product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4);
}
.popular-banner {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--green-800); color: #fff;
  padding: 12px 16px; border-radius: var(--r-md);
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
}
.empty-state { text-align: center; color: var(--ink-soft); padding: var(--s-6) 0; }

/* ===== Tarjeta de producto ===== */
.product-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.product-card:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); }
.product-visual { position: relative; aspect-ratio: 1 / 1; background: var(--sage-100); }
.product-visual img { width: 100%; height: 100%; object-fit: cover; }
.product-visual.is-rotated img { object-fit: contain; transform: rotate(90deg); }
.product-visual.is-rotated::after { content: "Foto de empaque anterior"; position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 5px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.94); color: var(--ink); font-size: 0.7rem; font-weight: 700; line-height: 1.2; }
.product-photo-link { display: block; width: 100%; height: 100%; }
.product-body { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3) var(--s-3) var(--s-4); flex: 1; }
.product-name { font-size: 0.95rem; font-weight: 700; line-height: 1.35; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-name a { color: inherit; text-decoration: none; }
.product-name a:hover { color: var(--green-700); text-decoration: underline; }
.product-weight { align-self: flex-start; padding: 3px 8px; border-radius: var(--r-pill);
  background: var(--sage-100); color: var(--green-800); font-size: 0.75rem; font-weight: 700; line-height: 1.4; }
.product-desc { font-size: 0.8rem; color: var(--ink-soft); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s-2); }
.product-price { font-weight: 700; color: var(--green-800); font-size: 1.05rem; }
.product-detail-link { align-self: flex-start; color: var(--green-800); font-size: 0.78rem; font-weight: 700; text-underline-offset: 2px; }
.add-btn {
  width: 100%; padding: 9px 10px; border-radius: var(--r-sm);
  background: var(--sage-100); border: 1.5px solid var(--green-700); color: var(--green-800);
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.add-btn:hover { background: var(--green-800); color: #fff; }
.add-btn.added { background: var(--green-800); color: #fff; border-color: var(--green-800); }

.in-cart-badge {
  position: absolute; top: var(--s-2); right: var(--s-2);
  background: var(--green-800); color: #fff;
  font-size: 0.72rem; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill);
}

.product-badge {
  position: absolute; top: var(--s-2); left: var(--s-2);
  background: var(--amber-700); color: #fff;
  font-size: 0.72rem; font-weight: 700;
  padding: 4px 10px; border-radius: var(--r-pill);
}

/* ===== Drawer (carrito / checkout) ===== */
.cart-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 41, 29, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease);
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed; z-index: 60;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s var(--ease);
}
.cart-drawer.open { transform: translateY(0); }

/* móvil: hoja inferior */
.cart-drawer {
  left: 0; right: 0; bottom: var(--keyboard-inset, 0px);
  max-height: min(92dvh, var(--visible-viewport-height, 100dvh)); height: auto;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -8px 32px rgba(20, 41, 29, 0.18);
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-4) var(--s-3);
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 1.25rem; font-weight: 600; }
.icon-button {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); border: none; background: var(--surface);
  color: var(--ink); cursor: pointer; border: 1px solid var(--line);
}
.icon-button:hover { background: var(--sage-100); }

#cartView, #checkoutView { overflow-y: auto; overscroll-behavior: contain; padding: var(--s-4); flex: 1; min-height: 0; }
.cart-item-count { margin: 0 0 var(--s-3); color: var(--ink-soft); font-size: 0.85rem; font-weight: 600; }
.cart-item-count:empty { display: none; }

/* items del carrito */
.cart-items { display: flex; flex-direction: column; gap: var(--s-3); }
.cart-item { display: flex; gap: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3); }
.item-thumb { width: 60px; height: 60px; flex: 0 0 auto; border-radius: var(--r-sm); overflow: hidden; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-name { font-size: 0.9rem; font-weight: 600; margin: 0; line-height: 1.3; }
.item-price { font-size: 0.82rem; color: var(--ink-soft); margin: 0; }
.item-price strong { color: var(--green-800); font-weight: 700; }
.item-actions { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); }
.qty-stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.qty-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--green-800); font-size: 1.05rem; cursor: pointer;
}
.qty-btn:hover { background: var(--sage-100); }
.qty-val { min-width: 30px; text-align: center; font-size: 0.85rem; font-weight: 600; }
.remove-btn { margin-left: auto; min-height: 44px; padding: 0 8px; background: none; border: none; color: var(--ink-soft); font-size: 0.78rem; text-decoration: underline; cursor: pointer; }
.remove-btn:hover { color: var(--danger); }

.cart-empty { text-align: center; color: var(--ink-soft); padding: var(--s-6) var(--s-4); display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.cart-empty svg { color: var(--sage-200); }
.cart-empty p { margin: 0; }

.cart-footer {
  position: sticky; bottom: 0; margin: var(--s-4) calc(-1 * var(--s-4)) calc(-1 * var(--s-4));
  padding: var(--s-4); background: var(--bg); border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.cart-shipping-note { margin: calc(-1 * var(--s-2)) 0 0; color: var(--ink-soft); font-size: 0.76rem; line-height: 1.4; }
.total-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 1rem; }
.total-row strong { font-size: 1.35rem; color: var(--green-800); font-family: var(--font-display); }

/* ===== Selector de pack ===== */
.pack-picker {
  position: fixed; z-index: 70;
  left: 0; right: 0; bottom: 0;
  max-height: 92dvh; background: var(--bg);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -8px 32px rgba(20, 41, 29, 0.18);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s var(--ease);
  pointer-events: none;
}
.pack-picker.open { transform: translateY(0); pointer-events: auto; }
.pack-body { overflow-y: auto; overscroll-behavior: contain; padding: var(--s-4); flex: 1; min-height: 0; }
.pack-hint { margin: 0 0 var(--s-3); font-size: 0.85rem; color: var(--ink-soft); }
.pack-choices { display: flex; flex-direction: column; }
.pack-group-title {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 600;
  color: var(--green-800); margin: var(--s-3) 0 var(--s-2);
}
.pack-group-title:first-child { margin-top: 0; }
.pack-choice {
  display: flex; align-items: center; gap: var(--s-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 12px; margin-bottom: var(--s-2);
}
.pack-choice img { width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: cover; flex: 0 0 auto; }
.pack-choice-info { flex: 1; min-width: 0; }
.pack-choice-info strong { display: block; font-size: 0.88rem; line-height: 1.3; }
.pack-choice-info small { color: var(--ink-soft); font-size: 0.78rem; }
.pack-footer {
  border-top: 1px solid var(--line); background: var(--bg);
  padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3);
}
.qty-btn:disabled { opacity: 0.35; cursor: default; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.item-pack-items { margin: 0; font-size: 0.75rem; color: var(--ink-soft); }

@media (min-width: 760px) {
  .pack-picker {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(520px, 92vw); max-height: 84dvh;
    border-radius: var(--r-lg);
    transform: translate(-50%, -50%) scale(0.96);
    opacity: 0;
    transition: transform 0.28s var(--ease), opacity 0.2s var(--ease);
  }
  .pack-picker.open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ===== Checkout ===== */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--s-3);
  background: none; border: none; padding: 0; font: inherit; font-size: 0.88rem; font-weight: 600;
  color: var(--green-800); cursor: pointer;
}
.back-link:hover { text-decoration: underline; }

.checkout-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); }
.checkout-notice { margin: 0 0 var(--s-4); padding: var(--s-3); border-radius: var(--r-md); background: var(--sage-100); color: var(--ink-soft); font-size: 0.82rem; line-height: 1.5; }
.checkout-summary h3 { font-size: 1rem; font-weight: 600; margin-bottom: var(--s-2); }
.summary-item { display: flex; justify-content: space-between; gap: var(--s-3); font-size: 0.85rem; color: var(--ink-soft); padding: 3px 0; }
.summary-item span:first-child { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.summary-item span:last-child { flex: 0 0 auto; white-space: nowrap; }
.summary-total { display: flex; justify-content: space-between; margin-top: var(--s-2); padding-top: var(--s-2); border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.summary-total strong { color: var(--green-800); font-size: 1.1rem; font-family: var(--font-display); }

.field-group { border: none; margin: 0 0 var(--s-5); padding: 0; }
.field-group legend { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: var(--s-3); padding: 0; }

.radio-card {
  display: flex; align-items: center; gap: var(--s-3);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4); margin-bottom: var(--s-2); cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.radio-card:hover { border-color: var(--green-600); }
.radio-card:has(input:checked) { border-color: var(--green-700); background: var(--sage-100); }
.radio-card input { accent-color: var(--green-700); width: 18px; height: 18px; flex: 0 0 auto; }
.radio-card-body { display: flex; flex-direction: column; line-height: 1.3; }
.radio-card-body small { color: var(--ink-soft); font-size: 0.78rem; }

.field { margin-bottom: var(--s-3); }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field .optional { font-weight: 400; color: var(--ink-soft); }
.field input {
  width: 100%; padding: 11px 12px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--surface);
  font: inherit; font-size: 16px; color: var(--ink); scroll-margin-block: 72px;
}
.field input::placeholder { color: #93a195; }
.field input:focus { outline: none; border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(47, 107, 72, 0.18); }
.field input[aria-invalid="true"] { border-color: var(--danger); }

.field-error { margin: 6px 0 0; font-size: 0.78rem; color: var(--danger); font-weight: 500; }

.checkout-footer { position: sticky; bottom: 0; background: var(--bg); padding-top: var(--s-3); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-4); }
@media (max-width: 759px) {
  .cart-drawer.keyboard-active .checkout-footer { position: static; }
}
.form-error { margin: 0; font-size: 0.85rem; color: var(--danger); font-weight: 600; text-align: center; }
.checkout-privacy { margin: 0; color: var(--ink-soft); font-size: 0.72rem; line-height: 1.4; text-align: center; }

/* ===== Cómo comprar ===== */
.shop-guide { padding: var(--s-7) 0; background: var(--surface); border-top: 1px solid var(--line); }
.shop-guide h2 { font-size: clamp(1.75rem, 5vw, 2.5rem); margin-bottom: var(--s-5); }
.guide-grid { display: grid; gap: var(--s-4); }
.guide-grid > div { padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); }
.guide-number { display: block; margin-bottom: var(--s-3); color: var(--green-700); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; }
.guide-grid h3 { font-size: 1.2rem; margin-bottom: var(--s-2); }
.guide-grid p { margin: 0; color: var(--ink-soft); font-size: 0.88rem; }
.delivery-info { margin-top: var(--s-5); padding: var(--s-4); border-radius: var(--r-lg); background: var(--sage-100); }
.delivery-info h3 { font-size: 1.15rem; margin-bottom: var(--s-2); }
.delivery-info p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); padding: var(--s-6) 0; text-align: center; color: var(--ink-soft); }
.footer-logo {
  display: block; width: 56px; height: 56px; border-radius: 14px;
  margin: 0 auto var(--s-4); object-fit: cover; box-shadow: var(--shadow-card);
}
.site-footer p { margin: 0 0 var(--s-1); }
.site-footer strong { color: var(--green-800); font-family: var(--font-display); font-size: 1.05rem; }
.footer-note { font-size: 0.85rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); margin-top: var(--s-4); }
.footer-links a { color: var(--green-800); font-size: 0.82rem; font-weight: 600; text-underline-offset: 3px; }

/* ===== Fichas individuales ===== */
.detail-header-link { margin-left: auto; color: var(--green-800); font-size: 0.88rem; font-weight: 700; text-decoration: none; }
.detail-header-link:hover { text-decoration: underline; }
.detail-main { padding-top: var(--s-5); padding-bottom: var(--s-7); }
.detail-breadcrumb { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-5); color: var(--ink-soft); font-size: 0.8rem; }
.detail-breadcrumb a { color: var(--green-800); text-underline-offset: 3px; }
.detail-layout { display: grid; gap: var(--s-5); align-items: start; }
.detail-photo { position: relative; overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.detail-photo img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.detail-photo.is-rotated img { object-fit: contain; transform: rotate(90deg); }
.detail-photo.is-rotated::before { content: "Foto de empaque anterior"; position: absolute; z-index: 1; top: 12px; left: 12px; padding: 7px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.94); color: var(--ink); font-size: 0.78rem; font-weight: 700; line-height: 1.2; }
.detail-photo figcaption { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.78rem; line-height: 1.4; }
.detail-content h1 { max-width: 20ch; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12; }
.detail-size { display: inline-block; margin: var(--s-3) 0 0; padding: 5px 10px; border-radius: var(--r-pill); background: var(--sage-100); color: var(--green-800); font-size: 0.8rem; font-weight: 700; }
.detail-price { margin: var(--s-4) 0 var(--s-2); color: var(--green-800); font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; }
.detail-description { margin: 0 0 var(--s-5); max-width: 56ch; color: var(--ink-soft); }
.detail-cta { width: min(100%, 360px); min-height: 52px; }
.detail-help { max-width: 48ch; margin: var(--s-3) 0 var(--s-5); color: var(--ink-soft); font-size: 0.78rem; }
.detail-facts { display: grid; gap: var(--s-4); border-top: 1px solid var(--line); padding-top: var(--s-5); }
.detail-facts h2 { margin-bottom: var(--s-2); font-size: 1.15rem; }
.detail-facts p { margin: 0 0 var(--s-2); color: var(--ink-soft); font-size: 0.86rem; }
.detail-facts a { color: var(--green-800); font-size: 0.85rem; font-weight: 700; text-underline-offset: 3px; }
.detail-related { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.detail-related h2 { margin-bottom: var(--s-4); font-size: 1.45rem; }
.detail-related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.detail-related-grid a { display: flex; flex-direction: column; gap: 4px; overflow: hidden; padding-bottom: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); text-decoration: none; }
.detail-related-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.detail-related-grid strong, .detail-related-grid span { padding-inline: var(--s-3); }
.detail-related-grid strong { font-size: 0.8rem; line-height: 1.35; }
.detail-related-grid span { color: var(--green-800); font-size: 0.82rem; font-weight: 700; }
.detail-related-grid a:hover { border-color: var(--green-700); box-shadow: var(--shadow-card); }
.detail-mobile-cta { position: fixed; z-index: 45; left: var(--s-3); right: var(--s-3);
  bottom: calc(var(--s-3) + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--green-900); color: #fff;
  box-shadow: 0 10px 28px rgba(20, 41, 29, 0.3); }
.detail-mobile-cta strong { font-family: var(--font-display); font-size: 1.15rem; white-space: nowrap; }
.detail-mobile-cta .btn { margin-left: auto; padding: 10px 14px; background: var(--surface); color: var(--green-800); font-size: 0.8rem; }
@media (max-width: 759px) { body.detail-page { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); } }

.noscript { text-align: center; padding: 40px 16px; color: var(--danger); font-weight: 600; }

/* ===== Escritorio ===== */
@media (min-width: 760px) {
  .container { padding-inline: var(--s-5); }
  .hero { padding: var(--s-6) 0; }
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); gap: var(--s-7); }
  .hero-feature { position: relative; display: block; padding: 0; overflow: hidden; }
  .hero-feature-image { width: 100%; height: min(30vw, 360px); min-height: 280px; border-radius: 0; }
  .hero-feature-text { position: absolute; left: var(--s-4); right: var(--s-4); bottom: var(--s-4);
    padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: rgba(255, 255, 255, 0.95); }
  .hero-feature-text strong { font-size: 1.2rem; }
  .hero-feature-arrow { position: absolute; top: var(--s-3); right: var(--s-3); padding: 1px 10px; border-radius: var(--r-pill); background: var(--surface); }
  .catalog-search { width: min(360px, 40vw); }
  .filter-tabs { display: flex; flex-wrap: wrap; }
  .chip { padding-inline: var(--s-4); }
  .guide-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-7); }
  .detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-related-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
  .detail-mobile-cta { display: none; }

  /* drawer lateral derecho */
  .cart-drawer {
    left: auto; right: 0; top: 0; bottom: 0;
    width: min(440px, 100vw); height: 100dvh; max-height: none;
    border-radius: 0; box-shadow: var(--shadow-drawer);
    transform: translateX(100%);
  }
  .cart-drawer.open { transform: translateX(0); }

  .catalog-head { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: var(--s-7) 0; }
}

@media (min-width: 1140px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); gap: var(--s-5); }
}

/* ===== Accesibilidad: movimiento reducido ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
