/*
  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 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.6rem; }
.card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__img { position: relative; aspect-ratio: 4/5; overflow: hidden; background: var(--primary-light); }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card__img img { transform: scale(1.05); }
.badge { position: absolute; top: 12px; left: 12px; background: var(--secondary); color: var(--white); font-size: .75rem; font-weight: 700; padding: .25rem .75rem; border-radius: 999px; }
.card__body { padding: 1.1rem 1.25rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card__body h3 { font-size: 1.08rem; }
.card__desc { font-size: .9rem; color: var(--ink-soft); white-space: pre-line; }
.badge--soldout { background: var(--ink); }
.card.is-soldout .card__img img { filter: grayscale(.6); opacity: .75; }
.card.is-soldout .price { color: var(--ink-soft); }
.card__body ul { list-style: none; font-size: .88rem; color: var(--ink-soft); flex: 1; }
.card__body li::before { content: '♥ '; color: var(--primary); font-size: .75em; }
.card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: .6rem; gap: .5rem; }
.price { font-weight: 700; font-size: 1.3rem; color: var(--accent); }

/* 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); }

/* MODAL */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.is-open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 55.00000000000001%, transparent); backdrop-filter: blur(3px); }
.modal__panel { position: relative; background: var(--bg); width: min(560px, 100%); max-height: 92vh; overflow-y: auto; border-radius: 24px; padding: 2rem 1.7rem; box-shadow: var(--shadow-lg); animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal__close { position: absolute; top: 10px; right: 16px; background: none; border: 0; font-size: 2rem; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.modal h2 { font-size: 2.2rem; margin-bottom: 1rem; }

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], 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, 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; }
}
