/* Grano Lento — estilos. Mobile-first, claro y oscuro. */
:root {
  --bg: #F3F1EC;
  --surface: #FBFAF7;
  --surface-2: #E9E5DD;
  --text: #1B1814;
  --muted: #5A544C;
  --line: #D8D2C8;
  --field: #8A8278;      /* borde de campos: contraste 3:1 */
  --accent: #B3261E;      /* rojo cereza del café */
  --accent-ink: #FFFFFF;
  --accent-soft: #F4DEDB;
  --ok: #2F6B45;
  --error: #A3241C;
  --shadow: 0 1px 2px rgba(27, 24, 20, 0.06), 0 12px 32px -12px rgba(27, 24, 20, 0.22);

  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --gutter: clamp(20px, 4vw, 56px);
  --section: clamp(80px, 11vw, 156px);
  --header-h: 68px;
  --radius: 18px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15130F; --surface: #1E1B17; --surface-2: #26221D; --text: #EDE8DF; --muted: #A9A096; --line: #36312A; --field: #7A7166;
  --accent: #E25B4F; --accent-ink: #1A0E0C; --accent-soft: #3A1E1A; --ok: #7CC596; --error: #F08A80;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 36px -14px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130F; --surface: #1E1B17; --surface-2: #26221D; --text: #EDE8DF; --muted: #A9A096; --line: #36312A; --field: #7A7166;
    --accent: #E25B4F; --accent-ink: #1A0E0C; --accent-soft: #3A1E1A; --ok: #7CC596; --error: #F08A80;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 36px -14px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 17px; line-height: 1.6; font-variation-settings: "opsz" 16; -webkit-font-smoothing: antialiased; overflow-x: clip;
  transition: background-color 300ms ease, color 300ms ease;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, dl, dd, ul, ol, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; left: 0; top: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 200; padding: 10px 16px; background: var(--text); color: var(--bg); text-decoration: none; border-radius: 8px; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Tipografía ---------- */
.h2 { font-size: clamp(34px, 4.6vw, 64px); font-weight: 700; line-height: 1.02; letter-spacing: -0.022em; font-variation-settings: "opsz" 96, "wdth" 90; }
.sec-intro { color: var(--muted); max-width: 46ch; font-size: 18px; }
.demo-note { color: var(--muted); font-size: 13px; }
.section { padding-block: var(--section); }
.sec-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); }
@media (min-width: 900px) {
  .sec-head { grid-template-columns: 1.3fr 1fr; align-items: end; column-gap: 48px; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 24px;
  border: 1.5px solid transparent; border-radius: 999px; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease, opacity 200ms ease;
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-line { background: transparent; border-color: var(--text); color: var(--text); }
.btn-small { min-height: 40px; padding: 8px 18px; font-size: 15px; background: var(--text); color: var(--bg); }
.btn-block { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 86%, var(--text)); }
  .btn-line:hover { background: var(--text); color: var(--bg); }
  .btn-small:hover { background: var(--accent); color: var(--accent-ink); }
}
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1.5px solid var(--line); border-radius: 999px;
  background: transparent; cursor: pointer; transition: transform 160ms var(--ease-out), border-color 200ms ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { border-color: var(--text); } }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color 250ms ease; }
.header.is-scrolled { border-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 750; letter-spacing: -0.03em; text-decoration: none; font-variation-settings: "opsz" 40, "wdth" 90; margin: 0; }
.logo-bean { width: 24px; height: 24px; }
.logo-bean ellipse { fill: var(--accent); }
.logo-bean path { fill: none; stroke: var(--bg); stroke-width: 2.2; }
.nav { display: none; margin-left: auto; }
.nav ul { display: flex; gap: 26px; }
.nav a { font-size: 15px; font-weight: 500; text-decoration: none; color: var(--muted); transition: color 200ms ease; }
.nav a[aria-current="true"] { color: var(--text); }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--text); } }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 12px; border: 0; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 600; cursor: pointer; transition: transform 160ms var(--ease-out);
}
.cart-btn:active { transform: scale(0.96); }
.cart-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.cart-label { display: none; }
.cart-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: 13px; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums;
}
.cart-count.bump { animation: bump 300ms var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.25); } }
.mobile-menu { border-top: 1px solid var(--line); padding: 8px var(--gutter) 20px; animation: drop 250ms var(--ease-out); }
.mobile-menu a { display: block; padding: 14px 0; font-size: 22px; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
@media (min-width: 640px) { .cart-label { display: inline; } }
@media (min-width: 1040px) {
  .nav { display: block; }
  .header-actions { margin-left: 16px; }
  .menu-btn { display: none; }
  .mobile-menu { display: none !important; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(40px, 7vw, 96px); padding-bottom: clamp(56px, 8vw, 112px); }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero-title {
  font-size: clamp(44px, 7.2vw, 108px); font-weight: 750; line-height: 0.95; letter-spacing: -0.03em;
  font-variation-settings: "opsz" 96, "wdth" 86; max-width: 11ch; text-wrap: balance;
}
.hero-text { margin-top: 28px; color: var(--muted); font-size: clamp(18px, 1.6vw, 21px); max-width: 42ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 20px; font-size: 13px; color: var(--muted); }
.hero-stage { position: relative; height: clamp(340px, 46vw, 560px); }
.hero-bag { position: absolute; width: 46%; will-change: transform; }
.hero-bag-1 { left: 4%; top: 14%; --r: -9deg; }
.hero-bag-2 { left: 30%; top: 2%; --r: 3deg; z-index: 2; width: 50%; }
.hero-bag-3 { right: 2%; top: 20%; --r: 11deg; }
.hero-bag > .bag { transform: rotate(var(--r)); }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .hero-copy > * { animation: rise 700ms var(--ease-out) both; }
  .js .hero-copy > :nth-child(2) { animation-delay: 60ms; }
  .js .hero-copy > :nth-child(3) { animation-delay: 120ms; }
  .js .hero-copy > :nth-child(4) { animation-delay: 180ms; }
  .js .hero-bag { animation: land 900ms var(--ease-out) both; }
  .js .hero-bag-1 { animation-delay: 150ms; }
  .js .hero-bag-2 { animation-delay: 250ms; }
  .js .hero-bag-3 { animation-delay: 350ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes land { from { opacity: 0; transform: translateY(40px) scale(0.96); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- La bolsa ilustrada ---------- */
.bag {
  position: relative; width: 100%; aspect-ratio: 3 / 4.1; container-type: inline-size;
  background: var(--bag); color: var(--ink); border-radius: 6% 6% 9% 9% / 4% 4% 6% 6%;
  box-shadow: inset 0 -2.4em 3em -1em rgba(0, 0, 0, 0.18), inset 1.2em 0 2em -1.2em rgba(255, 255, 255, 0.22), 0 1.6em 2.4em -1.2em rgba(27, 24, 20, 0.45);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 14%;
}
.bag-fold {
  position: absolute; left: 0; right: 0; top: 0; height: 11%; border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 7px), rgba(0, 0, 0, 0.1);
}
.bag-valve { position: absolute; top: 19%; right: 14%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: rgba(0, 0, 0, 0.16); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25); }
.bag-label {
  width: 76%; padding: 8% 7% 9%; border-radius: 4px; background: #FBF9F4; color: #1B1814; text-align: left;
  display: grid; gap: 1.5cqw; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.bag-brand { font-size: 5.2cqw; font-weight: 700; letter-spacing: 0.02em; color: var(--bag); filter: saturate(1.1) brightness(0.8); }
.bag-origin { font-size: 12.5cqw; font-weight: 800; line-height: 0.95; letter-spacing: -0.04em; font-variation-settings: "opsz" 96, "wdth" 78; }
.bag-name { font-size: 6.6cqw; font-weight: 500; line-height: 1.1; }
.bag-roast { margin-top: 2cqw; font-size: 4.6cqw; color: #5A544C; font-variant-numeric: tabular-nums; }

/* ---------- Catálogo ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; max-width: 100%; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 40px; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: transparent;
  font-size: 15px; font-weight: 500; cursor: pointer; transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
}
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
@media (hover: hover) and (pointer: fine) { .chip[aria-pressed="false"]:hover { border-color: var(--text); } }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.select-wrap select, .field select {
  min-height: 40px; padding: 8px 36px 8px 14px; border: 1.5px solid var(--field); border-radius: 999px; background-color: var(--surface);
  appearance: none; -webkit-appearance: none; cursor: pointer; font-size: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a8278' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.results { color: var(--muted); font-size: 14px; margin-bottom: 24px; font-variant-numeric: tabular-nums; }
.products { display: grid; grid-template-columns: 1fr; gap: 28px 20px; }
@media (min-width: 560px) { .products { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .products { grid-template-columns: repeat(3, 1fr); } }
.product { min-width: 0; }
.product.is-hidden { display: none; }
.product-media {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1.05; padding: 0; border: 0; border-radius: var(--radius); cursor: pointer;
  background: color-mix(in srgb, var(--panel) 20%, var(--surface)); -webkit-tap-highlight-color: transparent; overflow: hidden;
}
.product-media .bag { width: 46%; transition: transform 450ms var(--ease-out); }
.product-media:active .bag { transform: scale(0.97); transition-duration: 160ms; }
@media (hover: hover) and (pointer: fine) { .product-media:hover .bag { transform: translateY(-6px) rotate(-2deg); } }
.product-info { padding-top: 16px; }
.product-name { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.product-name span { font-weight: 800; }
.product-notes { margin-top: 4px; color: var(--muted); font-size: 15px; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.product-price { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { display: grid; justify-items: start; gap: 16px; padding: 40px; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* ---------- Test ---------- */
.finder-sec { background: var(--surface-2); }
.finder-grid { display: grid; gap: 40px; }
.finder-intro { display: grid; gap: 18px; align-content: start; }
.finder { background: var(--surface); border-radius: 24px; padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow); min-height: 420px; }
.finder-progress { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 28px; }
.finder-progress span { display: block; height: 100%; width: 33.333%; background: var(--accent); border-radius: inherit; transform-origin: left; transition: width 400ms var(--ease-in-out); }
.q legend { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 22px; }
.q-n { display: block; font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-bottom: 8px; }
.options { display: grid; gap: 10px; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opt span {
  display: block; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 14px; font-weight: 500;
  transition: border-color 200ms ease, background-color 200ms ease, transform 160ms var(--ease-out);
}
.opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt:active span { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) { .opt:hover input:not(:checked) + span { border-color: var(--text); } }
@media (prefers-reduced-motion: no-preference) { .js .q:not([hidden]) { animation: rise 350ms var(--ease-out); } .js .finder-result:not([hidden]) { animation: rise 450ms var(--ease-out); } }
.finder-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.finder-nav #finder-next { margin-left: auto; }
.result-kicker { color: var(--accent); font-weight: 600; margin-bottom: 18px; }
.finder-result:focus { outline: none; }
.result-body { display: grid; gap: 24px; align-items: center; }
.result-bag { width: 150px; }
.result-name { font-size: clamp(28px, 3vw, 40px); font-weight: 750; letter-spacing: -0.03em; line-height: 1.05; }
.result-why { margin-top: 10px; color: var(--muted); max-width: 44ch; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
@media (min-width: 640px) { .result-body { grid-template-columns: 170px 1fr; } }
@media (min-width: 980px) { .finder-grid { grid-template-columns: 1fr 1.25fr; column-gap: 64px; } }

/* ---------- Laboratorio ---------- */
.lab { border: 1.5px solid var(--line); border-radius: 24px; overflow: hidden; background: var(--surface); }
.lab-tabs { position: relative; display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1.5px solid var(--line); }
.lab-tabs::-webkit-scrollbar { display: none; }
.lab-tab {
  flex: 1 0 auto; min-height: 58px; padding: 14px 22px; border: 0; background: transparent; cursor: pointer;
  font-size: 16px; font-weight: 600; color: var(--muted); transition: color 200ms ease, background-color 200ms ease;
}
.lab-tab[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
@media (hover: hover) and (pointer: fine) { .lab-tab:hover { color: var(--text); } }
.lab-panel { display: grid; gap: 40px; padding: clamp(22px, 4vw, 48px); }
.lab-panel:focus-visible { outline-offset: -4px; }
.cups-label { display: block; font-weight: 600; font-size: 18px; margin-bottom: 12px; }
.cups-label output { font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 6px; border-radius: 99px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background: linear-gradient(to right, var(--accent) var(--fill, 20%), var(--line) var(--fill, 20%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.recipe { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.recipe div { padding: 16px 18px; border-radius: 14px; background: var(--surface-2); }
.recipe dt { font-size: 14px; color: var(--muted); }
.recipe dd { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lab-tip { margin-top: 18px; color: var(--muted); font-size: 15px; }
.timer { display: grid; gap: 22px; justify-items: center; align-content: start; }
.ring { position: relative; width: min(220px, 70vw); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; }
.ring-time { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-time span { font-size: 44px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.ring-time small { margin-top: 6px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.steps { width: 100%; display: grid; gap: 6px; }
.steps li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 14px; border-radius: 12px; color: var(--muted); transition: background-color 250ms ease, color 250ms ease; }
.steps li .t { font-variant-numeric: tabular-nums; font-size: 14px; padding-top: 1px; }
.steps li.is-now { background: var(--accent-soft); color: var(--text); }
.steps li.is-done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.timer-actions { display: flex; gap: 10px; }
@media (min-width: 900px) { .lab-panel { grid-template-columns: 1.1fr 1fr; column-gap: 64px; } }

/* ---------- Suscripción ---------- */
.sub-sec { background: var(--text); color: var(--bg); }
.sub-sec .sec-intro { color: color-mix(in srgb, var(--bg) 72%, transparent); margin-top: 18px; }
.sub-grid { display: grid; gap: 40px; }
.sub-form { display: grid; gap: 24px; padding: clamp(22px, 4vw, 40px); border-radius: 24px; background: color-mix(in srgb, var(--bg) 8%, var(--text)); }
.sub-form legend, .sub-form .field > span { display: block; font-weight: 600; margin-bottom: 10px; }
.sub-form .field select { width: 100%; background-color: transparent; border-color: color-mix(in srgb, var(--bg) 30%, transparent); color: var(--bg); }
.sub-form .field select option { color: #1B1814; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.seg span { display: block; padding: 10px 16px; border-radius: 999px; border: 1.5px solid currentColor; opacity: 0.75; font-size: 15px; font-weight: 500; transition: background-color 200ms ease, color 200ms ease, opacity 200ms ease; }
.seg input:checked + span { opacity: 1; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sub-total p:first-child { font-size: 18px; }
.sub-total #sub-price { font-size: 40px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sub-total small { opacity: 0.7; font-variant-numeric: tabular-nums; }
.sub-month { opacity: 0.7; font-size: 15px; font-variant-numeric: tabular-nums; }
@media (min-width: 980px) { .sub-grid { grid-template-columns: 1fr 1fr; column-gap: 72px; align-items: start; } }

/* ---------- Tostadero ---------- */
.roast-grid { display: grid; gap: 32px; }
.roast-img { overflow: hidden; border-radius: var(--radius); background: var(--surface-2); }
.roast-img img { width: 100%; height: 100%; object-fit: cover; }
.roast-img-1 img { aspect-ratio: 4 / 3; }
.roast-img-2 img { aspect-ratio: 4 / 5; }
.roast-copy { display: grid; gap: 18px; align-content: center; }
.roast-copy p:not(.demo-note) { color: var(--muted); max-width: 48ch; }
.img-missing { display: grid; place-items: center; min-height: 240px; }
.img-missing img { display: none; }
.img-missing::after { content: "Imagen no disponible"; color: var(--muted); font-size: 14px; }
@media (min-width: 900px) {
  .roast-grid { grid-template-columns: 1.3fr 1fr 0.9fr; column-gap: 40px; align-items: center; }
  .roast-img-2 { margin-top: 120px; }
}

/* ---------- FAQ ---------- */
.faq-sec { padding-top: 0; }
.faq-grid { display: grid; gap: 32px; }
.faq details { border-bottom: 1.5px solid var(--line); }
.faq details:first-child { border-top: 1.5px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; font-size: 19px; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 12px; height: 12px; flex: 0 0 auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform 250ms var(--ease-out); }
.faq details[open] summary::after { transform: translateY(3px) rotate(225deg); }
.faq-a { padding-bottom: 22px; color: var(--muted); max-width: 62ch; }
@media (prefers-reduced-motion: no-preference) { .faq details[open] .faq-a { animation: rise 300ms var(--ease-out); } }
@media (min-width: 900px) { .faq-grid { grid-template-columns: 1fr 1.6fr; column-gap: 64px; } }

/* ---------- Pedido ---------- */
.order-sec { background: var(--surface-2); }
.order-grid { display: grid; gap: 40px; }
.order-intro { display: grid; gap: 18px; align-content: start; }
.order-summary { margin-top: 10px; padding: 20px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); font-size: 15px; }
.order-summary ul { display: grid; gap: 8px; margin-bottom: 12px; }
.order-summary li { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.order-summary .sum-total { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 700; }
.order-summary .muted { color: var(--muted); }
.form { display: grid; gap: 20px; align-content: start; padding: clamp(20px, 4vw, 40px); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > span, .field legend { font-size: 15px; font-weight: 600; }
.opt-label { font-weight: 400; color: var(--muted); }
.field input:not([type="checkbox"]):not([type="radio"]), .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--field); border-radius: 12px; background: var(--bg); font-size: 16px;
  transition: border-color 200ms ease;
}
.field textarea { resize: vertical; }
.field textarea[readonly] { background: var(--surface-2); color: var(--muted); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--text); }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form .field select { width: 100%; border-radius: 12px; min-height: 48px; background-color: var(--bg); font-size: 16px; }
.err { font-size: 13px; color: var(--error); }
.err:empty { display: none; }
.has-error input:not([type="checkbox"]), .has-error select, .has-error textarea { border-color: var(--error); }
.check { grid-template-columns: 22px 1fr; column-gap: 12px; align-items: start; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.check label { font-size: 15px; font-weight: 400; color: var(--muted); }
.check .err { grid-column: 2; }
.form-foot { display: grid; gap: 14px; justify-items: start; }
.form-status { font-size: 15px; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-error { color: var(--error); }
@media (min-width: 640px) { .form { grid-template-columns: 1fr 1fr; } .field-full { grid-column: 1 / -1; } }
@media (min-width: 980px) { .order-grid { grid-template-columns: 1fr 1.3fr; column-gap: 64px; } }

/* ---------- Footer ---------- */
.footer { padding-block: 56px 40px; border-top: 1.5px solid var(--line); }
.footer-grid { display: grid; gap: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.footer-links a { text-decoration: none; color: var(--muted); transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .footer-links a:hover { color: var(--text); } }
.footer-legal { color: var(--muted); font-size: 13px; max-width: 70ch; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: auto 1fr; align-items: center; column-gap: 48px; } .footer-legal { grid-column: 1 / -1; } }

/* ---------- Ficha rápida (modal centrado) ---------- */
.modal { width: min(880px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 24px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: auto; }
.modal::backdrop { background: rgba(15, 12, 9, 0.5); }
.modal-inner { position: relative; display: grid; }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--surface); }
.q-bag { display: grid; place-items: center; padding: 40px 0 32px; background: color-mix(in srgb, var(--panel, #ccc) 22%, var(--surface)); }
.q-bag .bag { width: min(190px, 46vw); }
.q-info { display: grid; gap: 14px; padding: 28px clamp(20px, 4vw, 36px) 32px; align-content: start; }
.q-origin { color: var(--accent); font-weight: 600; }
.q-title { font-size: clamp(30px, 3.4vw, 42px); font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.q-notes { font-size: 17px; font-weight: 500; }
.q-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-block: 12px; border-block: 1px solid var(--line); }
.q-meta dt { font-size: 13px; color: var(--muted); }
.q-meta dd { font-size: 15px; font-weight: 600; }
.q-desc { color: var(--muted); font-size: 15px; }
.q-info .field select { width: 100%; border-radius: 12px; min-height: 46px; }
.q-info .seg span { border-color: var(--line); opacity: 1; }
.q-buy { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.q-buy .btn { flex: 1; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--field); border-radius: 999px; height: 50px; }
.step-btn { width: 44px; height: 100%; border: 0; background: none; font-size: 20px; cursor: pointer; border-radius: 999px; transition: transform 160ms var(--ease-out); }
.step-btn:active { transform: scale(0.9); }
.step-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper output { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (min-width: 760px) {
  .modal-inner { grid-template-columns: 0.9fr 1.1fr; }
  .q-bag { padding: 40px 24px; }
}
@media (prefers-reduced-motion: no-preference) {
  .modal[open] { animation: pop 250ms var(--ease-out); }
  .modal[open]::backdrop { animation: fade 250ms ease; }
  .modal.is-closing { animation: pop-out 180ms var(--ease-out) forwards; }
  .modal.is-closing::backdrop { animation: fade-out 180ms ease forwards; }
}
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }
@keyframes pop-out { to { opacity: 0; transform: scale(0.97); } }
@keyframes fade-out { to { opacity: 0; } }

/* ---------- Carrito (panel lateral) ---------- */
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(440px, 100%); height: 100dvh; max-width: none; max-height: none; margin: 0 0 0 auto;
  padding: 0; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.drawer::backdrop { background: rgba(15, 12, 9, 0.45); }
.drawer-inner { display: flex; flex-direction: column; height: 100%; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.ship { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ship-bar { height: 6px; margin-top: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ship-bar span { display: block; height: 100%; width: 0; background: var(--ok); border-radius: inherit; transition: width 400ms var(--ease-out); }
.cart-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px; }
.cart-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item .bag { width: 56px; }
.ci-name { font-weight: 650; line-height: 1.2; }
.ci-meta { color: var(--muted); font-size: 13px; }
.ci-right { display: grid; justify-items: end; gap: 6px; }
.ci-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-item .stepper { height: 36px; }
.cart-item .step-btn { width: 32px; font-size: 17px; }
.ci-remove { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.cart-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 40px 20px; color: var(--muted); text-align: center; }
.drawer-foot { padding: 18px 20px 22px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.totals { display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); }
.totals .total { padding-top: 8px; font-size: 19px; font-weight: 750; }
.totals .total dt { color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
  .drawer[open] { animation: slide-in 500ms var(--ease-drawer); }
  .drawer[open]::backdrop { animation: fade 400ms ease; }
  .drawer.is-closing { animation: slide-out 260ms var(--ease-out) forwards; }
  .drawer.is-closing::backdrop { animation: fade-out 260ms ease forwards; }
  .cart-item { animation: fade 250ms ease; }
}
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes slide-out { to { transform: translateX(100%); } }

/* ---------- Avisos ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 10px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--text); color: var(--bg);
  box-shadow: var(--shadow); pointer-events: auto; font-size: 15px;
  transition: opacity 400ms ease, transform 400ms ease;
}
.toast p { flex: 1; }
.toast button { border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px; }
.toast[data-state="enter"], .toast[data-state="exit"] { opacity: 0; transform: translateY(100%); }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity 200ms ease; } .toast[data-state] { transform: none; } }

body.is-locked { overflow: hidden; }
