/* ============================================================
   DULCE CAOS — Stylesheet
   ============================================================ */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange:  #FF6B2B;
  --pink:    #FF3D7F;
  --mustard: #F5C518;
  --lime:    #A8D832;
  --cream:   #FFF8EE;
  --dark:    #1A1008;
  --mid:     #3D1F00;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Syne', system-ui, sans-serif;

  --easing: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--cream);
  color: var(--dark);
  font-family: var(--font-body);
  overflow-x: hidden;
}

img { display: block; width: 100%; }

a { color: inherit; text-decoration: none; }

em { font-style: italic; }

/* ---------- Utility: section titles ---------- */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--dark);
}

.section-title em {
  color: var(--orange);
}

.section-sub {
  font-size: 1.1rem;
  color: var(--mid);
  margin-top: 0.75rem;
  max-width: 38ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85em 2em;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--easing), box-shadow 0.2s var(--easing);
  letter-spacing: 0.02em;
}

.btn:hover { transform: translateY(-3px) scale(1.02); }

.btn--hero {
  background: var(--mustard);
  color: var(--dark);
  box-shadow: 4px 4px 0 var(--dark);
}
.btn--hero:hover { box-shadow: 6px 6px 0 var(--dark); }

.btn--outline {
  background: transparent;
  color: var(--cream);
  border: 2.5px solid var(--cream);
  box-shadow: 4px 4px 0 rgba(255,255,255,0.3);
}
.btn--outline:hover { box-shadow: 6px 6px 0 rgba(255,255,255,0.4); }

.btn--dark {
  background: var(--dark);
  color: var(--cream);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
}
.btn--dark:hover { box-shadow: 6px 6px 0 rgba(0,0,0,0.5); }

.btn--ghost {
  background: transparent;
  color: var(--dark);
  border: 2.5px solid var(--dark);
  box-shadow: 4px 4px 0 var(--dark);
}
.btn--ghost:hover { box-shadow: 6px 6px 0 var(--dark); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: transparent;
  transition: background 0.35s ease, backdrop-filter 0.35s ease, padding 0.35s ease;
}

.navbar.is-scrolled {
  background: rgba(255, 248, 238, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 40px;
}

.navbar__logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: #1a1a1a;
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar__link {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s;
}

.navbar__link:hover,
.navbar__link.is-active { color: var(--orange); }

@media (max-width: 600px) {
  .navbar { padding: 16px 20px; }
  .navbar__links { gap: 1.2rem; }
  .navbar__link { font-size: 11px; letter-spacing: 0.06em; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: -15% 0;
  will-change: transform;
  z-index: 0;
}

.hero__bg-img {
  position: absolute;
  inset: 0;
  background: url('croissant.jpg') center/cover no-repeat;
  animation: float-hero 3.5s ease-in-out infinite alternate;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,107,43,0.40) 0%,
    rgba(255,61,127,0.32) 60%,
    rgba(168,216,50,0.18) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--cream);
  padding: 0 1.5rem;
}

.hero__eyebrow {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mustard);
  margin-bottom: 1rem;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 22rem);
  font-weight: 900;
  line-height: 0.9;
  color: var(--cream);
  margin-bottom: 1.2rem;
  text-shadow: 6px 6px 0 rgba(0,0,0,0.25);
}

.hero__title em {
  color: var(--mustard);
  font-style: italic;
}

.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  font-style: italic;
  font-weight: 300;
  margin-bottom: 2.5rem;
  color: rgba(255,248,238,0.92);
}

.hero__scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,248,238,0.6);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 1.5px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,248,238,0.5), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0%, 100% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40%       { transform: scaleY(1); transform-origin: top; opacity: 1; }
  60%       { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100%      { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

@keyframes float-hero {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

@keyframes float-card {
  from { transform: translateY(0); }
  to   { transform: translateY(-4px); }
}

/* ============================================================
   TICKER
   ============================================================ */
.ticker {
  background: #1a1a1a;
  overflow: hidden;
  padding: 14px 0;
  white-space: nowrap;
}

.ticker__track {
  display: inline-flex;
  animation: ticker-scroll 28s linear infinite;
  will-change: transform;
}

.ticker__item {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: #FF6B2B;
  flex-shrink: 0;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   PRODUCTOS
   ============================================================ */
.productos {
  padding: 7rem 0 8rem;
  background: #0d0d0d;
}

.productos__header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  margin-bottom: 4rem;
}

.productos__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Dark theme overrides for productos */
.productos .section-title { color: #FFF8EE; }
.productos .section-sub   { color: rgba(255,248,238,0.6); }

.productos .card {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.6);
}

.productos .card:hover {
  box-shadow: 10px 10px 0 rgba(0,0,0,0.7);
}

.productos .card__title { color: #FFF8EE; }
.productos .card__desc  { color: rgba(255,248,238,0.55); }

/* Cards */
.card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--dark);
  border: 2px solid var(--dark);
  transition: transform 0.35s var(--easing), box-shadow 0.35s var(--easing);

  /* entry animation state */
  opacity: 0;
  transform: translateY(60px) rotate(-2deg);
}

.card.is-visible {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
  transition:
    opacity 0.65s var(--easing),
    transform 0.65s var(--easing),
    box-shadow 0.35s var(--easing);
}

.card[data-index="1"] { transition-delay: 0.12s; }
.card[data-index="2"] { transition-delay: 0.24s; }

.card:hover {
  transform: translateY(-6px) rotate(0.5deg);
  box-shadow: 10px 10px 0 var(--dark);
}

/* Image wrapper with canvas overlay */
.card__img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: crosshair;
}

.card__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--easing);
}

.card:hover .card__video {
  transform: scale(1.04);
}

/* Float animations for cake and macarons cards */
.card[data-index="0"] .card__img-wrap {
  animation: float-card 3.2s ease-in-out infinite alternate;
}

.card[data-index="1"] .card__img-wrap {
  animation: float-card 3.8s ease-in-out 0.55s infinite alternate;
}

/* Card body */
.card__body {
  padding: 1.6rem 1.8rem 2rem;
}

.card__tag {
  display: inline-block;
  padding: 0.3em 0.9em;
  background: var(--mustard);
  color: var(--dark);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.card[data-index="1"] .card__tag { background: var(--pink); color: #fff; }
.card[data-index="2"] .card__tag { background: var(--lime); color: var(--dark); }

.card__title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 0.6rem;
  color: var(--dark);
}

.card__desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #666;
  margin-bottom: 1.2rem;
}

.card__price {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--orange);
}

/* ============================================================
   NUESTRO ESPACIO
   ============================================================ */
.espacio {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.espacio__img-wrap {
  position: absolute;
  inset: 0;
}

.espacio__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.45) saturate(1.3);
}

.espacio__content {
  position: relative;
  z-index: 2;
  max-width: 560px;
  padding: 5rem 3rem 5rem 6rem;
  color: var(--cream);

  /* entry animation state */
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s var(--easing), transform 0.8s var(--easing);
}

.espacio__content.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.espacio__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 1rem;
}

.espacio__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 1.8rem;
}

.espacio__title em {
  color: var(--mustard);
  display: block;
}

.espacio__text {
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(255,248,238,0.85);
  margin-bottom: 1rem;
}

.espacio__text + .espacio__text {
  margin-bottom: 2rem;
}

/* ============================================================
   CTA FINAL
   ============================================================ */
.cta {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);  /* JS will override via inline style */
  transition: background-color 0.1s linear;
  padding: 5rem 2rem;
  text-align: center;
}

.cta__inner {
  max-width: 700px;
}

.cta__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 900;
  line-height: 1;
  color: var(--cream);
  margin-bottom: 1.2rem;
  text-shadow: 5px 5px 0 rgba(0,0,0,0.2);
}

.cta__title em {
  display: block;
  font-style: italic;
  color: var(--mustard);
}

.cta__sub {
  font-size: 1.15rem;
  color: rgba(255,248,238,0.88);
  margin-bottom: 2.8rem;
  max-width: 38ch;
  margin-left: auto;
  margin-right: auto;
}

.cta__btns {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--dark);
  color: rgba(255,248,238,0.75);
  padding: 4rem 2rem 3rem;
}

.footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

.footer__logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--mustard);
  display: block;
  margin-bottom: 0.4rem;
}

.footer__tagline {
  font-size: 0.85rem;
  font-style: italic;
  color: rgba(255,248,238,0.5);
}

.footer__info p {
  font-size: 0.9rem;
  line-height: 1.9;
}

.footer__legal nav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin: 1rem 0 1.2rem;
}

.footer__legal nav a {
  font-size: 0.82rem;
  color: rgba(255,248,238,0.5);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.footer__legal nav a:hover { color: var(--mustard); }

.footer__copy {
  font-size: 0.8rem;
  color: rgba(255,248,238,0.35);
  line-height: 1.6;
}

.footer__demo-notice {
  font-size: 0.78rem;
  color: var(--mustard);
  background: rgba(245,197,24,0.1);
  border: 1px solid rgba(245,197,24,0.3);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ---- 900px: tablet ---- */
@media (max-width: 900px) {
  .espacio__content {
    padding: 4rem 2rem;
    max-width: 100%;
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer__legal {
    grid-column: 1 / -1;
  }
}

/* ---- 768px: tablet portrait / large phone ---- */
@media (max-width: 768px) {
  /* Hero: tame the giant title at this breakpoint */
  .hero__title {
    font-size: clamp(3.5rem, 11vw, 5rem);
  }

  /* CTA: stack buttons in a column */
  .cta__btns {
    flex-direction: column;
    align-items: center;
  }

  .cta__btns .btn {
    width: min(280px, 100%);
    text-align: center;
  }
}

/* ---- 600px: phones ---- */
@media (max-width: 600px) {
  /* Productos */
  .productos { padding: 4rem 0 5rem; }
  .productos__header,
  .productos__grid { padding: 0 1.2rem; }
  .productos__grid { grid-template-columns: 1fr; }

  /* Espacio */
  .espacio__content { padding: 3rem 1.5rem; }

  /* Footer: single column */
  .footer__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Hero title: hard cap at 72px */
  .hero__title {
    font-size: clamp(2.8rem, 17vw, 4.5rem);
  }

  /* Hero tagline: scale down slightly */
  .hero__tagline {
    font-size: clamp(0.95rem, 3.5vw, 1.4rem);
    margin-bottom: 2rem;
  }

  /* Ticker: slightly smaller text */
  .ticker__item { font-size: 15px; }
}

/* ---- 480px: small phones (iPhone SE, mini) ---- */
@media (max-width: 480px) {
  /* Navbar: two-row layout — logo above, links below */
  .navbar {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
  }

  .navbar.is-scrolled {
    padding: 8px 16px;
  }

  .navbar__logo { font-size: 16px; }

  .navbar__links {
    gap: 1rem;
    justify-content: center;
  }

  .navbar__link { font-size: 10px; }

  /* Modal: reduce padding on small screens */
  .modal-overlay { padding: 1rem; }
  .modal__header { padding: 1.2rem 1.4rem; }
  .modal__body   { padding: 1.2rem 1.4rem 1.6rem; }
}

/* ============================================================
   MODAL LEGAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--cream);
  border: 2px solid var(--dark);
  border-radius: 20px;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 8px 8px 0 var(--dark);
  transform: translateY(20px);
  transition: transform 0.3s var(--easing);
}

.modal-overlay.is-open .modal {
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1.5px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--dark);
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--dark);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.modal__close:hover {
  color: var(--orange);
  background: rgba(255,107,43,0.08);
}

.modal__body {
  padding: 1.5rem 2rem 2rem;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.78;
  color: #555;
}

.modal__body h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin: 1.2rem 0 0.3rem;
}

.modal__body h3:first-child { margin-top: 0; }

.modal__body em {
  font-style: italic;
  color: rgba(0,0,0,0.4);
  font-size: 0.82rem;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .card,
  .espacio__content,
  .hero__bg {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .hero__scroll-line,
  .hero__bg-img,
  .ticker__track,
  .card[data-index="0"] .card__img-wrap,
  .card[data-index="1"] .card__img-wrap { animation: none; }
}
