/* ==========================================================================
   EMAU - SECCIÓN "SABORES", TEMA CLARO DEL HEADER Y EDITOR DE ESCENA
   Construcción pixel-perfect basada en referencia-02.webp (1672x941 px)
   ========================================================================== */

/* Permite scroll suave en html/body para navegar entre hero y sabores */
html, body {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

#sabores-mount {
  display: block;
  min-height: 100svh;
  background: #FCF2E6;
}

/* ==========================================================================
   1. HEADER GLOBAL Y TEMA CLARO (.nav--light)
   ========================================================================== */

/* El header siempre flota fijo en la parte superior */
.nav {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000 !important;
  transition: background .35s cubic-bezier(0.2, 0.8, 0.2, 1), backdrop-filter .35s ease, box-shadow .35s ease, border-color .35s ease;
}

/* Ajuste del menú de 6 enlaces (Inicio · Sabores · Paletas · Malteadas · Nosotros · Sucursales) */
.nav__menu {
  gap: clamp(16px, 2.65vw, 45px) !important;
  left: 50.5% !important;
}

.mobile-drawer__links {
  gap: 16px;
}

/* Brand y Logos (Blanco para Hero / Rojo para Sabores) */
.nav__brand {
  position: absolute;
  left: 7.5%;
  top: 50%;
  transform: translateY(-50%);
  width: 10.5vw;
  max-width: 175px;
  min-width: 110px;
  display: flex;
  align-items: center;
  text-decoration: none;
  z-index: 1001;
  transition: transform .25s ease, filter .25s ease;
}

.nav__brand:hover {
  transform: translateY(calc(-50% - 2px));
}

.nav__brand .nav__logo {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity .35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav__brand .nav__logo--red {
  display: none !important;
  opacity: 0;
}

/* --------------------------------------------------------------------------
   TEMA CLARO ACTIVO (.nav--light) SOBRE LA SECCIÓN DE SABORES
   Header 100% transparente para que logo y textos se adapten directo al fondo
   -------------------------------------------------------------------------- */

.nav.nav--light,
.nav.nav--light.is-scrolled {
  background: transparent !important;
  background-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

/* Intercambio de logos: Ocultar blanco, mostrar logo rojo */
.nav.nav--light .nav__brand .nav__logo:not(.nav__logo--red) {
  display: none !important;
  opacity: 0 !important;
}

.nav.nav--light .nav__brand .nav__logo--red {
  display: block !important;
  opacity: 1 !important;
}

/* Enlaces del menú en tema claro */
.nav.nav--light .nav__link {
  color: #7A3B30 !important;
  font-weight: 500 !important;
  transition: color .25s ease;
}

.nav.nav--light .nav__link:hover {
  color: #5E0F18 !important;
}

.nav.nav--light .nav__link.is-active {
  color: #5E0F18 !important;
  font-weight: 600 !important;
}

.nav.nav--light .nav__link::after {
  background: #F2A81C !important;
  height: 2px !important;
}

.nav.nav--light .nav__link.is-active::after {
  transform: scaleX(1) !important;
}

/* Botón "Ordena ahora" en tema claro */
.nav.nav--light .btn-order {
  background: #7E0D1C !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(126, 13, 28, 0.28) !important;
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}

.nav.nav--light .btn-order svg {
  stroke: #FFFFFF !important;
  color: #FFFFFF !important;
}

.nav.nav--light .btn-order:hover {
  background: #8E1424 !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(126, 13, 28, 0.36) !important;
}

/* Botón hamburguesa móvil */
.nav.nav--light .nav__toggle svg {
  stroke: #5E0F18 !important;
}

/* Drawer móvil en tema claro */
.nav--light + .mobile-drawer,
body.nav-theme-light .mobile-drawer {
  background: rgba(252, 242, 230, 0.98);
}
body.nav-theme-light .mobile-drawer__link {
  color: #7A3B30;
}
body.nav-theme-light .mobile-drawer__link.is-active {
  color: #5E0F18;
}

/* ==========================================================================
   2. RESET ACOTADO Y VARIABLES LOCALES DE LA SECCIÓN SABORES
   ========================================================================== */

.sabores,
.sabores *,
.sabores *::before,
.sabores *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.sabores {
  --s-wine: #7E0F1B;
  --s-wine-deep: #5E0F18;
  --s-gold: #F5A623;
  --s-text: #7B2A2A;
  --s-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --s-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Variables compartidas para la posición y tamaño de los 6 sabores */
  --scene-right: -18.13vw;
  --scene-bottom: -0.08vw;
  --scene-width: 79.00vw;

  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  isolation: isolate;
  background: #FCF2E6;
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  scroll-margin-top: 0;
}

/* ==========================================================================
   3. CAPA DE FONDO Y FORMAS ORGÁNICAS (Z-INDEX 0)
   ========================================================================== */

.sabores__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 78% 55%, rgba(255, 214, 200, .55), transparent 70%);
}

.sabores__blob {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 1;
  transition: opacity 1.2s var(--s-ease);
}

.sabores__yellow-blob {
  position: absolute;
  left: -0.3%;
  top: 10.1%;
  width: 2.9vw;
  height: auto;
  pointer-events: none;
}

/* ==========================================================================
   4. COMPOSICIÓN DEL PRODUCTO (Z-INDEX 5) - COMPARTIDA POR LOS 6 SABORES
   ========================================================================== */

.sabores__product {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

.sabores__scene {
  position: absolute;
  right: -18.13vw;
  bottom: -0.08vw;
  width: 79.00vw;
  max-width: none;
  height: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(20px) scale(1.02);
  transition: opacity .35s var(--s-ease), transform .35s var(--s-ease);
  will-change: opacity, transform;
  user-select: none;
  -webkit-user-drag: none;
}

.sabores__scene.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.sabores__scene.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-15px) scale(.99);
}

/* ==========================================================================
   5. SALPICADURAS DECORATIVAS (Z-INDEX 6)
   ========================================================================== */

.sabores__splash {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  height: auto;
  transform-origin: center;
  transition: transform .6s var(--s-spring), opacity .6s var(--s-ease);
}

.sabores__splash--yellow {
  left: 40.2%;
  top: 20.9%;
  width: 2.2vw;
}

.sabores__splash--red {
  left: 41.0%;
  top: 24.7%;
  width: 3.3vw;
  transform: rotate(-15deg);
}

/* ==========================================================================
   5b. PARTÍCULAS FLOTANTES DE LA SECCIÓN SABORES
   ========================================================================== */
.sabores__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 12;
}

.sabores__particle {
  position: absolute;
  left: var(--px, 50%);
  top: var(--py, 50%);
  width: var(--psize, 4.2vw);
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transform: translate(-50%, -50%) rotate(var(--prot, 0deg));
  transform-origin: center center;
  animation: saboresParticleFloat var(--dur, 6s) ease-in-out var(--delay, 0s) infinite;
  will-change: transform;
}

.sabores__particle img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Capas contextuales dentro de sabores */
.sabores__particle.is-back {
  z-index: 4; /* Detrás de la escena del producto (z: 5) */
}
.sabores__particle.is-front {
  z-index: 12; /* Delante de la escena del producto */
}
.sabores__particle.is-top {
  z-index: 40; /* Por encima de textos y tarjetas */
}

/* Animación sutil de flotación orgánica */
@keyframes saboresParticleFloat {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0px) rotate(calc(var(--prot, 0deg) + var(--r0, 0deg)));
  }
  50% {
    transform: translate(-50%, -50%) translateY(var(--fy, -10px)) rotate(calc(var(--prot, 0deg) + var(--r1, 0deg)));
  }
}

/* ==========================================================================
   6. BLOQUE DE TEXTO Y CONTENIDO PRINCIPAL (Z-INDEX 6)
   ========================================================================== */

.sabores__content {
  position: absolute;
  left: 6.64%;
  top: 53.8%;
  transform: translateY(-50%);
  z-index: 30 !important;
  pointer-events: auto !important;
  max-width: 90vw;
}

/* 6.1 Tag superior */
.sabores__tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: clamp(28px, 1.85vw, 34px);
  padding: 0 clamp(14px, 1vw, 17px) 0 clamp(13px, 0.95vw, 16px);
  border-radius: 999px;
  border: 1.5px solid #8E1B22;
  background: transparent;
  color: var(--s-wine);
  font-weight: 500;
  font-size: clamp(13px, 0.93vw, 16px);
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}

.sabores__tag-icon {
  width: clamp(14px, 0.96vw, 17px);
  height: clamp(14px, 0.96vw, 17px);
}

/* 6.2 Título en 2 líneas */
.sabores__title {
  font-family: "Fredoka One", cursive, system-ui, sans-serif;
  font-weight: 400;
  font-synthesis: none;
  font-size: clamp(54px, 5.3vw, 104px);
  line-height: 0.86;
  letter-spacing: -0.005em;
  display: flex;
  flex-direction: column;
  margin: 0 0 clamp(10px, 0.95vw, 18px);
}

.sabores__title-line {
  white-space: nowrap;
}

.sabores__title-line--1 {
  color: #7E0F1B;
  -webkit-text-stroke: 0.016em currentColor;
  paint-order: stroke fill;
}

.sabores__title-line--2 {
  color: #F5A623;
  background: linear-gradient(90deg, #F7B731, #F59E1B);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0.016em #F59E1B;
  paint-order: stroke fill;
}

/* 6.3 Subtítulo */
.sabores__subtitle {
  font-family: "Outfit", sans-serif;
  font-weight: 400;
  font-size: clamp(14px, 1.05vw, 19px);
  line-height: 1.38;
  color: var(--s-text);
  margin: 0 0 clamp(24px, 2.2vw, 40px);
}

/* ==========================================================================
   7. TARJETAS DE SABORES (6 TARJETAS EN GRID)
   ========================================================================== */

.sabores__cards {
  position: relative;
  z-index: 35 !important;
  pointer-events: auto !important;
  display: grid;
  grid-template-columns: repeat(6, 8.31vw);
  column-gap: 0.84vw;
  margin-bottom: clamp(24px, 2.3vw, 42px);
}

.sabor-card {
  position: relative;
  aspect-ratio: 139 / 266;
  border-radius: 1.3vw;
  overflow: hidden;
  border: 0;
  cursor: pointer !important;
  pointer-events: auto !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 1.02vw;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  color: var(--card-ink);
  box-shadow: 0 10px 24px rgba(120, 50, 40, .14);
  transition: transform .3s var(--s-ease), box-shadow .3s var(--s-ease), outline .2s ease;
  -webkit-tap-highlight-color: transparent;
  outline: 2.5px solid transparent;
  outline-offset: 3px;
  font-family: inherit;
  user-select: none;
}

.sabor-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 30px rgba(110, 30, 25, .22);
}

.sabor-card:hover .sabor-card__arrow {
  transform: translateX(4px);
}

.sabor-card:active {
  transform: scale(0.98);
}

.sabor-card:focus-visible {
  outline: 2.5px solid #7E0F1B;
  outline-offset: 3px;
}

.sabor-card.is-active {
  transform: translateY(-8px);
  outline: 2.5px solid #7E0F1B;
  outline-offset: 3px;
  box-shadow: 0 18px 34px rgba(110, 30, 25, .25);
}

.sabor-card.is-active .sabor-card__arrow {
  display: none;
}

.sabor-card.is-active .sabor-card__check {
  display: block;
}

/* Partes internas de la tarjeta */
.sabor-card__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 63%;
  object-fit: cover;
  object-position: center top;
  user-select: none;
  -webkit-user-drag: none;
}

.sabor-card__icon {
  position: relative;
  width: 1.7vw;
  height: 1.7vw;
  object-fit: contain;
  margin-top: 0.36vw;
}

.sabor-card__name {
  position: relative;
  margin-top: 0.36vw;
  font-weight: 600;
  font-size: clamp(12px, 0.9vw, 16px);
  line-height: 1.33;
  white-space: nowrap;
}

.sabor-card__arrow,
.sabor-card__check {
  position: relative;
  width: 1.08vw;
  height: 1.08vw;
  margin-top: 0.6vw;
  transition: transform .25s var(--s-ease);
}

.sabor-card__check {
  display: none;
}

/* Colores y filtros específicos por sabor */
.sabor-card--vainilla {
  --card-top: #F8EEDC;
  --card-bottom: #EFE0C6;
  --card-ink: #A8681F;
}
.sabor-card--vainilla .sabor-card__icon {
  filter: brightness(0) saturate(100%) invert(43%) sepia(55%) saturate(836%) hue-rotate(354deg) brightness(91%) contrast(87%);
}

.sabor-card--fresa {
  --card-top: #E0566C;
  --card-bottom: #D43E5A;
  --card-ink: #FFFFFF;
}
.sabor-card--fresa .sabor-card__icon {
  filter: brightness(0) invert(1);
}

.sabor-card--mango {
  --card-top: #FFDB7E;
  --card-bottom: #FBCB5C;
  --card-ink: #A55A12;
}
.sabor-card--mango .sabor-card__icon {
  filter: brightness(0) saturate(100%) invert(38%) sepia(87%) saturate(718%) hue-rotate(352deg) brightness(91%) contrast(93%);
}

.sabor-card--cookie {
  --card-top: #EFE6DD;
  --card-bottom: #E2D6CA;
  --card-ink: #4E3329;
}
.sabor-card--cookie .sabor-card__icon {
  filter: none; /* logo-cookie.webp ya trae su color marrón natural */
}

.sabor-card--chocolate {
  --card-top: #6A382B;
  --card-bottom: #4F251B;
  --card-ink: #FFFFFF;
}
.sabor-card--chocolate .sabor-card__icon {
  filter: brightness(0) invert(1);
}

.sabor-card--pistache {
  --card-top: #93AC52;
  --card-bottom: #7F9741;
  --card-ink: #FFFFFF;
}
.sabor-card--pistache .sabor-card__icon {
  filter: brightness(0) invert(1);
}

/* ==========================================================================
   8. BOTÓN "VER TODOS LOS SABORES"
   ========================================================================== */

.sabores__more {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  height: clamp(40px, 2.81vw, 50px);
  padding: 0 clamp(26px, 2.63vw, 46px);
  border-radius: 999px;
  border: 1.5px solid #8E1B22;
  background: transparent;
  color: var(--s-wine);
  font-weight: 500;
  font-size: clamp(13px, 0.93vw, 17px);
  text-decoration: none;
  white-space: nowrap;
  transition: transform .25s var(--s-ease), background .25s, box-shadow .25s;
}

.sabores__more svg {
  width: 20px;
  height: 20px;
  transition: transform .25s var(--s-ease);
}

.sabores__more:hover {
  background: rgba(126, 15, 27, .08);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(126, 15, 27, .12);
}

.sabores__more:hover svg {
  transform: translateX(4px);
}

.sabores__more:active {
  transform: scale(0.97);
}

/* ==========================================================================
   9. ANIMACIÓN DE ENTRADA ESCALONADA (.is-visible)
   ========================================================================== */

.sabores:not(.is-visible) .sabores__tag,
.sabores:not(.is-visible) .sabores__title-line,
.sabores:not(.is-visible) .sabores__subtitle,
.sabores:not(.is-visible) .sabor-card,
.sabores:not(.is-visible) .sabores__more {
  opacity: 0;
  translate: 0 24px;
}

.sabores.is-visible .sabores__more {
  transition-delay: 0.95s;
}

.sabores__scene.is-active {
  transition: opacity .35s var(--s-ease), transform .35s var(--s-ease);
}

.sabores.is-visible .sabores__splash--yellow {
  opacity: 1;
  scale: 1;
  transition-delay: 0.6s;
}

.sabores.is-visible .sabores__splash--red {
  opacity: 1;
  scale: 1;
  transition-delay: 0.7s;
}

.sabores.is-visible .sabores__blob {
  opacity: 1;
  transition-delay: 0s;
}



/* ==========================================================================
   11. RESPONSIVO Y PREFERS-REDUCED-MOTION
   ========================================================================== */

/* 768px – 1099px */
@media (max-width: 1099px) and (min-width: 768px) {
  .sabores {
    height: auto;
    min-height: 100svh;
    padding: 120px 6% 80px;
    overflow: visible;
  }
  .sabores__content {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    max-width: 100%;
  }
  .sabores__cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: 100%;
  }
  .sabor-card {
    aspect-ratio: 139 / 240;
    border-radius: 18px;
    padding-bottom: 14px;
  }
  .sabor-card__icon {
    width: 24px;
    height: 24px;
  }
  .sabor-card__name {
    font-size: 14px;
  }
  .sabor-card__arrow,
  .sabor-card__check {
    width: 16px;
    height: 16px;
  }
  .sabores__product {
    position: relative;
    height: 60vh;
    width: 100%;
    margin-top: 30px;
  }
  .sabores__scene {
    right: 0;
    width: 100%;
    object-fit: contain;
    object-position: center bottom;
  }
  .sabores__splash--yellow {
    left: 70%;
    top: 60px;
    width: 30px;
  }
  .sabores__splash--red {
    left: 75%;
    top: 90px;
    width: 40px;
  }
}

/* < 768px */
@media (max-width: 767px) {
  .sabores {
    height: auto;
    min-height: 100svh;
    padding: 100px 5% 60px;
    overflow: visible;
  }
  .sabores__content {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    max-width: 100%;
  }
  .sabores__title {
    font-size: clamp(40px, 12vw, 64px);
  }
  .sabores__subtitle br {
    display: none;
  }
  .sabores__cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
  }
  .sabor-card {
    aspect-ratio: 139 / 220;
    border-radius: 16px;
    padding-bottom: 12px;
  }
  .sabor-card__icon {
    width: 22px;
    height: 22px;
  }
  .sabor-card__name {
    font-size: 13px;
  }
  .sabor-card__arrow,
  .sabor-card__check {
    width: 14px;
    height: 14px;
  }
  .sabores__product {
    position: relative;
    height: 50vh;
    width: 100%;
    margin-top: 24px;
  }
  .sabores__scene {
    right: 0;
    width: 100%;
    object-fit: contain;
    object-position: center bottom;
  }
  .sabores__splash {
    display: none;
  }
}

/* Accesibilidad: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .nav.nav--light,
  .nav.nav--light * {
    transition: none !important;
  }
  .sabores,
  .sabores * {
    transition: none !important;
    animation: none !important;
  }
  .sabores:not(.is-visible) .sabores__tag,
  .sabores:not(.is-visible) .sabores__title-line,
  .sabores:not(.is-visible) .sabores__subtitle,
  .sabores:not(.is-visible) .sabor-card,
  .sabores:not(.is-visible) .sabores__more,
  .sabores:not(.is-visible) .sabores__scene.is-active,
  .sabores:not(.is-visible) .sabores__splash,
  .sabores:not(.is-visible) .sabores__blob {
    opacity: 1 !important;
    translate: none !important;
    scale: 1 !important;
  }
}
