/* ==========================================================
   Chiclayo Especial — sistema de diseño
   Paleta tomada de la fotografía: madera, kraft, cobre y cereza.
   ========================================================== */
:root {
  --espresso: #1c1512;
  --roast: #2a201b;
  --ink: #2b2420;
  --muted: #6f625a;
  --cream: #f6f1ea;
  --paper: #fbf8f4;
  --sand: #ece3d6;
  --kraft: #c9a57a;
  --copper: #b0612f;
  --copper-dark: #8f4a1f;
  --cherry: #9b2a2a;
  --line: rgba(43, 36, 32, .14);
  --line-light: rgba(246, 241, 234, .18);

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 21, 18, .06), 0 12px 32px -12px rgba(28, 21, 18, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
figure { margin: 0; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
@media (min-width: 720px) { .container { width: min(1200px, 100% - 64px); } }

.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 100; background: var(--cream); padding: 8px 14px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--copper);
}
.eyebrow--light { color: var(--kraft); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--copper); color: #fff; }
.btn--primary:hover { background: var(--copper-dark); }
.btn--ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--espresso); }
.btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--outline:hover { background: var(--ink); color: var(--cream); }
.btn--light { background: var(--cream); color: var(--espresso); }
.btn--light:hover { background: #fff; }
.btn--text-light { background: none; color: var(--cream); padding: 0 8px; }
.btn--block { width: 100%; }

/* ---------- Cabecera ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 40;
  height: var(--header-h);
  color: #fff;
  transition: background .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease);
}
.header.is-solid {
  background: rgba(251, 248, 244, .94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}
.header__inner {
  height: 100%; width: min(1280px, 100% - 32px); margin-inline: auto;
  display: flex; align-items: center; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo__mark { width: 30px; height: 30px; flex: none; }
.logo__text { font-family: var(--serif); font-size: 21px; letter-spacing: -.01em; line-height: 1; }
.logo__text em { font-style: italic; font-weight: 300; margin-left: 4px; }

.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { font-size: 14px; font-weight: 500; text-decoration: none; opacity: .88; position: relative; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transition: transform .3s var(--ease); transform-origin: left; }
.nav a:hover { opacity: 1; }
.nav a:hover::after { transform: scaleX(1); }

.header__actions { display: flex; align-items: center; gap: 12px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; border: 1px solid currentColor; opacity: .9;
}
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #5bb574; }
.status-pill.is-closed::before { background: #c9594b; }

.cart-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; }
.cart-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.cart-btn__count {
  position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--copper); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px;
  transform: scale(0); transition: transform .3s var(--ease);
}
.cart-btn__count.has-items { transform: scale(1); }
.cart-btn__count.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }

.menu-btn { display: none; width: 44px; height: 44px; border: 0; background: none; position: relative; }
.menu-btn span:not(.sr) { position: absolute; left: 11px; right: 11px; height: 1.5px; background: currentColor; transition: transform .3s var(--ease); }
.menu-btn span:nth-child(1) { top: 18px; }
.menu-btn span:nth-child(2) { top: 25px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 1080px) { .status-pill { display: none !important; } }
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto; margin: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 24px;
    background: var(--paper); color: var(--ink);
    box-shadow: 0 20px 30px -20px rgba(0,0,0,.3);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: all .3s var(--ease);
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a { font-family: var(--serif); font-size: 24px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav a::after { display: none; }
  .header:has(.nav.is-open) { background: var(--paper); color: var(--ink); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  color: #fff; overflow: hidden; background: var(--espresso);
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; transform: scale(1.06); animation: settle 2.4s var(--ease) forwards; }
@keyframes settle { to { transform: scale(1); } }
.hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,14,11,.55) 0%, rgba(20,14,11,.15) 35%, rgba(20,14,11,.82) 100%), linear-gradient(90deg, rgba(20,14,11,.55) 0%, transparent 65%); }
.hero__content { position: relative; padding-block: 140px 72px; }
.hero__title { font-family: var(--serif); font-weight: 300; font-size: clamp(46px, 8.2vw, 112px); line-height: .98; letter-spacing: -.025em; max-width: 12ch; }
.hero__title em { font-style: italic; color: var(--kraft); }
.hero__lead { max-width: 52ch; margin: 26px 0 34px; font-size: clamp(16px, 1.4vw, 18px); color: rgba(255,255,255,.86); }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__roast { margin: 36px 0 0; font-size: 13px; color: rgba(255,255,255,.75); display: flex; align-items: center; gap: 10px; }
.hero__roast strong { color: #fff; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--kraft); box-shadow: 0 0 0 0 rgba(201,165,122,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(201,165,122,0); } 100% { box-shadow: 0 0 0 0 rgba(201,165,122,0); } }

/* ---------- Ticker ---------- */
.ticker { background: var(--espresso); color: var(--kraft); overflow: hidden; border-top: 1px solid var(--line-light); }
.ticker__track { display: flex; width: max-content; animation: ticker 38s linear infinite; }
.ticker span { padding: 16px 28px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; display: flex; align-items: center; gap: 28px; }
.ticker span::after { content: '✦'; font-size: 9px; opacity: .6; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */
.section { padding-block: clamp(72px, 10vw, 128px); }
.section--sand { background: var(--sand); }
.section--dark { background: var(--espresso); color: var(--cream); }
.section__head { display: grid; gap: 20px 64px; margin-bottom: 44px; }
@media (min-width: 900px) { .section__head { grid-template-columns: 1.1fr 1fr; align-items: end; } }
.section__title { font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 4.6vw, 58px); line-height: 1.04; letter-spacing: -.02em; }
.section__title--light { color: var(--cream); }
.section__intro { margin: 0; color: var(--muted); max-width: 52ch; }

/* ---------- Filtros ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; align-items: center; }
.filters__sep { width: 1px; height: 24px; background: var(--line); margin-inline: 6px; }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 500; transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.chip--taste.is-active { background: var(--copper); border-color: var(--copper); }

/* ---------- Tarjetas de producto ---------- */
.products { display: grid; gap: 28px 24px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.products__empty { color: var(--muted); }
.card { display: flex; flex-direction: column; animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.card__media {
  position: relative; aspect-ratio: 4 / 4.2; border-radius: var(--radius); overflow: hidden;
  background: var(--sand); border: 0; padding: 0; display: block; width: 100%;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.card__media:hover img, .card__media:hover .bag { transform: scale(1.04); }
.card__badge { position: absolute; top: 14px; left: 14px; z-index: 1; background: var(--paper); color: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; }
.card__badge--ltd { background: var(--cherry); color: #fff; }
.card__score { position: absolute; top: 14px; right: 14px; z-index: 1; font-size: 12px; font-weight: 700; background: rgba(28,21,18,.78); color: #fff; padding: 6px 10px; border-radius: 999px; }
.card__view { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 1; text-align: center; padding: 10px; border-radius: 999px; background: rgba(251,248,244,.92); font-size: 13px; font-weight: 600; opacity: 0; transform: translateY(8px); transition: all .3s var(--ease); }
.card__media:hover .card__view, .card__media:focus-visible .card__view { opacity: 1; transform: none; }
@media (hover: none) { .card__view { opacity: 1; transform: none; } }

/* Bolsa ilustrada (para cafés sin foto) */
.bag-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(120% 80% at 50% 100%, #e1d4c1 0%, var(--sand) 60%); }
.bag { width: 52%; transition: transform .7s var(--ease); filter: drop-shadow(0 22px 22px rgba(60,40,25,.25)); }

.card__body { padding: 18px 2px 0; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.card__name { font-family: var(--serif); font-size: 25px; line-height: 1.1; }
.card__price { font-weight: 700; white-space: nowrap; }
.card__price small { font-weight: 500; color: var(--muted); }
.card__origin { margin: 0; font-size: 13px; color: var(--muted); }
.notes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.notes li { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--sand); }
.card__meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--muted); }
.roast { display: inline-flex; gap: 3px; }
.roast i { width: 14px; height: 5px; border-radius: 3px; background: var(--line); }
.roast i.on { background: var(--copper); }
.card__buy { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.card__buy select { flex: 1; min-width: 0; }
.card__buy .btn { min-height: 44px; padding: 0 18px; }

select, .field input, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
  font-size: 14px;
}
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%232b2420' stroke-width='1.5'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
select:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px rgba(176,97,47,.15); }

/* ---------- Quiz ---------- */
.quiz-section { padding-bottom: clamp(72px, 10vw, 128px); }
.quiz {
  display: grid; gap: 32px 64px; padding: clamp(28px, 5vw, 64px);
  border-radius: calc(var(--radius) * 1.5); color: var(--cream);
  background: linear-gradient(135deg, rgba(28,21,18,.93), rgba(42,32,27,.86)), url('../../img/granos.jpg') center / cover;
}
@media (min-width: 900px) { .quiz { grid-template-columns: .9fr 1.1fr; align-items: center; } }
.quiz__title { font-family: var(--serif); font-weight: 300; font-size: clamp(32px, 4vw, 48px); line-height: 1.05; margin-bottom: 14px; }
.quiz__intro p:last-child { color: rgba(246,241,234,.78); margin: 0; }
.quiz__step { border: 0; padding: 0; margin: 0; display: none; }
.quiz__step.is-active { display: block; animation: rise .4s var(--ease); }
.quiz__step legend { font-family: var(--serif); font-size: 22px; margin-bottom: 18px; padding: 0; }
.quiz__step legend span { font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--kraft); margin-right: 10px; letter-spacing: .1em; }
.quiz__options { display: grid; gap: 10px; }
@media (min-width: 560px) { .quiz__options { grid-template-columns: 1fr 1fr; } }
.quiz__options label, .seg label { position: relative; cursor: pointer; }
.quiz__options input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.quiz__options span { display: block; padding: 16px 18px; border: 1px solid var(--line-light); border-radius: var(--radius-sm); transition: all .2s var(--ease); }
.quiz__options label:hover span { border-color: rgba(246,241,234,.5); }
.quiz__options input:checked + span { background: var(--cream); color: var(--espresso); border-color: var(--cream); font-weight: 600; }
.quiz__options input:focus-visible + span { outline: 2px solid var(--kraft); outline-offset: 2px; }
.quiz__nav { display: flex; justify-content: space-between; margin-top: 24px; }
.quiz__nav [data-quiz-next] { margin-left: auto; }
.quiz__result { animation: rise .4s var(--ease); }
.quiz__match { display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: center; padding: 18px; border-radius: var(--radius); background: rgba(246,241,234,.08); border: 1px solid var(--line-light); }
.quiz__match .bag-wrap, .quiz__match img { position: relative; width: 96px; height: 110px; border-radius: 10px; object-fit: cover; }
.quiz__match .bag { width: 70%; }
.quiz__match h3 { font-family: var(--serif); font-size: 26px; }
.quiz__match p { margin: 4px 0 0; color: rgba(246,241,234,.78); font-size: 14px; }
.quiz__result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- Cafetería ---------- */
.mosaic { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 48px; }
.mosaic figure { border-radius: var(--radius); overflow: hidden; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 760px) {
  .mosaic { grid-template-columns: 1.6fr 1fr; grid-template-rows: 240px 240px; }
  .mosaic__a { grid-row: span 2; }
}
@media (min-width: 1100px) { .mosaic { grid-template-rows: 280px 280px; } }
@media (max-width: 759px) { .mosaic__c { display: none; } .mosaic figure { aspect-ratio: 16/10; } }

.visit { display: grid; gap: 24px; }
.visit > * { min-width: 0; }
@media (min-width: 900px) { .visit { grid-template-columns: .85fr 1.15fr; } }
.visit__card, .menu { background: var(--paper); border-radius: var(--radius); padding: clamp(24px, 3.5vw, 40px); box-shadow: var(--shadow); }
.visit__status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin: 0 0 14px; color: #2f7a47; }
.visit__status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.visit__status.is-closed { color: var(--cherry); }
.visit__title { font-family: var(--serif); font-size: 28px; margin-bottom: 8px; }
.visit address { font-style: normal; color: var(--muted); margin-bottom: 20px; }
.hours { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 24px; }
.hours th, .hours td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 500; }
.hours td { text-align: right; font-variant-numeric: tabular-nums; }
.hours tr.is-today th, .hours tr.is-today td { font-weight: 700; color: var(--copper-dark); }
.visit__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.visit__perks { list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--muted); display: grid; gap: 6px; }
.visit__perks li::before { content: '— '; color: var(--copper); }

.menu__tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.menu__tabs button { border: 0; background: none; padding: 10px 14px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.menu__tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--copper); }
.menu__panel ul { list-style: none; margin: 0; padding: 0; }
.menu__panel li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.menu__panel li:last-child { border-bottom: 0; }
.menu__panel li span { font-family: var(--serif); font-size: 19px; }
.menu__panel small { display: block; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.menu__panel b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Origen ---------- */
.origin { display: grid; gap: 48px; align-items: center; margin-bottom: 72px; }
@media (min-width: 960px) { .origin { grid-template-columns: 1fr 1fr; gap: 80px; } }
.origin__media img { border-radius: var(--radius); aspect-ratio: 4/5; object-fit: cover; object-position: 55% 50%; }
.origin__caption { font-size: 13px; color: rgba(246,241,234,.55); margin: 12px 0 0; font-style: italic; }
.origin__text > p { color: rgba(246,241,234,.78); max-width: 56ch; }
.origin__text .section__title { margin-bottom: 24px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 36px 0 0; background: var(--line-light); border: 1px solid var(--line-light); border-radius: var(--radius); overflow: hidden; }
.stats div { background: var(--espresso); padding: 22px; }
.stats dt { font-family: var(--serif); font-size: clamp(34px, 4vw, 46px); line-height: 1; color: var(--kraft); font-variant-numeric: tabular-nums; }
.stats dd { margin: 8px 0 0; font-size: 13px; color: rgba(246,241,234,.7); }

.journey { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line-light); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 760px) { .journey { grid-template-columns: repeat(4, 1fr); } }
.journey li { background: var(--roast); padding: 28px; }
.journey span { font-size: 12px; font-weight: 700; color: var(--kraft); letter-spacing: .1em; }
.journey h3 { font-family: var(--serif); font-size: 22px; margin: 10px 0 8px; }
.journey p { margin: 0; font-size: 14px; color: rgba(246,241,234,.7); }

/* ---------- Club ---------- */
.club { display: grid; gap: 48px; align-items: start; }
@media (min-width: 960px) { .club { grid-template-columns: 1fr 1fr; gap: 80px; } }
.steps { list-style: none; counter-reset: s; margin: 32px 0; padding: 0; display: grid; gap: 18px; }
.steps li { counter-increment: s; position: relative; padding: 6px 0 0 54px; min-height: 36px; color: var(--muted); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--copper); color: var(--copper); display: grid; place-items: center; font-family: var(--serif); font-size: 17px; }
.steps b { color: var(--ink); }
.club__photo { border-radius: var(--radius); aspect-ratio: 16/10; object-fit: cover; }

.plan { background: var(--cream); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.3); padding: clamp(24px, 4vw, 40px); display: grid; gap: 22px; position: sticky; top: calc(var(--header-h) + 20px); }
.plan__title { font-family: var(--serif); font-size: 28px; }
.plan fieldset { border: 0; margin: 0; padding: 0; }
.plan legend, .field > span { font-size: 13px; font-weight: 700; margin-bottom: 8px; padding: 0; display: block; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg span { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); font-size: 14px; font-weight: 600; transition: all .2s var(--ease); line-height: 1.25; }
.seg small { font-size: 12px; font-weight: 500; color: var(--muted); }
.seg input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--cream); }
.seg input:checked + span small { color: rgba(246,241,234,.7); }
.seg input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }
.plan__total { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); }
.plan__price { font-family: var(--serif); font-size: 44px; line-height: 1; }
.plan__per { font-size: 14px; color: var(--muted); margin-left: 6px; }
.plan__save { margin: 0; font-size: 13px; font-weight: 700; color: #2f7a47; }
.plan__note { margin: -8px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- Academia ---------- */
.guides { display: grid; gap: 12px; }
.guide { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.guide summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 22px clamp(20px, 3vw, 32px); position: relative; padding-right: 64px; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: '+'; position: absolute; right: 28px; top: 50%; transform: translateY(-50%); font-size: 26px; font-weight: 300; color: var(--copper); transition: transform .3s var(--ease); }
.guide[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.guide__method { font-family: var(--serif); font-size: 26px; }
.guide__meta { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.guide__meta b { color: var(--copper-dark); }
.guide ol { margin: 0; padding: 0 clamp(20px, 3vw, 32px) 26px; counter-reset: g; list-style: none; display: grid; gap: 10px; }
@media (min-width: 900px) { .guide ol { grid-template-columns: repeat(5, 1fr); gap: 16px; } }
.guide li { counter-increment: g; font-size: 14px; padding-top: 12px; border-top: 2px solid var(--sand); }
.guide li::before { content: '0' counter(g); display: block; font-size: 12px; font-weight: 700; color: var(--copper); margin-bottom: 4px; }

/* ---------- B2B / Contacto ---------- */
.b2b { display: grid; gap: 48px; }
@media (min-width: 960px) { .b2b { grid-template-columns: 1fr 1fr; gap: 80px; } }
.b2b__text > p { color: var(--muted); margin: 24px 0; }
.b2b__list { list-style: none; margin: 0; padding: 0; display: grid; }
.b2b__list li { padding: 16px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.b2b__list b { display: block; color: var(--ink); font-family: var(--serif); font-weight: 400; font-size: 20px; }
.contact { display: grid; gap: 16px; background: var(--cream); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.3); padding: clamp(24px, 4vw, 40px); }
.contact__title { font-family: var(--serif); font-size: 28px; }
.field { display: block; }
.field > span { margin-bottom: 6px; }
.field textarea { resize: vertical; }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--cherry); }
.field__error { display: block; margin-top: 4px; font-size: 12.5px; color: var(--cherry); }
.contact__ok { margin: 0; padding: 14px; border-radius: var(--radius-sm); background: #e4efe4; color: #245c35; font-weight: 600; font-size: 14px; }

/* ---------- Pie ---------- */
.footer { background: var(--espresso); color: rgba(246,241,234,.72); padding-top: 72px; font-size: 14px; }
.footer__grid { display: grid; gap: 36px; grid-template-columns: 1fr; padding-bottom: 48px; }
@media (min-width: 720px) { .footer__grid { grid-template-columns: 1.3fr 1fr 1fr 1.3fr; } }
.logo__text--footer { color: var(--cream); font-size: 26px; display: block; margin-bottom: 14px; }
.footer h4 { color: var(--cream); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.footer a { display: block; text-decoration: none; padding: 3px 0; }
.footer a:hover { color: var(--cream); }
.footer p { margin: 0 0 10px; }
.newsletter { display: flex; border-bottom: 1px solid rgba(246,241,234,.35); }
.newsletter input { flex: 1; min-width: 0; background: none; border: 0; padding: 10px 0; color: var(--cream); }
.newsletter input::placeholder { color: rgba(246,241,234,.45); }
.newsletter input:focus { outline: none; }
.newsletter button { background: none; border: 0; color: var(--kraft); font-size: 20px; padding: 0 4px; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 22px; border-top: 1px solid var(--line-light); font-size: 12.5px; }

/* ---------- Ficha de producto (dialog) ---------- */
.sheet { width: min(980px, 100% - 24px); max-height: calc(100svh - 24px); padding: 0; border: 0; border-radius: calc(var(--radius) * 1.3); background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.sheet::backdrop { background: rgba(20,14,11,.6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet[open] { animation: rise .35s var(--ease); }
.sheet__inner { display: grid; }
@media (min-width: 820px) { .sheet__inner { grid-template-columns: .9fr 1.1fr; } }
.sheet__media { position: relative; min-height: 280px; background: var(--sand); }
.sheet__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sheet__media .bag { width: 46%; }
.sheet__content { padding: clamp(24px, 4vw, 44px); position: relative; }
.sheet__close { position: absolute; top: 14px; right: 14px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); font-size: 22px; line-height: 1; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--ink); }
.sheet__tag { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--copper); }
.sheet__title { font-family: var(--serif); font-size: clamp(32px, 4vw, 44px); line-height: 1.05; margin: 8px 0 12px; padding-right: 40px; }
.sheet__story { color: var(--muted); margin: 0 0 20px; }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin: 20px 0; font-size: 14px; }
.spec div { padding: 10px 0; border-top: 1px solid var(--line); }
.spec dt { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.spec dd { margin: 2px 0 0; font-weight: 500; }
.recipe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.recipe div { background: var(--sand); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.recipe b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 400; }
.recipe span { font-size: 12px; color: var(--muted); }
.sheet__buy { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; height: 44px; }
.qty button { width: 40px; height: 100%; border: 0; background: none; font-size: 18px; }
.qty output { min-width: 24px; text-align: center; font-weight: 700; }
.sheet__buy .btn { grid-column: 1 / -1; }

/* ---------- Carrito ---------- */
.cart-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(20,14,11,.5); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.cart {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(420px, 100%);
  background: var(--paper); display: flex; flex-direction: column;
  transform: translateX(100%); visibility: hidden;
  transition: transform .4s var(--ease), visibility 0s .4s;
  box-shadow: -20px 0 50px -20px rgba(0,0,0,.35);
}
.cart.is-open { transform: none; visibility: visible; transition: transform .4s var(--ease); }
.cart__head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.cart__head h2 { font-family: var(--serif); font-size: 26px; }
.cart__items { flex: 1; overflow-y: auto; padding: 8px 24px; }
.cart__empty { text-align: center; color: var(--muted); padding: 48px 0; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.line__thumb { width: 64px; height: 72px; border-radius: 8px; overflow: hidden; position: relative; }
.line__thumb img { width: 100%; height: 100%; object-fit: cover; }
.line__thumb .bag { width: 70%; }
.line__name { font-family: var(--serif); font-size: 18px; line-height: 1.2; }
.line__opt { font-size: 12.5px; color: var(--muted); }
.line .qty { height: 32px; margin-top: 6px; }
.line .qty button { width: 30px; font-size: 15px; }
.line__price { font-weight: 700; text-align: right; }
.line__remove { display: block; border: 0; background: none; font-size: 12px; color: var(--muted); text-decoration: underline; padding: 4px 0 0; margin-left: auto; }
.cart__foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.cart__ship { font-size: 13px; color: var(--muted); }
.cart__ship .bar { height: 4px; background: var(--sand); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.cart__ship .bar i { display: block; height: 100%; background: var(--copper); transition: width .4s var(--ease); }
.cart__total { display: flex; justify-content: space-between; font-size: 18px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--espresso); color: var(--cream); padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; transition: all .35s var(--ease); max-width: calc(100% - 32px); text-align: center; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Aparición al hacer scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
