/*
  PALETA — ver references/paleta.md de la skill tienda-whatsapp.
  Regla 60-30-10: 60% fondo claro (--bg) · 30% tinta + secundario · 10% primario (botones de acción).
  El acento (complementario del primario) se usa para precios y detalles.
*/
:root {
  /* Paleta: se completa desde tienda.config.json (colores) al ejecutar scripts/build.mjs */
  --bg: #FBF7F2;
  --white: #FFFFFF;
  --primary: #7A4A2A;
  --primary-dark: #5A3520;
  --primary-light: #F3E7DC;
  --secondary: #A8843A;
  --secondary-light: #F5EEDF;
  --accent: #2E5E4E;
  --accent-light: #E2EEE8;
  --ink: #241B15;
  --ink-soft: #6B5B4F;
  --extra: #1F2B3D;
  --gold: #C9A24B;
  --line: color-mix(in srgb, var(--primary) 12%, white);
  --wa: #25D366;
  --wa-dark: #1DA851;

  --radius: 20px;
  --shadow: 0 10px 30px color-mix(in srgb, var(--ink) 8%, transparent);
  --shadow-lg: 0 20px 50px color-mix(in srgb, var(--ink) 18%, transparent);
  --font-script: 'Cormorant Garamond', cursive;
  --font-body: 'Lato', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { font-family: var(--font-body); font-weight: 500; background: var(--bg); color: var(--ink); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--ink-soft); }
.center { text-align: center; margin-top: 2.2rem; }

h1, h2, h3 { line-height: 1.2; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); }
h1 em, h2 em { font-family: var(--font-script); color: var(--primary); font-style: normal; font-size: 1.15em; }
h2 { font-family: var(--font-script); font-size: clamp(2.3rem, 5vw, 3.2rem); color: var(--primary); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--secondary); margin-bottom: .4rem; }
.lead { font-size: 1.1rem; color: var(--ink-soft); margin: 1.1rem 0 1.8rem; max-width: 34rem; }

/* BOTONES */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 700 1rem var(--font-body); padding: .85rem 1.6rem; border-radius: 999px;
  border: 2px solid transparent; cursor: pointer; transition: transform .15s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--sm { padding: .55rem 1.1rem; font-size: .9rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--primary); color: var(--white); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 32%, transparent); }
.btn--primary:hover { background: var(--primary-dark); }
.btn--ghost { background: var(--white); color: var(--secondary); border-color: var(--secondary); }
.btn--ghost:hover { background: var(--secondary); color: var(--white); }
.btn--whatsapp { background: var(--wa); color: var(--white); }
.btn--whatsapp:hover { background: var(--wa-dark); }

/* NAV */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--primary-light); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; }
.brand img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.brand em { font-family: var(--font-script); color: var(--primary); font-style: normal; font-size: 1.35em; }
.nav__links { display: flex; gap: 1.6rem; font-weight: 700; }
.nav__links a:hover { color: var(--primary); }
.nav__actions { display: flex; align-items: center; gap: 1rem; }
.social { display: flex; gap: .4rem; }
.social a {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  color: var(--ink); border: 1px solid var(--line); background: var(--white); transition: all .2s;
}
.social a:hover { color: var(--white); background: var(--primary); border-color: var(--primary); transform: translateY(-2px); }
.social .ic { width: 18px; height: 18px; }
.ic--fill { fill: currentColor; stroke: none; }

/* HERO */
.hero { background: radial-gradient(circle at 80% 20%, var(--secondary-light), transparent 50%), linear-gradient(160deg, var(--bg), var(--primary-light)); padding: 3.5rem 0 5rem; overflow: hidden; }
.hero__inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero__cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero__perks { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.3rem; margin-top: 2rem; font-weight: 700; font-size: .92rem; color: var(--ink-soft); }
.hero__collage { position: relative; height: 520px; }
.hero__collage img { position: absolute; object-fit: cover; border: 6px solid var(--white); box-shadow: var(--shadow-lg); border-radius: var(--radius); }
.hero__main { width: 62%; height: 88%; left: 4%; top: 0; border-radius: 180px 180px var(--radius) var(--radius) !important; }
.hero__side--a { width: 40%; height: 50%; right: 0; top: 6%; transform: rotate(4deg); }
.hero__side--b { width: 40%; height: 46%; right: 8%; bottom: 0; transform: rotate(-3deg); }

/* SECCIONES */
.section { padding: 5rem 0; }
.section--lilac { background: var(--secondary-light); }
.section--mint { background: var(--accent-light); }
.section__head { text-align: center; margin-bottom: 2.4rem; }
.section__head .muted { margin-top: .4rem; }

/* FILTROS */
.catalog-bar { border-bottom: 1px solid var(--line); }
.filters { display: flex; gap: 1.2rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
/* centrado cuando cabe, desplazable cuando no */
.filters > :first-child { margin-left: auto; }
.filters > :last-child { margin-right: auto; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0 1.8rem; font-size: .88rem; color: var(--ink-soft); }
.toolbar strong { color: var(--ink); }
.filters::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: .45rem; white-space: nowrap;
  font: 600 .93rem var(--font-body); color: var(--ink-soft); background: none; border: 0; cursor: pointer;
  padding: 1rem 0 .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink); }
.tab__n { font-size: .72rem; font-weight: 700; min-width: 1.4rem; text-align: center; padding: .1rem .4rem; border-radius: 999px; background: color-mix(in srgb, var(--primary) 8%, white); color: var(--ink-soft); }
.tab.is-active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 700; }
.tab.is-active .tab__n { background: var(--primary); color: var(--white); }

/* PRODUCTOS */
[hidden] { display: none !important; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.card { position: relative; background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 2px 10px color-mix(in srgb, var(--ink) 5%, transparent); display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__img { position: relative; display: block; width: 100%; aspect-ratio: 3/4; overflow: hidden; background: var(--primary-light); border: 0; padding: 0; cursor: pointer; }
/* La foto se ve completa (sin recortes) sobre un fondo difuminado de la misma foto */
.card__img img { position: relative; width: 100%; height: 100%; object-fit: contain; transition: transform .5s; }
.card__img img.card__blur { position: absolute; inset: 0; object-fit: cover; filter: blur(18px) saturate(1.1); opacity: .55; transform: scale(1.15); }
.card:hover .card__img img:not(.card__blur) { transform: scale(1.03); }
.card__photos { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: .3rem; background: color-mix(in srgb, var(--ink) 68%, transparent); color: var(--white); font: 700 .72rem var(--font-body); padding: .28rem .6rem; border-radius: 999px; backdrop-filter: blur(4px); }
.card__photos .ic { width: 13px; height: 13px; }
.badge { position: absolute; z-index: 1; top: 12px; left: 12px; background: var(--secondary); color: var(--white); font-size: .72rem; font-weight: 700; letter-spacing: .02em; padding: .28rem .75rem; border-radius: 999px; box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 18%, transparent); }
.badge--soldout { background: var(--ink); }
.card__body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.card__cat { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--secondary); margin-bottom: .3rem; }
.card__body h3 { font-size: 1.05rem; line-height: 1.3; margin-bottom: .45rem; }
.card__body h3 button { all: unset; cursor: pointer; }
.card__body h3 button:hover { color: var(--primary); }
.card__body h3 button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.card__desc { font-size: .86rem; line-height: 1.5; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: .7rem; }
.card__list { list-style: none; display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; line-height: 1.35; color: var(--ink-soft); margin-bottom: .8rem; }
.card__list li { position: relative; padding-left: 1.05rem; }
.card__list li::before { content: ''; position: absolute; left: 0; top: .42em; width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 55%, white); }
.card__chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; background: var(--primary-light); color: var(--primary-dark); white-space: nowrap; }
.chip .ic { width: 13px; height: 13px; }
.chip--mayor { background: color-mix(in srgb, var(--extra) 10%, white); color: var(--extra); }
.chip--gold { background: color-mix(in srgb, var(--gold) 18%, white); color: color-mix(in srgb, var(--gold) 55%, black); }
.card__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--line); }
.card__price { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.card__price small { font-size: .74rem; font-weight: 700; color: var(--secondary); line-height: 1.3; }
.price { font-weight: 700; font-size: 1.25rem; line-height: 1.1; color: var(--accent); }
.btn--add { flex-shrink: 0; padding: .55rem .95rem; }
.btn--add .ic { width: 16px; height: 16px; }
.card.is-soldout .card__img img:not(.card__blur) { filter: grayscale(.6); opacity: .75; }
.card.is-soldout .price { color: var(--ink-soft); }
@media (max-width: 560px) {
  /* En celular: 2 columnas compactas; el detalle completo está en la ficha */
  .grid { grid-template-columns: 1fr 1fr; gap: .8rem; }
  .card__body { padding: .8rem .8rem .9rem; }
  .card__cat { font-size: .6rem; letter-spacing: .08em; }
  .card__body h3 { font-size: .9rem; margin-bottom: .4rem; }
  .card__desc, .card__list { display: none; }
  .card__chips { margin-bottom: .5rem; }
  .chip { font-size: .64rem; padding: .2rem .5rem; }
  .card__foot { flex-direction: column; align-items: stretch; padding-top: .6rem; }
  .price { font-size: 1.08rem; }
  .card__price small { font-size: .66rem; }
  .card__foot .btn { width: 100%; padding: .5rem; font-size: .82rem; white-space: nowrap; }
  .sort > span { display: none; }
  .badge { top: 8px; left: 8px; font-size: .62rem; padding: .2rem .55rem; }
}

/* PERSONALIZA */
.custom-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.custom {
  flex: 0 1 172px; background: var(--white); border: 1px solid color-mix(in srgb, var(--secondary) 10%, transparent); border-radius: 18px;
  padding: 1.4rem 1rem 1.2rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .15rem;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 4%, transparent); transition: transform .2s, box-shadow .2s;
}
.custom:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.custom .tile { width: 54px; height: 54px; border-radius: 16px; margin-bottom: .7rem; background: var(--tile-bg); color: var(--tile-fg); transition: transform .2s; }
.custom:hover .tile { transform: scale(1.06) rotate(-4deg); }
.custom .tile .ic { width: 26px; height: 26px; stroke-width: 1.7; }
.custom strong { font-size: .95rem; }
.custom small { font-weight: 500; color: var(--ink-soft); font-size: .8rem; }
.c-1 { --tile-bg: var(--primary-light); --tile-fg: var(--primary-dark); }
.c-2 { --tile-bg: var(--secondary-light); --tile-fg: var(--secondary); }
.c-3 { --tile-bg: var(--accent-light); --tile-fg: var(--accent); }
.c-4 { --tile-bg: color-mix(in srgb, var(--extra) 16%, white); --tile-fg: var(--extra); }
.c-5 { --tile-bg: color-mix(in srgb, var(--gold) 20%, white); --tile-fg: color-mix(in srgb, var(--gold) 80%, black); }
.btn .ic { width: 18px; height: 18px; }

/* PROCESO */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.3rem; }
.step { background: var(--white); border: 2px solid var(--primary-light); border-radius: var(--radius); padding: 1.8rem 1.4rem; text-align: center; }
.step__n { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: var(--white); font-weight: 700; font-size: 1.2rem; margin-bottom: .9rem; }
.step h3 { margin-bottom: .5rem; font-size: 1.1rem; }
.step p { color: var(--ink-soft); font-size: .93rem; }
.step strong { color: var(--primary-dark); }
/* ICONOS */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.tile { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--primary-light); color: var(--primary-dark); flex-shrink: 0; }
.tile .ic { width: 22px; height: 22px; }
.tile--sm { width: 40px; height: 40px; border-radius: 12px; background: var(--secondary-light); color: var(--secondary); }
.tile--sm .ic { width: 19px; height: 19px; }

.notice {
  display: flex; align-items: center; gap: .7rem; width: fit-content; max-width: 100%; margin: 1.8rem auto 0;
  padding: .8rem 1.2rem; border-radius: 12px; background: var(--white); border: 1px solid var(--primary-light);
  border-left: 4px solid var(--primary); color: var(--ink-soft); font-size: .95rem;
}
.notice .ic { color: var(--primary); }
.notice strong { color: var(--ink); }

/* PANELES (pago, envíos, contacto) */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 4%, transparent); display: flex; flex-direction: column; }
.panel__head { display: flex; align-items: center; gap: 1rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.panel__head h3 { font-size: 1.15rem; }
.panel__head p { color: var(--ink-soft); font-size: .9rem; }
.list { list-style: none; display: flex; flex-direction: column; flex: 1; }
.list li { display: flex; align-items: center; gap: .9rem; padding: .95rem 0; border-bottom: 1px dashed var(--line); }
.list li:last-child { border-bottom: 0; }
.list strong { display: block; font-size: .98rem; }
.list small { display: block; color: var(--ink-soft); font-size: .86rem; }
.panel__foot { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: .6rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .86rem; color: var(--ink-soft); }
.panel__foot b { color: var(--primary-dark); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 2.6rem; }
.sort { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; font-size: .85rem; color: var(--ink-soft); }
.sort select {
  font: 600 .88rem var(--font-body); color: var(--ink); cursor: pointer;
  padding: .45rem 2rem .45rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--white);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2376566F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center;
}
.sort select:focus { outline: none; border-color: var(--primary); }
/* CONTACTO */
.section--soft { background: linear-gradient(180deg, var(--bg), var(--primary-light)); }
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.4rem; align-items: stretch; }
.contact__card { gap: 1rem; }
.list--contact small { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--secondary); }
.list--contact a, .list--contact .val { display: block; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.list--contact a:hover { color: var(--primary); }
.list--contact .sub { display: block; font-size: .86rem; color: var(--ink-soft); }
.status { font-style: normal; font-size: .75rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; margin-left: .35rem; white-space: nowrap; }
.status.is-open { background: var(--accent-light); color: var(--accent); }
.status.is-closed { background: var(--primary-light); color: var(--primary-dark); }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); min-height: 380px; background: var(--white); }
.map iframe { width: 100%; height: 100%; min-height: 380px; border: 0; display: block; }

/* FOOTER */
.footer { background: var(--ink); color: var(--primary-light); padding: 2.3rem 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.brand--light { color: var(--white); }

form { display: flex; flex-direction: column; gap: .95rem; }
form label, legend { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; font-size: .88rem; }
.row > label { flex: 1; }
.row > label.grow { flex: 2; }
legend { display: block; margin-bottom: .4rem; }
fieldset { border: 0; }
.opt { font-weight: 500; color: var(--ink-soft); }
form .row { display: flex; gap: .8rem; }
input[type=text], input[type=date], input[type=number], textarea, select { font: 500 1rem var(--font-body); color: var(--ink); padding: .68rem .9rem; border-radius: 12px; border: 1.5px solid var(--primary-light); background: var(--white); width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14.000000000000002%, transparent); }

.checks, .radios { display: flex; flex-wrap: wrap; gap: .45rem; }
.checks label, .radio { flex-direction: row; font-weight: 600; cursor: pointer; }
.checks input, .radio input { position: absolute; opacity: 0; pointer-events: none; }
.checks span, .radio span { padding: .4rem .85rem; border-radius: 999px; border: 1.5px solid var(--primary-light); background: var(--white); font-size: .86rem; transition: all .15s; }
.checks input:checked + span { background: var(--secondary); border-color: var(--secondary); color: var(--white); }
.radio input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--white); }
.checks input:focus-visible + span, .radio input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
[data-delivery][hidden] { display: none; }

.hint { background: var(--secondary-light); color: var(--secondary); border-radius: 12px; padding: .65rem .9rem; font-size: .86rem; font-weight: 700; }
.preview { background: #E7FFDB; border-radius: 14px 14px 14px 4px; padding: .9rem 1rem; box-shadow: var(--shadow); }
.preview__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; margin-bottom: .4rem; }
#msgPreview { font-size: .9rem; line-height: 1.5; white-space: pre-wrap; color: #111; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; font-weight: 700; }
.total strong { color: var(--primary); font-size: 1.5rem; }
.form__error { color: var(--primary-dark); font-weight: 700; font-size: .9rem; }

/* RESPONSIVE */
@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .nav__links { display: none; }
}
@media (max-width: 820px) {
  .info-grid, .contact { grid-template-columns: 1fr; }
  .map, .map iframe { min-height: 300px; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__collage { height: 420px; max-width: 460px; width: 100%; margin-inline: auto; order: -1; }
}
@media (max-width: 520px) {
  .nav__actions { gap: .6rem; }
  .social a { width: 34px; height: 34px; }
  .custom { flex-basis: calc(50% - .5rem); }
  .steps { grid-template-columns: 1fr; }
  form .row { flex-direction: column; }
  .hero__collage { height: 340px; }
  .brand > span { display: none; }
  .footer__inner { flex-direction: column; text-align: center; }
}

/* Viñetas de los beneficios de la portada (sin emojis) */
.hero__perks li { display: flex; align-items: center; gap: .5rem; }
.hero__perks li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }

/* Galería de grabados (sección Personaliza) */
.engrave { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 1rem; margin: 2rem 0 1.5rem; align-items: stretch; }
.engrave figure { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--white); border: 1px solid var(--line); min-height: 260px; }
.engrave img { width: 100%; height: 100%; object-fit: cover; display: block; }
.engrave figcaption { position: absolute; left: .8rem; bottom: .8rem; background: color-mix(in srgb, var(--white) 92%, transparent); padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.engrave__info h3 { margin: 0 0 .6rem; }
@media (max-width: 820px) {
  .engrave { grid-template-columns: 1fr 1fr; }
  .engrave__info { grid-column: 1 / -1; }
  .engrave figure { min-height: 200px; }
}

/* Visor de fotos */
.viewer { position: fixed; inset: 0; z-index: 110; display: none; align-items: center; justify-content: center; padding: 16px; }
.viewer.is-open { display: flex; }
.viewer__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 82%, transparent); backdrop-filter: blur(4px); }
.viewer__panel { position: relative; display: flex; flex-direction: column; gap: .8rem; width: min(760px, 100%); max-height: 100%; animation: pop .25s ease-out; }
.viewer__stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; }
.viewer__stage img { max-width: 100%; max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px); object-fit: contain; border-radius: 14px; box-shadow: var(--shadow-lg); background: var(--white); }
.viewer__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--white) 90%, transparent); color: var(--ink); font-size: 1.8rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.viewer__nav--prev { left: 8px; }
.viewer__nav--next { right: 8px; }
.viewer__nav[hidden] { display: none; }
.viewer__close { position: absolute; top: -6px; right: -6px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--white); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.viewer__foot { display: flex; align-items: center; justify-content: space-between; gap: .8rem; color: var(--white); }
.viewer__foot span { color: color-mix(in srgb, var(--white) 70%, transparent); font-size: .85rem; margin-left: .4rem; }

/* Sección por mayor */
.section--dark { background: var(--extra); color: var(--white); }
.section--dark .eyebrow { color: var(--gold); }
.wholesale { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.wholesale__text h2 { margin-bottom: .8rem; color: var(--white); }
.wholesale__text p { color: color-mix(in srgb, var(--white) 80%, transparent); }
.wholesale__perks { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.3rem; margin: 1.4rem 0 1.8rem; font-weight: 700; font-size: .92rem; }
.wholesale__perks li { display: flex; align-items: center; gap: .5rem; }
.wholesale__perks li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.btn--gold { background: var(--gold); color: var(--extra); }
.btn--gold:hover { background: color-mix(in srgb, var(--gold) 85%, white); }
.wholesale__list { list-style: none; display: flex; flex-direction: column; gap: .8rem; }
.wholesale__list li { display: flex; align-items: center; gap: 1rem; background: color-mix(in srgb, var(--white) 7%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); border-radius: 16px; padding: .7rem; }
.wholesale__list img { width: 64px; height: 64px; object-fit: cover; object-position: center 72%; border-radius: 12px; flex-shrink: 0; }
.wholesale__list strong { display: block; }
.wholesale__list small { display: block; color: var(--gold); font-weight: 700; font-size: .92rem; }
.wholesale__list s { color: color-mix(in srgb, var(--white) 50%, transparent); font-weight: 500; margin-left: .3rem; }
@media (max-width: 820px) {
  .wholesale { grid-template-columns: 1fr; gap: 2rem; }
}

/* Ventanas: base común */
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
.x-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.x-btn:hover { background: var(--primary-light); }
.opt { font-weight: 500; color: var(--ink-soft); font-size: .82rem; }
textarea { resize: vertical; min-height: 2.8rem; line-height: 1.45; }

/* Botón del carrito en el menú */
.cart-btn { position: relative; display: inline-flex; align-items: center; gap: .45rem; font: 700 .9rem var(--font-body); color: var(--white); background: var(--primary); border: 0; border-radius: 999px; padding: .6rem 1.05rem; cursor: pointer; box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 30%, transparent); transition: transform .15s, background .2s; }
.cart-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.cart-btn .ic { width: 18px; height: 18px; }
.cart-btn__n { display: none; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px; background: var(--gold); color: var(--extra); font-size: .74rem; place-items: center; }
.cart-btn.has-items .cart-btn__n { display: inline-grid; }
@keyframes bump { 50% { transform: scale(1.35); } }
.cart-btn.has-items .cart-btn__n { animation: bump .35s; }

/* Barra flotante del carrito */
.cartbar { position: fixed; z-index: 60; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: .7rem; width: min(420px, calc(100% - 32px)); padding: .8rem 1.1rem; border: 0; border-radius: 999px; background: var(--ink); color: var(--white); font: 600 .92rem var(--font-body); cursor: pointer; box-shadow: var(--shadow-lg); animation: pop .3s ease-out; }
.cartbar span { flex: 1; text-align: left; }
.cartbar strong { color: var(--gold); }
@media (min-width: 961px) { .cartbar { display: none; } }
body:has(.sheet.is-open, .drawer.is-open, .viewer.is-open) .cartbar { display: none; }

/* Aviso "agregado al carrito" */
.toast { position: fixed; z-index: 130; left: 50%; top: 84px; transform: translate(-50%, -12px); display: flex; align-items: center; gap: .7rem; width: max-content; max-width: calc(100% - 32px); padding: .75rem .8rem .75rem 1rem; border-radius: 16px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast > .ic { color: var(--accent); background: var(--accent-light); border-radius: 50%; padding: 4px; width: 26px; height: 26px; }
.toast button { border: 0; background: var(--primary-light); color: var(--primary-dark); font: 700 .82rem var(--font-body); padding: .45rem .8rem; border-radius: 999px; cursor: pointer; white-space: nowrap; }

/* FICHA DE PRODUCTO */
.sheet { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; }
.sheet.is-open { display: flex; }
.sheet__backdrop, .drawer__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(3px); animation: fade .2s; }
.sheet__panel { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr); width: min(940px, 100%); max-height: min(92vh, 760px); background: var(--bg); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); animation: pop .25s ease-out; }
.sheet__close { position: absolute; z-index: 3; top: 14px; right: 14px; }
.sheet__media { background: var(--primary-light); display: flex; flex-direction: column; min-height: 0; }
.sheet__main { flex: 1; min-height: 0; border: 0; padding: 0; background: none; cursor: zoom-in; display: block; }
.sheet__main img { width: 100%; height: 100%; object-fit: contain; }
.sheet__thumbs { display: flex; gap: .5rem; padding: .7rem; background: var(--white); border-top: 1px solid var(--line); }
.sheet__thumbs:empty { display: none; }
.sheet__thumbs button { width: 58px; height: 58px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: none; opacity: .65; transition: all .15s; }
.sheet__thumbs button.is-active { border-color: var(--primary); opacity: 1; }
.sheet__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.sheet__body { overflow-y: auto; padding: 2rem 1.8rem 0; gap: 0; display: flex; flex-direction: column; }
.sheet__body h2 { font-family: var(--font-body); font-size: 1.5rem; line-height: 1.25; color: var(--ink); padding-right: 2.5rem; margin-bottom: .6rem; }
.sheet__price { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.sheet__price .price { font-size: 1.6rem; }
.sheet__desc { font-size: .93rem; line-height: 1.6; color: var(--ink-soft); margin-bottom: .8rem; }
.sheet__list { margin-bottom: 1.2rem; }
.sheet__body > fieldset, .sheet__note, .mayor-meter { margin-bottom: 1rem; }
.opts legend { margin-bottom: .5rem; }
.sheet__note { display: flex; flex-direction: column; gap: .35rem; font-weight: 700; font-size: .88rem; }

/* Caja de grabado: interruptor + panel que se despliega */
.engrave-box { border: 1.5px solid var(--line) !important; border-radius: 18px; background: var(--white); padding: .95rem 1rem; transition: border-color .2s, background .2s, box-shadow .2s; }
.engrave-box.is-on { border-color: color-mix(in srgb, var(--gold) 65%, white) !important; background: color-mix(in srgb, var(--gold) 6%, white); box-shadow: 0 6px 20px color-mix(in srgb, var(--gold) 16%, transparent); }
.switch { display: flex !important; flex-direction: row !important; align-items: center; gap: .85rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__ui { position: relative; width: 46px; height: 27px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 18%, white); flex-shrink: 0; transition: background .2s; }
.switch__ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 4px color-mix(in srgb, var(--ink) 30%, transparent); transition: transform .2s; }
.switch input:checked + .switch__ui { background: var(--gold); }
.switch input:checked + .switch__ui::after { transform: translateX(19px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch__text strong { display: block; font-size: .95rem; }
.switch__text small { display: block; font-weight: 600; font-size: .8rem; color: var(--ink-soft); }
.engrave-box__reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.engrave-box__reveal.is-open { grid-template-rows: 1fr; }
.engrave-box__inner { overflow: hidden; display: flex; flex-direction: column; gap: .8rem; }
.engrave-box__reveal.is-open .engrave-box__inner { padding-top: 1rem; margin-top: .9rem; border-top: 1px dashed color-mix(in srgb, var(--gold) 45%, white); }
.engrave-box__q { font-weight: 700; font-size: .88rem; }
.engrave-box__inner label { display: flex; flex-direction: column; gap: .35rem; font-weight: 700; font-size: .88rem; }
.checks--icons span { display: inline-flex; align-items: center; gap: .35rem; }
.checks--icons .ic { width: 15px; height: 15px; }
.checks--icons input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--extra); }
.engrave-box__file { display: flex; gap: .6rem; align-items: flex-start; font-size: .84rem; line-height: 1.45; color: var(--primary-dark); background: var(--primary-light); border-radius: 12px; padding: .65rem .8rem; }
.engrave-box__file .ic { width: 17px; height: 17px; margin-top: .1rem; }

/* Medidor de precio por mayor */
.mayor-meter { background: var(--secondary-light); border-radius: 14px; padding: .75rem .9rem; font-size: .86rem; line-height: 1.4; color: var(--primary-dark); }
.mayor-meter p { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.mayor-meter .ic { width: 16px; height: 16px; color: var(--accent); }
.mayor-meter__bar { display: block; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--secondary) 20%, white); margin-top: .55rem; overflow: hidden; }
.mayor-meter__bar span { display: block; height: 100%; border-radius: inherit; background: var(--secondary); transition: width .3s; }
.mayor-meter.is-done { background: var(--accent-light); color: var(--accent); }
.mayor-meter.is-done .mayor-meter__bar span { background: var(--accent); }

/* Cantidad + agregar (fijo abajo de la ficha) */
.sheet__buy { position: sticky; bottom: 0; display: flex; gap: .7rem; margin: auto -1.8rem 0; padding: 1rem 1.8rem 1.3rem; background: linear-gradient(to top, var(--bg) 75%, color-mix(in srgb, var(--bg) 0%, transparent)); }
.sheet__add { flex: 1; white-space: nowrap; padding-inline: 1rem; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); overflow: hidden; flex-shrink: 0; }
.qty button { width: 40px; height: 46px; border: 0; background: none; font-size: 1.3rem; color: var(--primary-dark); cursor: pointer; }
.qty button:hover { background: var(--primary-light); }
.qty input { width: 42px; border: 0 !important; box-shadow: none !important; padding: 0 !important; text-align: center; font-weight: 700; background: none; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty--sm button { width: 30px; height: 32px; font-size: 1.05rem; }
.qty--sm span { min-width: 1.6rem; text-align: center; font-weight: 700; font-size: .9rem; }

/* CARRITO (panel lateral) */
.drawer { position: fixed; inset: 0; z-index: 105; display: none; }
.drawer.is-open { display: block; }
@keyframes slide { from { transform: translateX(100%); } }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(440px, 100%); background: var(--bg); box-shadow: var(--shadow-lg); animation: slide .3s cubic-bezier(.2, .8, .2, 1); }
.drawer__head { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); }
.drawer__head h2 { flex: 1; font-family: var(--font-body); font-size: 1.2rem; color: var(--ink); }
.drawer__steps { list-style: none; display: flex; gap: 1.2rem; padding: .75rem 1.3rem; font-size: .8rem; font-weight: 700; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.drawer__steps li { display: flex; align-items: center; gap: .4rem; }
.drawer__steps span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-light); font-size: .72rem; }
.drawer__steps li.is-active { color: var(--primary-dark); }
.drawer__steps li.is-active span { background: var(--primary); color: var(--white); }
.drawer__body { flex: 1; overflow-y: auto; padding: 1.1rem 1.3rem; }
.drawer__foot { padding: 1rem 1.3rem 1.2rem; border-top: 1px solid var(--line); background: var(--white); display: flex; flex-direction: column; gap: .8rem; }
.drawer__foot .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.lines { list-style: none; display: flex; flex-direction: column; gap: .8rem; }
.line { position: relative; display: flex; gap: .85rem; padding: .8rem; background: var(--white); border: 1px solid var(--line); border-radius: 16px; animation: pop .25s ease-out; }
.line > img { width: 72px; height: 88px; object-fit: cover; border-radius: 12px; flex-shrink: 0; background: var(--primary-light); }
.line__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.line__info > strong { font-size: .92rem; line-height: 1.3; padding-right: 1.8rem; }
.line__info > small { font-size: .78rem; line-height: 1.4; color: var(--ink-soft); overflow-wrap: anywhere; }
.line__engrave { display: flex; gap: .3rem; align-items: flex-start; color: color-mix(in srgb, var(--gold) 55%, black) !important; font-weight: 600; }
.line__engrave .ic { width: 13px; height: 13px; margin-top: .15rem; }
.line__row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .4rem; }
.line__price { font-weight: 700; color: var(--accent); text-align: right; }
.line__price small { display: block; font-size: .7rem; color: var(--secondary); }
.line__remove { position: absolute; top: .6rem; right: .6rem; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; color: var(--ink-soft); cursor: pointer; }
.line__remove:hover { background: var(--primary-light); color: var(--primary-dark); }
.line__remove .ic { width: 16px; height: 16px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; padding: 2.5rem 1rem; color: var(--ink-soft); font-size: .9rem; }
.cart-empty strong { color: var(--ink); font-size: 1.05rem; }
.cart-empty .btn { margin-top: .5rem; }

.sum { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; color: var(--ink-soft); }
.sum > div { display: flex; justify-content: space-between; gap: 1rem; }
.sum dd { font-weight: 600; }
.sum__save { color: var(--accent); }
.sum__total { margin-top: .3rem; padding-top: .55rem; border-top: 1px dashed var(--line); color: var(--ink); font-weight: 700; font-size: 1rem; align-items: baseline; }
.sum__total dd { font-size: 1.4rem; color: var(--primary); }

#checkoutForm { gap: 1rem; }
.preview summary { cursor: pointer; list-style: none; margin: 0; }
.preview summary::-webkit-details-marker { display: none; }
.preview summary::after { content: ' ▾'; }
.preview[open] summary { margin-bottom: .5rem; }

/* Sección por mayor: la lista abre la ficha */
.wholesale__list button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 1rem; width: 100%; cursor: pointer; }
.wholesale__list li { transition: background .2s, transform .2s; }
.wholesale__list li:hover { background: color-mix(in srgb, var(--white) 12%, transparent); transform: translateX(4px); }

@media (max-width: 760px) {
  .sheet { padding: 0; align-items: flex-end; }
  @keyframes rise { from { transform: translateY(100%); } }
  .sheet__panel { grid-template-columns: 1fr; grid-template-rows: auto; width: 100%; max-height: 94vh; max-height: 94dvh; border-radius: 22px 22px 0 0; overflow-y: auto; animation: rise .3s cubic-bezier(.2, .8, .2, 1); }
  .sheet__main { aspect-ratio: 1; }
  .sheet__body { overflow: visible; padding: 1.3rem 1.1rem 0; }
  .sheet__body h2 { font-size: 1.3rem; padding-right: 0; }
  .sheet__buy { margin: auto -1.1rem 0; padding: .9rem 1.1rem calc(1rem + env(safe-area-inset-bottom)); }
  .drawer__panel { width: 100%; }
}
@media (max-width: 520px) {
  .cart-btn__label { display: none; }
  .cart-btn { padding: .6rem .8rem; }
}

/* Campos de grabado: uno por cada cosa elegida + chips bloqueados al llegar al máximo */
.engrave-box__fields { display: flex; flex-direction: column; gap: .7rem; }
.engrave-box__fields:empty { display: none; }
.engrave-box__fields label { display: flex; flex-direction: column; gap: .35rem; }
.engrave-box__fields label > .ic { display: none; }
.engrave-box__fields label { animation: pop .2s ease-out; }
.checks label.is-locked { cursor: not-allowed; }
.checks label.is-locked span { opacity: .4; }
