/* PuroBrillo · tienda */
:root {
  --green-950: #071f17;
  --green-900: #0b2e22;
  --green-800: #0f3d2e;
  --green-700: #165a43;
  --green-100: #e4f2ea;
  --red-700: #9e1027;
  --red-600: #c0172f;
  --red-50: #fdecee;
  --gold-300: #f3dc95;
  --gold-400: #e9c46a;
  --gold-500: #d4a83f;
  --gold-700: #8a6414;
  --amber-100: #fff3d6;
  --amber-800: #7a4a00;
  --cream: #fffaf1;
  --cream-2: #fbf1df;
  --ink: #1d2721;
  --muted: #56625b;
  --line: #eadfca;
  --white: #fff;
  --wa: #158f4a;
  --wa-dark: #0f7339;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(11 46 34 / .06), 0 8px 24px rgb(11 46 34 / .10);
  --shadow-lg: 0 20px 60px rgb(7 31 23 / .28);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --script: 'Great Vibes', 'Brush Script MT', cursive;
  --gutter: clamp(16px, 4vw, 40px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.intro-open, body.modal-open { overflow: hidden; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; border-radius: 8px; }

/* ---------- intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 40%, #134b38 0%, var(--green-900) 55%, var(--green-950) 100%);
  transition: opacity .8s var(--ease), visibility .8s;
  cursor: pointer;
}
.intro.done { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-glow {
  position: absolute; width: min(80vw, 720px); aspect-ratio: 2 / 1;
  background: radial-gradient(closest-side, rgb(233 196 106 / .22), transparent);
  filter: blur(10px);
  opacity: 0; transition: opacity 2.4s ease;
}
.intro.play .intro-glow { opacity: 1; }
.intro-snow { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-svg { position: relative; width: min(94vw, 980px); height: auto; overflow: visible; }
.intro-svg text { font-family: var(--script); font-size: 190px; }
.intro-ink {
  fill: none; stroke: url(#goldInk); stroke-width: 1.8;
  stroke-dasharray: 900; stroke-dashoffset: 900;
}
.intro-fill { fill: url(#goldInk); opacity: 0; }
.intro-shine { fill: url(#shine); pointer-events: none; }
/* El barrido del trazo y la punta del lápiz se mueven desde store.js. */
.pen { opacity: 0; }
.pen-star { fill: #fff8dc; filter: drop-shadow(0 0 8px #ffe39a) drop-shadow(0 0 18px #e9c46a); }
.intro-sparkles path { fill: var(--gold-300); opacity: 0; transform-box: fill-box; transform-origin: center; }

.intro.play .intro-ink { animation: ink 2.9s cubic-bezier(.45, .05, .4, 1) forwards; }
.intro.play .intro-fill { animation: fillIn 1.6s ease .9s forwards; }
.intro.play .intro-sparkles path { animation: twinkle 1.6s ease-in-out infinite; }
.intro.play .intro-sparkles path:nth-child(2) { animation-delay: .5s; }
.intro.play .intro-sparkles path:nth-child(3) { animation-delay: 1.1s; }
.intro.play .intro-sparkles path:nth-child(4) { animation-delay: .8s; }
.intro.play .intro-sparkles path:nth-child(5) { animation-delay: 1.4s; }

@keyframes ink { to { stroke-dashoffset: 0; } }
@keyframes fillIn { to { opacity: 1; } }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(45deg); }
}
.intro-skip {
  position: absolute; bottom: calc(28px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
  background: rgb(255 255 255 / .08); border: 1px solid rgb(233 196 106 / .45); color: var(--gold-300);
  padding: 12px 22px; border-radius: 999px; font-size: 16px; font-weight: 700; cursor: pointer;
  opacity: 0; transition: opacity .6s ease 1.2s, background .2s;
}
.intro.play .intro-skip { opacity: 1; }
.intro-skip:hover { background: rgb(255 255 255 / .16); }

/* ---------- hero ---------- */
.snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero {
  position: relative; z-index: 2;
  color: var(--white);
  text-align: center;
  background:
    radial-gradient(60% 120% at 50% 0%, rgb(233 196 106 / .18), transparent 70%),
    linear-gradient(180deg, var(--green-800), var(--green-900));
  padding: calc(22px + env(safe-area-inset-top, 0px)) var(--gutter) 78px;
  overflow: hidden;
}
.hero-inner { position: relative; max-width: 900px; margin: 0 auto; }
.brand {
  display: inline-block;
  font-family: var(--script); font-weight: 400;
  font-size: clamp(64px, 14vw, 120px); line-height: 1.25; margin: 0;
  /* La cursiva sobresale de su caja (mayúsculas altas y colas); con background-clip
     el degradado solo pinta dentro de la caja, así que se le da aire por todos lados. */
  padding: .12em .28em .1em;
  background: linear-gradient(120deg, #fff3cc, var(--gold-400) 40%, #c9952e 70%, #f7dc8f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 12px rgb(233 196 106 / .35));
}
.hero-tag { margin: 0 0 22px; font-size: clamp(18px, 2.6vw, 22px); font-weight: 700; color: #f7ecd2; }
.steps {
  list-style: none; margin: 0 auto; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px;
}
.steps li {
  display: flex; align-items: center; gap: 10px;
  background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14);
  padding: 8px 16px 8px 8px; border-radius: 999px; font-weight: 700; font-size: 16px;
}
.step-n {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold-400); color: var(--green-900); font-weight: 900; font-size: 16px;
}

/* guirnalda de luces */
.hero-garland { position: absolute; left: 0; bottom: 4px; width: 100%; height: 56px; overflow: visible; }
.garland-wire { fill: none; stroke: #2a1a0c; stroke-width: 2; opacity: .85; }
.garland-wire-shine { fill: none; stroke: var(--gold-400); stroke-width: .8; opacity: .55; }
.bulb-cap { fill: #b99748; }
.bulb { animation: glow 2.6s ease-in-out infinite; }
.bulb.red { fill: #ff5468; filter: drop-shadow(0 0 5px #ff5468); }
.bulb.gold { fill: #ffd56b; filter: drop-shadow(0 0 5px #ffd56b); }
.bulb.green { fill: #63e594; filter: drop-shadow(0 0 5px #63e594); }
.bulb.blue { fill: #9fdcff; filter: drop-shadow(0 0 5px #9fdcff); }
@keyframes glow { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- catálogo ---------- */
.shop { position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; padding: 32px var(--gutter) 140px; }
.shop-head { text-align: center; margin-bottom: 24px; }
.section-title { margin: 0; font-size: clamp(26px, 4vw, 34px); font-weight: 900; color: var(--green-800); }
.section-sub { margin: 4px 0 0; color: var(--muted); font-size: 17px; }

.grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 26px; } }
@media (min-width: 1240px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  animation: rise .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgb(11 46 34 / .06), 0 18px 40px rgb(11 46 34 / .16); }
  .card:hover .card-media img { transform: scale(1.04); }
  .card:hover .card-media .alt { opacity: 1; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.card.skeleton { min-height: 420px; }
.card.skeleton, .card-media.loading {
  background: linear-gradient(100deg, var(--cream-2) 30%, #fff 50%, var(--cream-2) 70%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.card-media {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer;
  aspect-ratio: 6 / 5; background: var(--cream-2); overflow: hidden;
}
@media (min-width: 600px) { .card-media { aspect-ratio: 1; } }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .5s ease; }
.card-media img[data-loading] { opacity: 0; }
.card-media .alt { opacity: 0; }
.card-media::after { /* marco fino que da acabado de vitrina */
  content: ''; position: absolute; inset: 8px; border-radius: 14px;
  border: 1px solid rgb(255 255 255 / .55); pointer-events: none;
}
.badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgb(11 46 34 / .82); color: var(--white); backdrop-filter: blur(6px);
  font-size: 14px; font-weight: 800; padding: 5px 11px; border-radius: 999px;
}
.badge svg { width: 14px; height: 14px; }
.badge.soldout { background: rgb(60 66 63 / .9); }

.card-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; flex: 1; }
.card-name { margin: 0; font-size: 21px; line-height: 1.25; font-weight: 800; color: var(--ink); }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.price { font-size: 26px; font-weight: 900; color: var(--red-600); letter-spacing: -.01em; }
.price.tbd { font-size: 17px; font-weight: 800; color: var(--muted); }

.stock {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 800; padding: 5px 12px; border-radius: 999px;
  background: var(--green-100); color: var(--green-700);
}
.stock::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock.low { background: var(--amber-100); color: var(--amber-800); }
.stock.out { background: #eceeed; color: #5f6662; }
.stock.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.12); } }

.card-actions { margin-top: auto; display: flex; gap: 10px; }
.card-actions .btn { flex: 1; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 20px; border-radius: 14px; border: 0;
  font-size: 18px; font-weight: 800; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red-600); color: var(--white); box-shadow: 0 6px 16px rgb(192 23 47 / .28); }
.btn-primary:hover { background: var(--red-700); }
.btn-ghost { background: var(--white); color: var(--green-800); border: 2px solid var(--green-800); }
.btn-ghost:hover { background: var(--green-100); }
.btn[disabled] { background: #d9dcda; color: #69706c; box-shadow: none; cursor: not-allowed; border-color: transparent; }
.btn-wa { width: 100%; background: var(--wa); color: var(--white); font-size: 20px; min-height: 60px; box-shadow: 0 8px 20px rgb(21 143 74 / .3); }
.btn-wa:hover { background: var(--wa-dark); }
.btn-wa svg { width: 26px; height: 26px; }
.btn-wa[aria-disabled="true"] { background: #b8c2bc; box-shadow: none; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--red-600); font-weight: 800; text-decoration: underline; cursor: pointer; }

.stepper {
  flex: 1; display: grid; grid-template-columns: 52px 1fr 52px; align-items: center;
  border: 2px solid var(--green-800); border-radius: 14px; overflow: hidden; min-height: 52px; background: var(--white);
}
.stepper button {
  height: 100%; min-height: 48px; border: 0; background: var(--green-100); color: var(--green-800);
  font-size: 26px; font-weight: 900; cursor: pointer; transition: background .2s;
}
.stepper button:hover:not([disabled]) { background: #cfe7da; }
.stepper button[disabled] { color: #a9b3ad; cursor: not-allowed; }
.stepper output { text-align: center; font-size: 20px; font-weight: 900; }
.stepper output small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1; }

.load-error { text-align: center; color: var(--red-700); font-weight: 700; }

/* ---------- pie ---------- */
.footer {
  position: relative; z-index: 2; text-align: center; padding: 36px var(--gutter) calc(120px + var(--safe-bottom));
  background: var(--green-900); color: #e8efe9; font-size: 17px;
}
.footer a { color: var(--gold-300); font-weight: 800; }
.footer-brand { font-family: var(--script); font-size: 46px; margin: 0; color: var(--gold-400); line-height: 1.3; }
.footer-small { font-size: 15px; opacity: .75; }

/* ---------- barra del carrito ---------- */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px var(--gutter) calc(10px + var(--safe-bottom));
  pointer-events: none;
  animation: barIn .45s var(--ease);
}
@keyframes barIn { from { transform: translateY(110%); } }
.cart-bar-btn {
  pointer-events: auto;
  width: 100%; max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 10px 12px 10px 18px; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--green-800); color: var(--white); text-align: left;
  box-shadow: var(--shadow-lg), 0 0 0 2px rgb(233 196 106 / .5) inset;
}
.cart-bar-icon { font-size: 26px; }
.cart-bar-text { flex: 1; display: flex; flex-direction: column; line-height: 1.2; font-size: 16px; }
.cart-bar-text strong { font-size: 18px; }
.cart-bar-cta { background: var(--gold-400); color: var(--green-900); font-weight: 900; padding: 12px 18px; border-radius: 12px; white-space: nowrap; }
.cart-bar.pulse .cart-bar-btn { animation: pulse .5s var(--ease); }
@keyframes pulse { 40% { transform: scale(1.03); } }

/* ---------- hojas (detalle y carrito) ---------- */
.sheet {
  padding: 0; border: 0; background: transparent; color: var(--ink);
  width: 100%; max-width: 100%; max-height: 100%; margin: 0;
  position: fixed; inset: auto 0 0 0; height: auto; overflow: visible;
}
.sheet::backdrop { background: rgb(7 31 23 / .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s ease; }
.sheet[open].shown::backdrop { opacity: 1; }
/* Marco: no se desplaza (así el botón ✕ siempre queda a la vista). */
.sheet-body {
  position: relative; display: flex; flex-direction: column;
  background: var(--cream); border-radius: 26px 26px 0 0; overflow: hidden;
  max-height: 94dvh;
  transform: translateY(100%); transition: transform .38s var(--ease);
  box-shadow: var(--shadow-lg);
}
.sheet[open].shown .sheet-body { transform: none; }
/* Contenido: es lo que se desplaza. */
.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (min-width: 760px) {
  .sheet { inset: 0; margin: auto; width: min(94vw, 1040px); height: fit-content; }
  .sheet-body { border-radius: 26px; max-height: 90dvh; transform: translateY(24px) scale(.98); opacity: 0; transition: transform .35s var(--ease), opacity .3s ease; }
  .sheet[open].shown .sheet-body { transform: none; opacity: 1; }
  #cart-dialog { width: min(92vw, 560px); }
}
.sheet-close {
  position: absolute; top: 12px; right: 12px; z-index: 6;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgb(255 255 255 / .94); color: var(--ink); font-size: 22px; font-weight: 900;
  box-shadow: 0 2px 10px rgb(0 0 0 / .18);
}

/* ---------- detalle de producto ---------- */
.pd-media { background: var(--green-950); }
.gallery { position: relative; }
.gallery-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  aspect-ratio: 1 / 1; max-height: 56dvh; width: 100%;
}
.gallery-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; position: relative; overflow: hidden; }
.slide > img:not(.blur-bg), .slide video { width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 1; }
.slide.photo { cursor: zoom-in; }
.slide .blur-bg { position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px); object-fit: cover; filter: blur(26px) brightness(.5) saturate(1.25); z-index: 0; }
.slide > img:not(.blur-bg) { opacity: 0; transition: opacity .45s ease; }
.slide > img.ready { opacity: 1; }

.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgb(255 255 255 / .92); color: var(--green-900); font-size: 30px; line-height: 1; font-weight: 900;
  box-shadow: 0 2px 10px rgb(0 0 0 / .25); display: none;
}
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
@media (hover: hover) { .gallery.multi .gallery-nav { display: block; } }
.gallery-count {
  position: absolute; left: 12px; bottom: 12px; z-index: 3;
  background: rgb(7 31 23 / .72); color: #fff; font-size: 14px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px);
}
.gallery-count:empty { display: none; }

.thumbs {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 12px 12px; background: var(--green-950);
}
.thumbs::-webkit-scrollbar { display: none; }
.thumbs:empty { display: none; }
.thumb {
  position: relative; flex: 0 0 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 12px;
  overflow: hidden; cursor: pointer; background: #183f31; opacity: .6; transition: opacity .2s, border-color .2s, transform .2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { opacity: 1; border-color: var(--gold-400); transform: translateY(-2px); }
.thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgb(0 0 0 / .25); color: #fff;
}
.thumb .play svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 3px rgb(0 0 0 / .6)); }

/* video con controles propios */
.video-slide video { cursor: pointer; }
.v-spinner {
  position: absolute; z-index: 2; width: 54px; height: 54px; border-radius: 50%;
  border: 4px solid rgb(255 255 255 / .25); border-top-color: var(--gold-400);
  animation: spin .9s linear infinite; opacity: 0; transition: opacity .25s; pointer-events: none;
}
.video-slide.buffering .v-spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.v-play {
  position: absolute; z-index: 3; width: 78px; height: 78px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: rgb(255 255 255 / .92); color: var(--green-900);
  box-shadow: 0 0 0 6px rgb(233 196 106 / .45), 0 10px 30px rgb(0 0 0 / .35);
  transition: opacity .25s, transform .25s var(--ease);
}
.v-play svg { width: 32px; height: 32px; margin-left: 4px; }
.video-slide.playing .v-play, .video-slide.buffering .v-play { opacity: 0; transform: scale(.85); pointer-events: none; }
.v-sound {
  position: absolute; z-index: 3; right: 12px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgb(7 31 23 / .78); color: #fff; border: 1px solid rgb(233 196 106 / .5);
  padding: 9px 14px; border-radius: 999px; font-size: 15px; font-weight: 800; cursor: pointer; backdrop-filter: blur(4px);
}
.v-progress { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(255 255 255 / .2); }
.v-progress span { display: block; height: 100%; width: 0; background: var(--gold-400); }

.pd-side { display: flex; flex-direction: column; }
.pd-info { padding: 20px var(--gutter) 8px; display: flex; flex-direction: column; gap: 14px; }
.pd-name { margin: 0; font-size: clamp(24px, 4vw, 30px); line-height: 1.2; font-weight: 900; color: var(--green-900); padding-right: 40px; }
.pd-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pd-meta .price { font-size: 32px; }
.pd-desc { margin: 0; font-size: 18px; color: #36423b; white-space: pre-line; }
.pd-desc:empty { display: none; }
.pd-perks { list-style: none; margin: 4px 0 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; font-size: 16px; font-weight: 700; color: #3c4842; }
.pd-perks span { display: inline-block; width: 26px; }
/* Barra de compra fija abajo, como en las tiendas grandes: nunca queda "cortada". */
.pd-actions {
  position: sticky; bottom: 0; z-index: 4;
  display: flex; flex-direction: column; gap: 10px;
  margin-top: auto; padding: 14px var(--gutter) calc(14px + var(--safe-bottom));
  background: rgb(255 250 241 / .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgb(11 46 34 / .08);
}
.pd-actions .row { display: flex; gap: 10px; }
.pd-actions .row > * { flex: 1; }

@media (min-width: 760px) {
  .pd { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); overflow: hidden; }
  .pd-media { display: flex; flex-direction: column; }
  .pd-media .gallery { flex: 1; }
  .pd-media .gallery-track { aspect-ratio: auto; height: min(70dvh, 600px); max-height: none; }
  .pd-side { max-height: 90dvh; overflow-y: auto; }
  .pd-info { padding: 34px 30px 16px; }
  .pd-actions { padding: 16px 30px 22px; }
}

/* ---------- carrito ---------- */
.cart { padding: 22px var(--gutter) 0; }
.cart-title { margin: 0 0 14px; font-size: 28px; font-weight: 900; color: var(--green-900); }
.cart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cart-item {
  display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: start;
  background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 12px;
}
.cart-item img { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; background: var(--cream-2); }
.cart-item-name { margin: 0; font-weight: 800; font-size: 18px; line-height: 1.25; }
.cart-item-sub { margin: 2px 0 8px; color: var(--muted); font-size: 16px; }
.cart-item-controls { display: flex; align-items: center; gap: 10px; }
.cart-item-controls .stepper { flex: 0 0 170px; min-height: 48px; }
.remove-btn { background: none; border: 0; color: var(--red-600); font-weight: 800; font-size: 16px; padding: 10px 4px; cursor: pointer; text-decoration: underline; }
.cart-empty { text-align: center; padding: 30px 10px; color: var(--muted); font-size: 18px; }
.cart-summary {
  position: sticky; bottom: 0; margin: 18px calc(-1 * var(--gutter)) 0;
  padding: 14px var(--gutter) calc(16px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 10px;
  background: rgb(255 250 241 / .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgb(11 46 34 / .08);
}
.cart-total-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 20px; font-weight: 800; padding: 0 4px; }
.cart-total-row strong { font-size: 30px; color: var(--red-600); }
.cart-total-row strong.tbd { font-size: 19px; color: var(--muted); }
.cart-note { margin: 0; font-size: 16px; color: var(--muted); }
.cart-note:empty { display: none; }
.cart-help { margin: 0; text-align: center; color: var(--muted); font-size: 15px; }

/* ---------- foto en pantalla completa ---------- */
.lightbox {
  padding: 0; border: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: #040e0a; color: #fff; overflow: hidden;
  opacity: 0; transition: opacity .3s ease;
}
.lightbox.shown { opacity: 1; }
.lightbox::backdrop { background: transparent; }
.lb-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-track.locked { overflow: hidden; }
.lb-slide { flex: 0 0 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: center; overflow: hidden; }
.lb-slide img {
  max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;
  transition: transform .35s var(--ease); touch-action: pan-x;
}
.lb-slide.zoomed img { transform: scale(2.4); cursor: zoom-out; touch-action: none; transition: transform .35s var(--ease), transform-origin 0s; }
.lb-btn {
  position: absolute; z-index: 2; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgb(255 255 255 / .14); color: #fff; font-size: 26px; font-weight: 900; backdrop-filter: blur(6px);
}
.lb-btn:hover { background: rgb(255 255 255 / .26); }
.lb-close { top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 34px; display: none; }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }
@media (hover: hover) { .lightbox.multi .lb-nav { display: block; } }
.lb-count { position: absolute; top: calc(26px + env(safe-area-inset-top, 0px)); left: 18px; font-weight: 800; font-size: 16px; opacity: .85; }
.lb-hint { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--safe-bottom)); margin: 0; text-align: center; font-size: 15px; opacity: .7; pointer-events: none; }

/* ---------- aviso ---------- */
/* Arriba, para no tapar nunca los botones de compra ni la barra del carrito. */
.toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); z-index: 60;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: var(--green-900); color: var(--white); padding: 14px 22px; border-radius: 14px;
  font-weight: 800; font-size: 17px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .3s ease, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast[popover] { inset: auto; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); margin: 0; border: 0; overflow: visible; width: max-content; }

@media (max-width: 380px) {
  body { font-size: 17px; }
  .steps li { font-size: 15px; }
  .card-name { font-size: 20px; }
}

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