:root {
  /* Los tonos del color principal los calcula store.js; estos son los valores de respaldo */
  --p: #A23B72;
  --p-dark: #752A52;
  --p-soft: #F4E8EE;
  --p-pale: #EBD4E0;
  --p-light: #CC93B1;
  --p-faint: #DAB1C7;
  --p-edge: #D09DB9;
  --bg: #FBF7FA;
  --surface: #FFFFFF;
  --veil: #F3E9F0;
  --ink: #33192E;
  --muted: #79666F;
  --line: #E8D9E3;
  --ok: #3F7D5B;
  --bad: #B3261E;
  --display: 'Bodoni Moda', 'Didot', Georgia, serif;
  --body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--body); -webkit-font-smoothing: antialiased;
  overflow-x: hidden; overflow-wrap: break-word; word-wrap: break-word;
}
body.lock { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; max-width: 100%; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { touch-action: manipulation; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--p-edge); outline-offset: 2px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- Barra superior + encabezado ---------- */
.stick { position: sticky; top: 0; z-index: 30; background: var(--bg); }
.ann {
  background: var(--ink); color: #fff; text-align: center; font-size: .86rem; line-height: 1.3;
  padding: 7px 14px; min-height: 32px; display: flex; align-items: center; justify-content: center;
}
.ann span { display: block; }
.ann.fade span { animation: annIn .5s ease; }
@keyframes annIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { height: 38px; width: auto; max-width: 120px; object-fit: contain; border-radius: 6px; }
.brand span { font-family: var(--display); font-size: 1.3rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none;
  border: 1.5px solid var(--p); background: transparent; color: var(--p-dark);
  padding: 8px 14px; border-radius: 999px; font-weight: 600;
}
.cart-btn:hover { background: var(--p-soft); }
.cart-btn svg { width: 20px; height: 20px; }
.cart-btn .n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--p); color: #fff; font-size: .8rem; display: grid; place-items: center; }
.cart-btn .n[data-n="0"] { display: none; }
@media (max-width: 380px) { .cart-btn .t { display: none; } }

/* ---------- Portada ---------- */
.hero { position: relative; overflow: hidden; padding: 0 0 150px; isolation: isolate; }
.hero .ribbon { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 250px; z-index: -1; }
.banner { display: block; width: 100%; background: var(--veil); }
.banner img { width: 100%; height: auto; max-height: 82vh; object-fit: contain; margin: 0 auto; }
.hero-in { width: min(1120px, 100% - 32px); margin-inline: auto; padding-top: 40px; }
.hero h1 {
  font-family: var(--display); font-weight: 400; font-size: clamp(2.3rem, 8.5vw, 4.8rem);
  line-height: 1.04; margin: 0 0 14px; letter-spacing: -.01em; text-wrap: balance;
}
.hero p { margin: 0 0 24px; max-width: 36ch; font-size: 1.08rem; color: #5a4553; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 26px; font-weight: 700;
  background: var(--p); color: #fff; text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--p-dark); }
.btn.ghost { background: transparent; color: var(--p-dark); border: 1.5px solid var(--p); }
.btn.ghost:hover { background: var(--p-soft); }
.btn.wa { background: #1FA855; }
.btn.wa:hover { background: #17893f; }
.btn[disabled] { opacity: .5; pointer-events: none; }
@media (min-width: 820px) {
  .hero { padding-bottom: 110px; }
  .hero .ribbon { top: 0; height: 100%; }
  .hero-in { padding-top: 64px; }
  .hero.with-banner .hero-in { padding-top: 44px; }
}

/* ---------- Catálogo ---------- */
.catalog { padding: 36px 0 52px; background: var(--surface); border-top: 1px solid var(--line); }
.sec-title { font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.5rem); margin: 0 0 16px; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; margin-bottom: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 18px; border-radius: 999px; font-weight: 500; }
.cat[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: none; border: 0; padding: 0; text-align: left; display: block; width: 100%; min-width: 0; }
.card .ph { aspect-ratio: 4/5; background: var(--veil); border-radius: 14px; overflow: hidden; position: relative; display: grid; place-items: center; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.card .ph > svg { width: 46%; color: var(--p-faint); }
.badge { position: absolute; top: 8px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge.off { left: 8px; background: var(--p); color: #fff; }
.badge.pin { right: 8px; background: rgba(255,255,255,.95); color: var(--ink); }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 1.08rem; line-height: 1.25; margin: 10px 0 2px; overflow-wrap: anywhere; }
.card .price { color: var(--muted); font-size: .94rem; }
.card .price b { color: var(--p-dark); font-weight: 700; }
.card .price s { margin-right: 4px; font-size: .86rem; }
.empty { grid-column: 1 / -1; padding: 40px 0; color: var(--muted); text-align: center; }

/* ---------- Sobre mí / pie ---------- */
.about { padding: 52px 0; }
.about .wrap { max-width: 720px; text-align: center; }
.about p { font-family: var(--display); font-size: clamp(1.15rem, 3.4vw, 1.55rem); line-height: 1.5; margin: 0; white-space: pre-line; }
.foot { background: var(--ink); color: #EBDDE6; padding: 34px 16px calc(34px + var(--safe-b)); text-align: center; }
.foot .name { font-family: var(--display); font-size: 1.5rem; color: #fff; margin-bottom: 6px; }
.foot a { color: #fff; margin: 0 10px; }
.foot .links { margin: 12px 0; }
.foot small { opacity: .75; }

/* ---------- Capas ---------- */
.overlay { position: fixed; inset: 0; background: rgba(35, 15, 30, .55); z-index: 40; }

/* ---------- Ficha de producto ---------- */
.sheet {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; top: 4vh; top: 4dvh;
  background: var(--bg); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; overflow: hidden;
}
.sheet-close, .drawer-close {
  position: absolute; top: 10px; right: 10px; z-index: 3; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.95); box-shadow: 0 2px 10px rgba(0,0,0,.2); font-size: 1.4rem; line-height: 1;
}
.sheet-scroll { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.gal-main { aspect-ratio: 4/3; max-height: 38vh; max-height: 38dvh; width: 100%; background: var(--veil); display: grid; place-items: center; overflow: hidden; }
.gal-main img { width: 100%; height: 100%; object-fit: cover; }
.gal-main svg { width: 30%; color: var(--p-faint); }
.thumbs { display: flex; gap: 8px; padding: 10px 16px 0; overflow-x: auto; }
.thumbs button { flex: none; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--veil); }
.thumbs button[aria-current="true"] { border-color: var(--p); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.sheet-info { padding: 16px 16px 22px; }
.sheet-info h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; line-height: 1.15; margin: 0 0 8px; overflow-wrap: anywhere; }
.sheet-info .off-tag { display: inline-block; background: var(--p); color: #fff; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; }
.sheet-info .desc { color: var(--muted); margin: 0 0 6px; white-space: pre-line; }
.grp { padding: 16px 0 4px; border-top: 1px solid var(--line); margin-top: 14px; }
.grp h4 { margin: 0 0 6px; font-size: 1.02rem; font-weight: 700; }
.grp .hint { font-size: .85rem; color: var(--muted); margin: 0 0 10px; }
.grp .req { color: var(--p-dark); font-weight: 600; font-size: .78rem; margin-left: 6px; }
.grp.err { border-top-color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 500; font-size: .94rem; }
.chip:hover { border-color: var(--p-edge); }
.chip.on { border-color: var(--p); background: var(--p-soft); color: var(--p-dark); font-weight: 600; }
.chip .dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); flex: none; }
.chip .plus { font-size: .8rem; color: var(--muted); font-weight: 500; }
.chip.on .plus { color: var(--p-dark); }
.rep { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 4px; margin-bottom: 10px; }
.rep > h5 { margin: 0 0 8px; font-family: var(--display); font-size: 1.08rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rep .fld { margin-bottom: 12px; }
.rep .fld > span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.linkbtn { background: none; border: 0; color: var(--p-dark); text-decoration: underline; font-size: .85rem; padding: 4px 0; font-weight: 500; }
.qrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.qrow .qn { font-weight: 500; min-width: 0; }
.qrow .qn small { color: var(--muted); display: block; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); flex: none; }
.stepper button { width: 36px; height: 36px; border: 0; background: none; font-size: 1.2rem; border-radius: 50%; }
.stepper button:hover { background: var(--p-soft); }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; }
.note { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); resize: vertical; min-height: 64px; font-size: 16px; }
.sheet-foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
.sheet-foot .tot { flex: 1; line-height: 1.2; min-width: 0; }
.sheet-foot .tot small { color: var(--muted); display: block; font-size: .8rem; }
.sheet-foot .tot b { font-family: var(--display); font-size: 1.35rem; }
.sheet-foot .tot s { color: var(--muted); font-size: .85rem; margin-left: 6px; }
@media (min-width: 860px) {
  .sheet { top: 5vh; bottom: 5vh; left: 50%; right: auto; width: min(960px, 94vw); margin-left: calc(min(960px, 94vw) / -2); border-radius: 22px; }
  .sheet-body { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .gal { position: sticky; top: 0; }
  .gal-main { aspect-ratio: 1/1; max-height: none; }
}

/* ---------- Carrito ---------- */
.drawer { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--bg); display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.18); }
.drawer-head { padding: 16px 60px 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.45rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.item { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item .im { width: 60px; height: 60px; border-radius: 10px; background: var(--veil); overflow: hidden; display: grid; place-items: center; }
.item .im img { width: 100%; height: 100%; object-fit: cover; }
.item .im svg { width: 55%; color: var(--p-faint); }
.item h3 { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.item ul { list-style: none; margin: 4px 0 0; padding: 0; font-size: .85rem; color: var(--muted); }
.item .inote { font-size: .85rem; font-style: italic; color: var(--muted); margin-top: 2px; }
.item .row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.item .row b { font-family: var(--display); font-size: 1.1rem; white-space: nowrap; }
.item .row s { color: var(--muted); font-size: .8rem; font-weight: 400; display: block; text-align: right; }
.item .stepper button { width: 30px; height: 30px; }
.rm { background: none; border: 0; color: var(--bad); font-size: .85rem; text-decoration: underline; padding: 6px 0 0; }
.form { padding: 16px 0 4px; }
.form h3 { font-family: var(--display); font-size: 1.2rem; margin: 0 0 10px; font-weight: 600; }
.field { margin-bottom: 12px; }
.field label.l { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.field input[type=text], .field input[type=tel], .field input:not([type]) { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); font-size: 16px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 8px; cursor: pointer; }
.opt input { margin-top: 4px; accent-color: var(--p); }
.opt.on { border-color: var(--p); background: var(--p-soft); }
.cprow { display: flex; gap: 8px; }
.cprow input { flex: 1; min-width: 0; }
.cprow .btn { padding: 10px 14px; flex: none; }
.ship-msg { font-size: .9rem; margin-top: 8px; }
.ship-msg.ok { color: var(--ok); }
.ship-msg.warn { color: #8a5a00; }
.ship-msg.bad { color: var(--bad); }
.drawer-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 12px 16px calc(12px + var(--safe-b)); }
.sum { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; margin-bottom: 3px; color: var(--muted); }
.sum.disc { color: var(--ok); font-weight: 600; }
.sum.total { color: var(--ink); font-size: 1.05rem; margin: 6px 0 10px; align-items: baseline; }
.sum.total b { font-family: var(--display); font-size: 1.5rem; }
.drawer-foot .btn { width: 100%; }
.small { font-size: .8rem; color: var(--muted); margin: 8px 0 0; text-align: center; }
.sent { background: var(--p-soft); border-radius: 12px; padding: 10px 12px; font-size: .9rem; margin-bottom: 10px; text-align: center; }
.sent .row2 { display: flex; gap: 8px; margin-top: 8px; }
.sent .row2 .btn { padding: 9px 12px; font-size: .88rem; }
.cart-empty { text-align: center; padding: 56px 10px; color: var(--muted); }
.cart-empty svg { width: 70px; color: var(--p-faint); margin: 0 auto 12px; }

/* ---------- Barra de progreso de beneficios ---------- */
.prog { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 8px; margin-bottom: 14px; }
.prog-msg { font-size: .9rem; font-weight: 600; margin-bottom: 4px; line-height: 1.35; }
.prog-msg b { color: var(--p-dark); }
.prog-wrap { padding: 0 24px 0 6px; }
.track { position: relative; height: 8px; background: var(--veil); border-radius: 99px; margin: 24px 0 52px; }
.fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--p); transition: width .5s ease; }
.mk { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.mk .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); color: var(--muted); }
.mk.on .ic { background: var(--p); border-color: var(--p); color: #fff; }
.mk .ic svg { width: 15px; height: 15px; }
.mk .lb { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); width: 76px; text-align: center; font-size: .7rem; line-height: 1.2; color: var(--muted); }
.mk.on .lb { color: var(--ink); font-weight: 600; }
.mk .lb i { display: block; font-style: normal; font-weight: 700; margin-top: 1px; }
.mk.new .ic { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- Cupón ---------- */
.coupon { margin: 14px 0 4px; padding-top: 12px; border-top: 1px dashed var(--line); }
.coupon .tg { background: none; border: 0; color: var(--p-dark); font-weight: 600; text-decoration: underline; padding: 4px 0; }
.coupon .cprow { margin-top: 8px; }
.coupon .cmsg { font-size: .86rem; margin-top: 6px; }
.coupon .cmsg.bad { color: var(--bad); }
.coupon .applied { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--p-soft); border: 1.5px dashed var(--p); border-radius: 12px; padding: 9px 12px; font-size: .9rem; }
.coupon .applied b { color: var(--p-dark); }
.coupon .applied.warn { background: #FFF5E0; border-color: #D9A520; }

.toast {
  position: fixed; left: 50%; top: 12px; transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; z-index: 80; font-size: .92rem; transition: opacity .25s, transform .25s;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Buscador y orden ---------- */
.tools { margin: 0 0 12px; }
.tl { display: flex; gap: 8px; }
.srch { position: relative; flex: 1; min-width: 0; }
.srch svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.srch input { width: 100%; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 38px 10px 38px; background: var(--surface); font-size: 16px; -webkit-appearance: none; appearance: none; }
.srch button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--veil); font-size: 1.1rem; line-height: 1; }
.tl select { flex: none; max-width: 46%; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 12px; background: var(--surface); font-size: 16px; }
@media (max-width: 420px) { .tl { flex-direction: column; } .tl select { max-width: none; width: 100%; } }

/* ---------- Tiempo de anticipación ---------- */
.lead { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: .78rem; color: var(--p-dark); font-weight: 600; line-height: 1.25; }
.lead svg, .lead-box svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lead-box { display: flex; gap: 10px; align-items: flex-start; background: var(--p-soft); border: 1px solid var(--p-pale); border-radius: 14px; padding: 10px 12px; margin: 0 0 12px; color: var(--p-dark); }
.lead-box svg { width: 22px; height: 22px; margin-top: 1px; }
.lead-box b { display: block; font-size: .95rem; }
.lead-box span { font-size: .85rem; color: #5a4553; }
.opt-tag { font-weight: 400; color: var(--muted); }
#dateHint { margin-top: 5px; }
#dateHint .ferr { color: var(--bad); font-weight: 600; margin-top: 4px; }

/* ---------- Botón flotante de WhatsApp ---------- */
.wa-float {
  position: fixed; right: 16px; bottom: calc(18px + var(--safe-b)); z-index: 35; width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px -6px rgba(0,0,0,.45);
}
.wa-float svg { width: 32px; height: 32px; }
.wa-float:hover { background: #1fb457; }
body.lock .wa-float { display: none; }

/* ---------- Pedido enviado ---------- */
.done { text-align: center; padding: 40px 10px; }
.done .ok { width: 68px; height: 68px; border-radius: 50%; background: #E3F3EA; color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; font-size: 2.1rem; }
.done h3 { font-family: var(--display); font-size: 1.6rem; margin: 0 0 10px; }
.done p { margin: 0 auto 8px; max-width: 32ch; }
