/* LLEGO · Chocopez — estilos compartidos (tienda, seguimiento, panel y políticas) */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --ink-2: #333333;
  --muted: #6b6b6b;
  --line: #ececec;
  --line-2: #d9d9d9;
  --soft: #f7f6f4;
  --brand: #8a5a3a;
  --brand-soft: #f5eee8;

  --ok: #1d7a3a;      --ok-soft: #e7f5ec;
  --warn: #9a5800;    --warn-soft: #fdf1df;
  --info: #1f5fbf;    --info-soft: #e9f0fc;
  --violet: #5b3fc4;  --violet-soft: #efebfb;
  --teal: #0b7469;    --teal-soft: #e2f4f1;
  --danger: #b42318;  --danger-soft: #fdecea;

  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .10);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-head: 'Poppins', 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 5.4vw, 52px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- Barra superior ---------- */
.demo-banner {
  background: #fff8e6; color: #6a4a00; border-bottom: 1px solid #f1e2b8;
  font-size: 13px; text-align: center; padding: 8px 16px;
}
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 12px; }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 25px; letter-spacing: .08em; }
.brand-sub { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-top: 4px; }
.topnav { display: flex; align-items: center; gap: 10px; }
.link-plain { font-weight: 600; font-size: 15px; text-decoration: none; padding: 10px 6px; }
.link-plain:hover { text-decoration: underline; text-underline-offset: 4px; }

.cart-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 16px; border-radius: 999px;
  border: 0; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px;
}
.cart-btn svg { width: 20px; height: 20px; }
.cart-count {
  min-width: 22px; height: 22px; border-radius: 999px; background: #fff; color: var(--ink);
  font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; padding: 0 6px;
}
.cart-btn.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.08); } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 12px;
  font-weight: 700; font-size: 15px; text-decoration: none; text-align: center;
  border: 1.5px solid transparent; transition: background .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2b2b2b; }
.btn-ghost { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #166030; }
.btn-danger-link { background: none; border: 0; color: var(--danger); font-weight: 600; font-size: 14px; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 17px; border-radius: 14px; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  display: inline-grid; place-items: center; font-size: 20px; font-weight: 700; line-height: 1;
}
.icon-btn:hover { border-color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 44px 20px 28px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; letter-spacing: .02em;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.lead { font-size: 18px; color: var(--ink-2); max-width: 640px; margin-top: 14px; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 820px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; color: var(--ink-2); }
.steps b { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--font-head); }
.steps strong { color: var(--ink); }

/* ---------- Catálogo ---------- */
.section { padding: 20px 0 64px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.notice { border: 1px solid #f1d7b0; background: var(--warn-soft); color: #6d4300; padding: 14px 16px; border-radius: var(--r); font-weight: 600; margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 22px; }

.card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .ph { width: 100%; height: 100%; display: grid; place-items: center; color: #b9b9b9; font-family: var(--font-head); font-weight: 800; font-size: 28px; letter-spacing: .08em; }
.tag-out { position: absolute; top: 12px; left: 12px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 999px; letter-spacing: .06em; text-transform: uppercase; }
.card.is-out .card-media img { filter: grayscale(1); opacity: .6; }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.card-title { font-size: 20px; font-weight: 800; }
.card-desc { color: var(--muted); font-size: 14px; margin-top: -6px; min-height: 2.9em; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prices div { background: var(--soft); border-radius: var(--r-sm); padding: 9px 12px; }
.prices span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.prices strong { font-size: 17px; font-weight: 800; font-family: var(--font-head); }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; height: 40px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }

.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 12px; height: 46px; }
.stepper button { width: 44px; height: 100%; border: 0; background: none; font-size: 20px; font-weight: 700; }
.stepper button:disabled { opacity: .3; cursor: not-allowed; }
.stepper output { min-width: 30px; text-align: center; font-weight: 800; font-size: 17px; }
.stepper.sm { height: 38px; border-radius: 10px; }
.stepper.sm button { width: 36px; font-size: 18px; }
.stepper.sm output { min-width: 24px; font-size: 15px; }
.line-total { text-align: right; }
.line-total span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.line-total strong { font-family: var(--font-head); font-size: 20px; font-weight: 800; }

/* Barra inferior móvil */
.mobile-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 35;
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 14px 12px 18px; box-shadow: var(--shadow);
  border: 0; width: auto; text-align: left;
}
.mobile-bar .mb-info { display: flex; flex-direction: column; line-height: 1.2; }
.mobile-bar .mb-info small { opacity: .75; font-size: 12px; font-weight: 600; }
.mobile-bar .mb-info strong { font-family: var(--font-head); font-size: 18px; }
.mobile-bar .mb-cta { background: #fff; color: var(--ink); font-weight: 800; border-radius: 10px; padding: 10px 14px; font-size: 14px; }

/* ---------- Drawer del pedido ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .38); z-index: 50; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(480px, 100%); background: #fff; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .28s ease; box-shadow: var(--shadow);
  visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 22px; flex: 1; }
.drawer-steps { display: flex; gap: 6px; padding: 12px 18px 0; }
.drawer-steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.drawer-steps span.on { background: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; -webkit-overflow-scrolling: touch; }
.drawer-foot { border-top: 1px solid var(--line); padding: 14px 18px 18px; background: #fff; }
.totals { display: grid; gap: 4px; margin-bottom: 12px; font-size: 15px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals .grand { font-size: 20px; font-weight: 800; font-family: var(--font-head); padding-top: 6px; }

.empty { text-align: center; padding: 48px 12px; }
.empty h3 { margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }

.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cart-line:first-child { padding-top: 0; }
.cart-line img, .cart-line .thumb-ph { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--soft); }
.cart-line h4 { font-family: var(--font-head); font-size: 16px; font-weight: 700; }
.cart-line .meta { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.cart-line .right { text-align: right; display: flex; flex-direction: column; align-items: end; gap: 8px; }
.cart-line .right strong { font-family: var(--font-head); font-size: 16px; }
.link-remove { border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 0; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 22px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; min-width: 0; }
legend { font-family: var(--font-head); font-weight: 800; font-size: 17px; margin-bottom: 4px; padding: 0; }
.field { display: grid; gap: 6px; }
.field label, .label { font-weight: 700; font-size: 14px; }
.field .opt { font-weight: 500; color: var(--muted); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm);
  background: #fff; font-size: 16px; transition: border-color .15s;
}
.field textarea { min-height: 84px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.field.invalid input, .field.invalid select, .field.invalid textarea,
.field.invalid input:focus, .field.invalid select:focus, .field.invalid textarea:focus { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-msg { color: var(--danger); font-size: 13px; font-weight: 700; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 13px; color: var(--muted); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice-box { display: flex; flex-direction: column; gap: 4px; border: 1.5px solid var(--line-2); border-radius: var(--r); padding: 14px; height: 100%; transition: border-color .15s, background .15s; }
.choice-box strong { font-family: var(--font-head); font-size: 16px; }
.choice-box small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.choice input:checked + .choice-box { border-color: var(--ink); background: var(--soft); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input:focus-visible + .choice-box { outline: 3px solid var(--ink); outline-offset: 2px; }
.radio-list { display: grid; gap: 8px; }
.radio-list label { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); padding: 12px 14px; font-weight: 600; cursor: pointer; }
.radio-list input { width: 18px; height: 18px; accent-color: var(--ink); }
.radio-list label:has(input:checked) { border-color: var(--ink); background: var(--soft); }

.info-box { background: var(--soft); border-radius: var(--r); padding: 14px 16px; font-size: 14px; display: grid; gap: 4px; }
.info-box strong { font-size: 15px; }

.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); background: var(--soft); border-radius: var(--r); padding: 14px; }
.consent input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--ink); }
.consent a { font-weight: 700; }
.consent.invalid { box-shadow: inset 0 0 0 1.5px var(--danger); }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: var(--r-sm); padding: 12px 14px; font-weight: 600; font-size: 14px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Confirmación ---------- */
.success { text-align: center; padding: 10px 4px; display: grid; gap: 10px; }
.success-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 4px auto 6px; }
.success-icon svg { width: 36px; height: 36px; }
.code { font-family: var(--font-head); font-weight: 800; font-size: 38px; letter-spacing: .06em; padding: 8px 0; }
.summary { text-align: left; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px; margin: 8px 0; }
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.summary div:last-child { border-bottom: 0; }
.summary dt { color: var(--muted); font-weight: 600; }
.summary dd { margin: 0; font-weight: 700; text-align: right; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---------- Pie de página ---------- */
.footer { border-top: 1px solid var(--line); padding: 36px 0 90px; font-size: 14px; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; }
.footer h4 { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer .legal { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- Estados ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-RECIBIDO { color: var(--info); background: var(--info-soft); }
.st-ALISTAMIENTO { color: var(--warn); background: var(--warn-soft); }
.st-LISTO { color: var(--violet); background: var(--violet-soft); }
.st-EN_CAMINO { color: var(--teal); background: var(--teal-soft); }
.st-ENTREGADO { color: var(--ok); background: var(--ok-soft); }
.st-CANCELADO { color: var(--danger); background: var(--danger-soft); }
.badge-plain { color: var(--ink); background: var(--soft); }
.badge-plain::before { display: none; }

/* ---------- Seguimiento ---------- */
.track-wrap { max-width: 680px; margin: 0 auto; padding: 36px 20px 80px; }
.track-card { border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.track-status { display: grid; gap: 8px; margin: 6px 0 22px; }
.track-status h1 { font-size: clamp(30px, 6vw, 42px); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding-bottom: 22px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--ink); }
.timeline .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; display: grid; place-items: center; z-index: 1; }
.timeline .dot svg { width: 14px; height: 14px; display: none; }
.timeline li.done .dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.timeline li.done .dot svg { display: block; }
.timeline li.current .dot { border-color: var(--ink); box-shadow: 0 0 0 5px rgba(0,0,0,.08); }
.timeline li.current .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.timeline .t-title { font-weight: 800; font-family: var(--font-head); font-size: 16px; }
.timeline li:not(.done):not(.current) .t-title { color: #a8a8a8; }
.timeline .t-time { font-size: 13px; color: var(--muted); }
.kv { display: grid; gap: 0; border-top: 1px solid var(--line); margin-top: 22px; }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv span:first-child { color: var(--muted); font-weight: 600; }
.kv span:last-child { font-weight: 700; text-align: right; }
.items-mini { list-style: none; padding: 0; margin: 0; }
.items-mini li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.items-mini li:last-child { border-bottom: 0; }

/* ---------- Páginas de texto (políticas) ---------- */
.doc { max-width: 820px; margin: 0 auto; padding: 40px 20px 90px; }
.doc h1 { margin-bottom: 10px; }
.doc h2 { font-size: 24px; margin: 46px 0 12px; padding-top: 10px; scroll-margin-top: 80px; }
.doc h3 { font-size: 18px; margin: 26px 0 8px; }
.doc p, .doc li { color: var(--ink-2); font-size: 16px; }
.doc p + p { margin-top: 10px; }
.doc ul, .doc ol { padding-left: 22px; display: grid; gap: 6px; }
.doc .toc { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 6px; }
.doc .callout { background: var(--soft); border-radius: var(--r); padding: 16px 18px; margin-top: 14px; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 15px; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font-weight: 800; width: 38%; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .topbar-in { height: 62px; }
  .brand-name { font-size: 22px; }
  .link-plain.hide-sm { display: none; }
  .link-plain { font-size: 14px; padding: 8px 2px; }
  .toast { bottom: 96px; }
  .cart-btn .cart-total-top { display: none; }
  .hero { padding-top: 30px; }
  .lead { font-size: 16px; }
  .steps { grid-template-columns: 1fr; }
  .mobile-bar.has-items { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .choice-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
