/* ============================================================
   Dulcería — hoja de estilos
   Tokens de diseño primero; todo el color/tipografía sale de aquí.
   ============================================================ */

:root {
  /* Color */
  --rosa: #FFA7D7;          /* rosa dulce del logo */
  --rosa-suave: #FDEFF7;
  --frambuesa: #B62E71;     /* acento con contraste sobre blanco */
  --frambuesa-oscura: #8F1F56;
  --cielo: #B3D3E6;         /* azul cielo exacto del ala del logo */
  --cielo-suave: #EAF4F9;
  --vainilla: #FFF6E8;
  --tinta: #46243A;         /* texto principal (ciruela) */
  --tinta-suave: #7A5A6E;   /* texto secundario */
  --fondo: #FFFBFD;
  --blanco: #FFFFFF;
  --wa: #128C50;            /* verde WhatsApp accesible sobre blanco */
  --wa-oscuro: #0E6E3F;

  /* Tipografía */
  --f-display: "Fredoka", "Trebuchet MS", sans-serif;
  --f-body: "Nunito", "Segoe UI", sans-serif;

  /* Ritmo y forma */
  --radio: 18px;
  --radio-sm: 12px;
  --sombra: 0 10px 30px rgba(70, 36, 58, 0.10);
  --sombra-sm: 0 4px 14px rgba(70, 36, 58, 0.12);
  --ancho: 1120px;
  --transicion: 220ms ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--tinta);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.15; }

a { color: var(--frambuesa); }

:focus-visible {
  outline: 3px solid var(--frambuesa);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { max-width: var(--ancho); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--tinta); color: #fff; padding: .6rem 1rem;
  border-radius: 0 0 var(--radio-sm) var(--radio-sm);
  transition: top var(--transicion);
}
.skip-link:focus { top: 0; }

/* Texto provisional claramente marcado */
.provisional {
  display: block;
  margin-top: .5rem;
  font-size: .8rem;
  font-style: italic;
  color: var(--tinta-suave);
  border-left: 3px solid var(--rosa);
  padding-left: .6rem;
}

/* ============================ Botones ============================ */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--f-display); font-weight: 500; font-size: 1rem;
  padding: .8rem 1.5rem; border-radius: 999px;
  text-decoration: none; border: 2px solid transparent;
  transition: transform var(--transicion), box-shadow var(--transicion), background var(--transicion);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--sombra-sm); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--frambuesa); color: #fff; }
.btn--primary:hover { background: var(--frambuesa-oscura); }

.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: var(--wa-oscuro); }

.btn--ghost { background: transparent; color: var(--frambuesa); border-color: var(--frambuesa); }
.btn--ghost:hover { background: var(--rosa-suave); }

.btn--sm { padding: .45rem 1rem; font-size: .9rem; }
.btn--xl { padding: 1.05rem 2.2rem; font-size: 1.2rem; }

.btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }

.icon { width: 1.25em; height: 1.25em; flex: none; }

.link { font-weight: 700; }

/* ============================ Header ============================ */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 251, 253, 0.92);
  backdrop-filter: blur(8px);
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .65rem;
}
.header__brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--f-display); font-weight: 600; font-size: 1.15rem;
  color: var(--tinta); text-decoration: none;
}
.header__brand img { width: auto; height: 62px; display: block; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Toldo de dulcería: rayas con borde festoneado (firma visual) */
.awning {
  height: 22px;
  background: repeating-linear-gradient(90deg, var(--rosa) 0 44px, var(--cielo) 44px 88px);
  -webkit-mask-image: radial-gradient(circle at 22px 0, #000 20px, transparent 21px);
  mask-image: radial-gradient(circle at 22px 0, #000 20px, transparent 21px);
  -webkit-mask-size: 44px 22px; mask-size: 44px 22px;
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
}

/* Navegación */
.nav__toggle {
  display: none;
  background: none; border: 2px solid var(--rosa);
  border-radius: var(--radio-sm);
  padding: .45rem .8rem; cursor: pointer;
  font-family: var(--f-display); font-size: .9rem; color: var(--tinta);
  align-items: center; gap: .5rem;
}
.nav__toggle-bar {
  display: inline-block; width: 18px; height: 2px; background: var(--tinta);
  position: relative;
}
.nav__toggle-bar::before, .nav__toggle-bar::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--tinta);
}
.nav__toggle-bar::before { top: -6px; }
.nav__toggle-bar::after { top: 6px; }

.nav__list {
  display: flex; align-items: center; gap: .25rem; list-style: none;
}
.nav__link {
  display: block; padding: .5rem .8rem;
  color: var(--tinta); text-decoration: none; font-weight: 700; font-size: .95rem;
  border-radius: 999px;
  transition: background var(--transicion), color var(--transicion);
}
.nav__link:hover { background: var(--rosa-suave); color: var(--frambuesa); }

@media (max-width: 840px) {
  .nav__toggle { display: inline-flex; }
  .nav__list {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: var(--blanco); padding: 1rem clamp(1.25rem, 4vw, 2.5rem) 1.25rem;
    box-shadow: var(--sombra);
  }
  .nav__list.is-open { display: flex; }
  .nav__link { padding: .8rem 1rem; }
  .nav__list .btn--wa { justify-content: center; margin-top: .5rem; }
}

/* ============================ Hero ============================ */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--fondo), var(--rosa-suave)); }
.hero__grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center; padding-block: clamp(3rem, 8vw, 6rem) clamp(4rem, 9vw, 7rem);
}
.eyebrow {
  font-family: var(--f-display); font-weight: 500; font-size: .85rem;
  letter-spacing: .28em; text-transform: uppercase; color: var(--frambuesa);
  margin-bottom: .6rem;
}
.hero__title { font-size: clamp(2.4rem, 6vw, 3.8rem); }
.hero__slogan {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem); color: var(--frambuesa);
  margin-top: .5rem;
}
.hero__text { margin-top: 1.1rem; max-width: 34rem; color: var(--tinta-suave); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.hero__art { justify-self: center; width: min(100%, 420px); }
.candy-scene { width: 100%; height: auto; }

@media (max-width: 840px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__text { margin-inline: auto; }
  .hero__actions { justify-content: center; }
  .hero__art { width: min(75%, 340px); order: -1; }
  .provisional { border-left: none; padding-left: 0; }
}

/* Flotación de los dulces del hero */
@keyframes floaty { from { transform: translateY(0); } to { transform: translateY(-10px); } }
.float-a { animation: floaty 3.6s ease-in-out infinite alternate; }
.float-b { animation: floaty 4.4s .4s ease-in-out infinite alternate; }
.float-c { animation: floaty 3s .8s ease-in-out infinite alternate; }

/* ============================ Cinta ============================ */
.ticker { overflow: hidden; background: var(--tinta); color: var(--rosa); padding-block: .55rem; }
.ticker__track {
  display: flex; gap: 1.6rem; white-space: nowrap; width: max-content;
  font-family: var(--f-display); font-weight: 500; font-size: .95rem;
  letter-spacing: .06em; text-transform: uppercase;
  animation: ticker 26s linear infinite;
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* ============================ Secciones ============================ */
.section { position: relative; padding-block: clamp(3.5rem, 8vw, 5.5rem); }
.section--alt { background: var(--vainilla); }
.section--sky { background: var(--cielo-suave); }
.section--contact { background: linear-gradient(180deg, var(--fondo), var(--rosa-suave)); text-align: center; }

.section__title { font-size: clamp(1.8rem, 4.5vw, 2.6rem); margin-bottom: .6rem; }
.section__intro { color: var(--tinta-suave); max-width: 40rem; margin-bottom: 2rem; }
.section--contact .section__intro { margin-inline: auto; }

/* Separador festoneado entre secciones */
.divider, .divider--flip {
  position: absolute; left: 0; right: 0; height: 26px; pointer-events: none;
}
.divider {
  bottom: -1px;
  background: var(--fondo);
  -webkit-mask-image: radial-gradient(circle at 30px 26px, #000 26px, transparent 27px);
  mask-image: radial-gradient(circle at 30px 26px, #000 26px, transparent 27px);
  -webkit-mask-size: 60px 26px; mask-size: 60px 26px;
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
}
.hero .divider { background: var(--fondo); }
.divider--flip { display: none; }

/* ============================ Galería ============================ */
/* Mosaico de cuadros (1:1): admite fotos verticales, cuadradas u horizontales
   sin recortes bruscos; la primera foto va destacada en 2×2. */
.gallery {
  list-style: none;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem;
}
.gallery__item { border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra-sm); }
.gallery__item--featured { grid-column: span 2; grid-row: span 2; }
.gallery__btn {
  display: block; width: 100%; height: 100%; padding: 0; border: 0; cursor: zoom-in; background: none;
}
.gallery__btn img {
  display: block; width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  transition: transform 400ms ease;
}
.gallery__btn:hover img, .gallery__btn:focus-visible img { transform: scale(1.05); }

@media (max-width: 840px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .gallery { gap: .7rem; } }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 1000px); margin: auto; }
.lightbox::backdrop { background: rgba(40, 16, 32, 0.88); }
.lightbox__figure { margin: 0; }
.lightbox__figure img {
  max-width: min(88vw, 960px); max-height: 78vh; object-fit: contain;
  border-radius: var(--radio); background: var(--blanco);
}
.lightbox__figure figcaption { color: #fff; text-align: center; padding-top: .8rem; font-size: .95rem; }
.lightbox__close, .lightbox__nav {
  position: fixed; z-index: 5;
  background: rgba(255, 255, 255, 0.14); color: #fff;
  border: 0; border-radius: 999px; cursor: pointer;
  width: 46px; height: 46px; font-size: 1.4rem; line-height: 1;
  display: grid; place-items: center;
  transition: background var(--transicion);
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 2rem; }
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

/* ============================ Nosotros ============================ */
.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about__photo { margin: 0; }
.about__photo img { border-radius: var(--radio); box-shadow: var(--sombra); }
.about__values { list-style: none; margin-top: 1.4rem; display: grid; gap: .7rem; }
.about__values li { padding-left: 1.6rem; position: relative; }
.about__values li::before {
  content: ""; position: absolute; left: 0; top: .5em;
  width: .7em; height: .7em; border-radius: 50%;
  background: var(--rosa); box-shadow: 0 0 0 3px var(--rosa-suave);
}
@media (max-width: 840px) { .about { grid-template-columns: 1fr; } .about__photo { max-width: 420px; margin-inline: auto; } }

/* ============================ Ubicación ============================ */
.location { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.location__address { font-style: normal; font-size: 1.1rem; font-weight: 700; }
.location__references, .location__schedule, .location__phone { margin-top: .8rem; color: var(--tinta-suave); }
.location__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.location__map iframe, .location__map-placeholder {
  width: 100%; aspect-ratio: 4 / 3; border: 0;
  border-radius: var(--radio); box-shadow: var(--sombra-sm);
}
.location__map-placeholder {
  display: grid; place-items: center;
  background: var(--cielo-suave); color: var(--tinta-suave);
  border: 2px dashed var(--cielo);
}
@media (max-width: 840px) { .location { grid-template-columns: 1fr; } }

/* ============================ Redes ============================ */
.social { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; max-width: 780px; }
.social__card {
  display: flex; align-items: center; gap: .9rem;
  background: var(--blanco); border-radius: var(--radio);
  padding: 1.1rem 1.3rem; text-decoration: none; color: var(--tinta);
  box-shadow: var(--sombra-sm);
  transition: transform var(--transicion), box-shadow var(--transicion);
}
.social__card:hover { transform: translateY(-3px); box-shadow: var(--sombra); }
.social__card .icon { width: 2rem; height: 2rem; color: var(--frambuesa); }
.social__card strong { font-family: var(--f-display); font-weight: 500; display: block; }
.social__card span { font-size: .85rem; color: var(--tinta-suave); }

/* ============================ Contacto ============================ */
.contact__note { margin-top: 1rem; font-size: .9rem; color: var(--tinta-suave); font-style: italic; }
.contact__extra { margin-top: 1rem; }

/* Botón flotante de WhatsApp */
.wa-float {
  position: fixed; z-index: 60;
  right: max(1.1rem, env(safe-area-inset-right));
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--wa); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(14, 110, 63, 0.4);
  transition: transform var(--transicion), background var(--transicion);
}
.wa-float:hover { transform: scale(1.08); background: var(--wa-oscuro); }
.wa-float .icon { width: 30px; height: 30px; }

/* ============================ Pie ============================ */
.footer { background: var(--tinta); color: #F6E7F0; }
.footer a { color: #F6E7F0; text-decoration: none; }
.footer a:hover { color: var(--rosa); }
.footer__grid {
  display: grid; grid-template-columns: auto 1fr auto; gap: 2rem; align-items: center;
  padding-block: 2.2rem 1.2rem;
}
.footer__brand { display: flex; align-items: center; gap: .7rem; font-family: var(--f-display); }
.footer__brand img {
  width: auto; height: 64px; display: block;
  background: #fff; padding: .45rem .7rem; border-radius: 12px;
}
.footer__nav { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; justify-content: center; font-size: .95rem; }
.footer__social { display: flex; gap: .8rem; }
.footer__social .icon { width: 1.5rem; height: 1.5rem; }
.footer__legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem;
  padding-block: 1rem 1.6rem; font-size: .85rem; color: #C9A8BC;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
@media (max-width: 840px) {
  .footer__grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer__legal { justify-content: center; text-align: center; }
}

/* ============================ Animaciones de scroll ============================ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Respeto por reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .ticker__track { animation: none !important; }
}
