/* =========================================================
   Moizlicious — Repostería Artesanal · San Miguel, Santiago
   Sitio web por OrbexStudio · San Miguel
   Vanilla HTML/CSS/JS — sin Bootstrap ni jQuery
   ========================================================= */

:root {
  /* Paleta */
  --navy:        #2C5F8A;
  --navy-deep:   #1F4666;
  --navy-ink:    #17324a;
  --cream:       #FDFAF5;
  --cream-2:     #F6EFE4;
  --blue-soft:   #EAF1F8;
  --blue-tint:   #DCE8F2;
  --gold:        #C9A55C;
  --gold-soft:   #E4CE9E;
  --ink:         #2B2B2B;
  --muted:       #6B7280;
  --white:       #FFFFFF;
  --wa:          #25D366;
  --wa-dark:     #1DA851;

  --shadow-sm: 0 2px 10px rgba(31, 70, 102, .06);
  --shadow-md: 0 12px 32px rgba(31, 70, 102, .10);
  --shadow-lg: 0 24px 60px rgba(31, 70, 102, .14);

  --radius:     18px;
  --radius-sm:  12px;
  --radius-pill: 999px;

  --container: 1140px;
  --ff-title: "Playfair Display", Georgia, "Times New Roman", serif;
  --ff-body:  "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--ff-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  font-size: 17px;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

h1, h2, h3, h4 { font-family: var(--ff-title); font-weight: 600; line-height: 1.15; color: var(--navy-ink); }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.5rem); letter-spacing: -.5px; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.28rem; }

p { color: #40464e; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 22px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--navy);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 26px;
  font-family: var(--ff-body);
  font-size: .98rem;
  font-weight: 700;
  letter-spacing: .2px;
  border-radius: var(--radius-pill);
  border: 0;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-fg);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.btn--primary { --btn-bg: var(--navy); }
.btn--primary:hover { background: var(--navy-deep); }

.btn--wa { --btn-bg: var(--wa); --btn-fg: #06381c; }
.btn--wa:hover { background: var(--wa-dark); --btn-fg: #fff; }

.btn--sm  { padding: 10px 18px; font-size: .9rem; }
.btn--lg  { padding: 17px 30px; font-size: 1.05rem; }
.btn--block { width: 100%; }

.ico-wa { width: 20px; height: 20px; fill: currentColor; flex: none; }
.ico { width: 18px; height: 18px; fill: currentColor; flex: none; }

.eyebrow {
  font-family: var(--ff-body);
  text-transform: uppercase;
  letter-spacing: 2.4px;
  font-size: .74rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
}

/* =========================================================
   1. ANNOUNCEMENT BAR
   ========================================================= */
.announcement {
  background: var(--navy-deep);
  color: #EAF2FA;
  text-align: center;
  font-size: .86rem;
  letter-spacing: .3px;
  padding: 9px 16px;
}
.announcement p { color: inherit; margin: 0; }

/* =========================================================
   2. NAV
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 250, 245, .88);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(44, 95, 138, .10);
}
.nav.is-scrolled { box-shadow: var(--shadow-sm); }

.nav__inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }

.brand {
  font-family: var(--ff-title);
  font-weight: 700;
  font-size: 1.55rem;
  color: var(--navy-ink);
  letter-spacing: .3px;
}
.brand__accent { color: var(--navy); font-style: italic; }
.brand--light { color: #fff; }
.brand--light .brand__accent { color: var(--gold-soft); }

.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links > a {
  font-size: .96rem;
  font-weight: 500;
  color: var(--navy-ink);
  position: relative;
  padding: 6px 0;
}
.nav__links > a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--gold);
  transition: width .22s ease;
}
.nav__links > a:not(.btn):hover::after { width: 100%; }
.nav__wa { color: #06381c; }

.nav__toggle {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer;
  padding: 8px;
}
.nav__toggle span {
  width: 24px; height: 2px; background: var(--navy-ink); border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   3. HERO
   ========================================================= */
.hero {
  position: relative;
  background:
    radial-gradient(60% 55% at 82% 12%, rgba(44,95,138,.08), transparent 70%),
    radial-gradient(50% 50% at 10% 88%, rgba(201,165,92,.10), transparent 70%),
    var(--cream);
  overflow: hidden;
  padding: clamp(48px, 8vw, 92px) 0 clamp(56px, 9vw, 104px);
}

.hero__grid {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero__sub { font-size: 1.12rem; color: #4b525b; max-width: 34ch; margin-top: 18px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero__trust { margin-top: 26px; }
.hero__trust li { font-size: .9rem; color: var(--muted); letter-spacing: .3px; }
.hero__stars { color: var(--gold); letter-spacing: 1px; }

/* Collage hero: 3 fotos reales reemplazando el placeholder, mismo espacio 3:2 */
.hero__collage {
  position: relative;
  aspect-ratio: 3 / 2;
  width: 100%;
  background: linear-gradient(135deg, var(--blue-soft), var(--cream) 60%, var(--cream-2));
  border-radius: var(--radius);
}
.hero__collage-img {
  position: absolute;
  width: 68%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  border: 5px solid var(--white);
  box-shadow: var(--shadow-lg);
}
.hero__collage-img--torta {
  top: 11.5%;
  left: 0;
  z-index: 1;
}
.hero__collage-img--alfajor {
  width: 36%;
  top: 0;
  right: 0;
  z-index: 2;
  transform: rotate(2.5deg);
}
.hero__collage-img--pie {
  width: 36%;
  bottom: 0;
  right: 0;
  z-index: 2;
  transform: rotate(-2.5deg);
}

/* Decoración sutil */
.deco { position: absolute; z-index: 1; pointer-events: none; }
.deco--circle { border-radius: 50%; }
.deco--1 { width: 220px; height: 220px; background: radial-gradient(circle at 30% 30%, #fff, var(--blue-soft)); top: -60px; right: -40px; opacity: .7; }
.deco--2 { width: 130px; height: 130px; background: radial-gradient(circle at 30% 30%, var(--gold-soft), transparent 70%); bottom: 40px; right: 46%; opacity: .5; }
.deco--3 {
  width: 180px; height: 120px; left: -30px; top: 40px; opacity: .5;
  background-image: radial-gradient(var(--navy) 1.6px, transparent 1.7px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}
.deco--4 { width: 90px; height: 90px; border: 8px solid var(--blue-tint); border-radius: 50%; bottom: -20px; left: 42%; opacity: .8; }

/* =========================================================
   Placeholders de imagen (fondos suaves crema / azul claro)
   ========================================================= */
.img-ph {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  text-align: center;
  background:
    linear-gradient(135deg, var(--blue-soft), var(--cream) 60%, var(--cream-2));
  border: 1px dashed rgba(44, 95, 138, .28);
  border-radius: var(--radius);
  color: var(--navy);
  overflow: hidden;
}
.img-ph::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(44,95,138,.06) 1px, transparent 1.6px);
  background-size: 16px 16px;
  opacity: .6;
}
.img-ph__icon { font-size: 2.4rem; filter: grayscale(.1); position: relative; z-index: 1; }
.img-ph__note {
  position: relative; z-index: 1;
  font-family: var(--ff-body);
  font-size: .78rem;
  font-weight: 500;
  color: var(--navy-deep);
  max-width: 82%;
  line-height: 1.45;
  letter-spacing: .2px;
}

.img-ph--hero { aspect-ratio: 3 / 2; width: 100%; box-shadow: var(--shadow-lg); border-style: solid; border-color: rgba(44,95,138,.12); }
.img-ph--hero .img-ph__icon { font-size: 3.4rem; }
.img-ph--card { aspect-ratio: 4 / 3; border-radius: 0; border: 0; border-bottom: 1px dashed rgba(44,95,138,.22); }
.img-ph--sq { aspect-ratio: 1 / 1; background: linear-gradient(135deg, var(--blue-tint), var(--blue-soft) 70%); }

/* Fotos reales de producto */
.card__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
  min-height: 0;
}
.gallery__img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
}

/* =========================================================
   Secciones genéricas
   ========================================================= */
.section { padding: clamp(56px, 9vw, 100px) 0; }
.section--tint { background: linear-gradient(180deg, #FCFDFE, #F1F6FB); }

.section__head { text-align: center; max-width: 640px; margin: 0 auto clamp(34px, 5vw, 56px); }
.section__lead { color: var(--muted); margin-top: 10px; }

/* =========================================================
   4. PRODUCTOS ESTRELLA
   ========================================================= */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(44, 95, 138, .08);
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.card__body { padding: 24px 22px 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card__body h3 { color: var(--navy-ink); }
.card__body p { font-size: .96rem; color: #545b64; flex: 1; }
.card__body .btn { margin-top: 6px; }

/* =========================================================
   5. ¿POR QUÉ MOIZLICIOUS?
   ========================================================= */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.feature {
  background: #fff;
  border-radius: var(--radius);
  padding: 34px 26px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(44, 95, 138, .08);
}
.feature__ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-soft), var(--blue-tint));
  margin-bottom: 16px;
}
.feature__ico svg { width: 30px; height: 30px; fill: var(--navy); }
.feature h3 { margin-bottom: 8px; }
.feature p { font-size: .95rem; color: #545b64; }

/* =========================================================
   6. GALERÍA
   ========================================================= */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.gallery .img-ph { border-color: rgba(44, 95, 138, .18); }
.gallery__note { text-align: center; margin-top: 26px; color: var(--muted); font-size: .95rem; }
.gallery__note a { color: var(--navy); font-weight: 700; }
.gallery__note a:hover { text-decoration: underline; }

/* =========================================================
   7. ¿CÓMO PEDIR?
   ========================================================= */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 40px 26px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(44, 95, 138, .08);
}
.step__num {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: var(--ff-title);
  font-size: 1.35rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(44, 95, 138, .3);
  border: 4px solid var(--cream);
}
.section--tint .step__num { border-color: #fff; }
.step h3 { margin-bottom: 8px; }
.step p { font-size: .95rem; color: #545b64; }

/* =========================================================
   8. FORMULARIO DE CONTACTO / PEDIDO
   ========================================================= */
.contact {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}
.contact__intro { padding-top: 6px; }
.contact__intro h2 { margin: 6px 0 14px; }
.contact__intro p { color: #4b525b; margin-bottom: 22px; }

.contact__meta { margin-top: 26px; display: grid; gap: 10px; }
.contact__meta li { display: flex; align-items: center; gap: 10px; font-size: .94rem; color: #4b525b; }
.contact__meta a { color: var(--navy); font-weight: 600; }
.contact__meta a:hover { text-decoration: underline; }

.form {
  background: #fff;
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(44, 95, 138, .08);
  display: grid;
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; font-weight: 700; color: var(--navy-ink); letter-spacing: .2px; }
.field input,
.field select,
.field textarea {
  font-family: var(--ff-body);
  font-size: 1rem;
  color: var(--ink);
  padding: 12px 14px;
  border: 1.5px solid rgba(44, 95, 138, .22);
  border-radius: var(--radius-sm);
  background: #FCFDFE;
  transition: border-color .16s ease, box-shadow .16s ease;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(44, 95, 138, .12);
}
.field input:invalid:not(:placeholder-shown),
.field select:invalid { border-color: #d98c8c; }

.form__hint { font-size: .85rem; color: var(--muted); text-align: center; min-height: 1.2em; }
.form__hint.is-error { color: #c0392b; }
.form__hint.is-ok { color: var(--wa-dark); }

/* =========================================================
   9. FOOTER
   ========================================================= */
.footer { background: var(--navy-ink); color: #C7D6E4; }
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.4fr;
  gap: 40px;
  padding: clamp(44px, 6vw, 68px) 22px clamp(32px, 4vw, 44px);
}
.footer__brand p { color: #A9BED0; font-size: .92rem; margin-top: 12px; max-width: 34ch; }
.footer__col h4 { color: #fff; font-family: var(--ff-body); font-size: .82rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 14px; }
.footer__col a { display: flex; align-items: center; gap: 8px; padding: 5px 0; color: #C7D6E4; font-size: .94rem; transition: color .16s ease; }
.footer__col a:hover { color: var(--gold-soft); }
.footer__loc { color: #8FA6BA; font-size: .86rem; margin-top: 10px; }

.footer__bar { border-top: 1px solid rgba(255, 255, 255, .1); }
.footer__bar-inner {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 18px 22px;
  font-size: .82rem;
  color: #90A6BA;
}
.footer__bar-inner strong { color: var(--gold-soft); font-weight: 700; }

/* =========================================================
   10. BOTÓN FLOTANTE WHATSAPP
   ========================================================= */
.wa-float {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 60;
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  background: var(--wa);
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(37, 211, 102, .45);
  transition: transform .2s ease;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 32px; height: 32px; fill: #fff; position: relative; z-index: 2; }
.wa-float__pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--wa);
  animation: wa-pulse 2s ease-out infinite;
  z-index: 1;
}
@keyframes wa-pulse {
  0%   { transform: scale(1);   opacity: .55; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* =========================================================
   Reveal on scroll
   ========================================================= */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 940px) {
  .cards, .features, .gallery, .steps { grid-template-columns: repeat(2, 1fr); }
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__sub { margin-inline: auto; }
  .hero__cta { justify-content: center; }
  .hero__trust li { text-align: center; }
  .hero__media { order: -1; max-width: 460px; margin-inline: auto; }
  .deco--3, .deco--4 { display: none; }
  .contact { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--cream);
    padding: 14px 22px 22px;
    border-bottom: 1px solid rgba(44, 95, 138, .12);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links > a { padding: 12px 4px; border-bottom: 1px solid rgba(44, 95, 138, .08); }
  .nav__links > a:last-child { border-bottom: 0; }
  .nav__wa { justify-content: center; margin-top: 8px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .cards, .features, .gallery, .steps { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .footer__bar-inner { justify-content: center; text-align: center; }
  .btn { width: 100%; }
  .hero__cta .btn { width: 100%; }
  .d-none-mobile { display: none; }
  .wa-float { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
