/* ========== Paleta y Variables Globales ========== */
:root {
  --amarillo-maduro: #fcd144;
  --banana-shade: #FCD144;   /* amarillo del logo */
  --verde-pinton: #88af39;
  --plantain-shade: #88AF39; /* verde del logo (más oliva) */
  
  --cream: #fffefc;          /* fondo base */
  --cream-alt: #FFF8E5;      /* fondo cálido opcional */
  
  --banana: #FFD100;         /* amarillo principal UI */
  --banana-shadow: #E8B92F;  /* sombra/dorado */
  
  --plantain: #7CB518;       /* verde principal UI */
  --plantain-shadow: #5D893A;/* verde oscuro del logo */
  
  --salsa: #2a4c37;
  --stroke: #2A4C37;         /* contornos del sistema ilustrado */
  --salsa-brown: #6B3626;    /* texto/soportes densos */
  --guava-coral: #ff6f61;    /* acento */
}

/* ========== Reset y Tipografía Base ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--cream);
  color: var(--salsa);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
}
img {
  max-width: 100%;
  display: block;
  height: auto;
}

/* ========== Encabezado ========== */
header {
  background: var(--cream);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
header img {
  border-radius: 14px;
}
nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}
nav a {
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}
nav a:hover {
  color: var(--verde-pinton);
}
nav a:focus-visible {
  outline: 2px solid var(--verde-pinton);
  outline-offset: 2px;
}

/* ========== Secciones genéricas y Títulos ========== */
main {
  display: block;
}
section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin-inline: auto;
}
.section-title {
  font-family: "Fredoka", sans-serif;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
}
.sobre {
  max-width: 800px;
  text-align: center;
  margin-inline: auto;
}

/* ========== Hero ========== */
.hero {
  text-align: center;
  position: relative;
  overflow: hidden;
  width: 100%; /* Asegura que ocupe todo el ancho disponible */
  max-width: none; /* Sobrescribe el max-width de las secciones genéricas */
  padding: 6rem 2rem; /* Padding vertical amplio para desktop */
  background-color: var(--cream-alt); /* Fondo cálido para distinguir la sección */
}

/* El contenido del hero se mantiene centrado y con ancho máximo para legibilidad */
.hero-content {
  position: relative;
  z-index: 1; /* Por encima de las ondas */
  max-width: 1200px;
  margin-inline: auto;
}

/* Las ondas ahora tienen una altura fija que se ajusta en pantallas pequeñas */
.hero-waves {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 650px; /* Altura base para las ondas en desktop */
  z-index: 0;
  pointer-events: none;
  isolation: isolate;
}

.hero-waves svg {
  width: 100%;
  height: 100%;
}


/* ========== Responsive Hero Adjustments ========== */
@media (max-width: 768px) {
  .hero {
    padding: 4rem 2rem; /* Reduce el padding vertical en tablets */
  }

  .hero-waves {
    height: 800px; /* Reduce la altura de las ondas */
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 3rem 1rem; /* Padding más ajustado para móviles */
  }
  
  /* La regla para h1 en 480px que ya tenías funcionará perfecto aquí */

  .hero-waves {
    height: 150px; /* Ondas más sutiles en pantallas pequeñas */
  }
}

.hero img {
  border-radius: 14px;
  margin-inline: auto;
  aspect-ratio: 1/1;
}
.hero h1 {
  font-family: "Fredoka", sans-serif;
  font-size: 2.5rem;
  margin-top: 1rem;
}
.hero p {
  max-width: 60ch;
  margin: 1rem auto 0;
  font-size: 1.1rem;
}

/* Botón con contraste AA */
.button {
  display: inline-block;
  background: var(--verde-pinton);
  color: var(--cream);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-top: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
}
.button:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.button:focus-visible {
  outline: 3px solid var(--amarillo-maduro);
  outline-offset: 3px;
}

/* ========== Componente Tarjeta ========== */
.card {
  background: var(--cream);
  border: 2px solid var(--verde-pinton);
  border-radius: 14px;
  padding: 1.7rem 1.2rem 1.4rem;
  text-align: center;
  transition: transform 0.18s, box-shadow 0.18s;
  flex: 1 1 250px;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 16px rgba(42, 76, 55, 0.15);
}

/* ========== Grilla Menú ========== */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}
.menu-grid img {
  display: block;
  width: 100%; 
  height: auto;
  max-width: 320px;
  margin: 0 auto 1rem;
  border-radius: 14px;
}
.menu-grid h3 {
  font-family: "Fredoka", sans-serif;
  margin-bottom: 0.4rem;
}

/* ========== Constructor "Arma tu Platanada" ========== */
#arma {
  padding-bottom: 4rem;
}
.builder {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  align-items: flex-start;
  counter-reset: step;
  position: relative;
}
.builder .card {
  position: relative;
  z-index: 1;
}
/* Línea */
.builder::before {
  content: "";
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--verde-pinton);
  z-index: 0;
}
/* Círculo numerado */
.builder .card::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  line-height: 52px;
  border-radius: 50%;
  background: var(--amarillo-maduro);
  color: var(--salsa);
  font-weight: 700;
  font-size: 1.1rem;
  border: 2px solid var(--salsa);
}

/* Flecha entre tarjetas */
.builder .card:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 61px;
  right: -27px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 14px solid var(--verde-pinton);
}
.builder h4 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}
.builder p {
  font-size: 0.92rem;
}
.cta {
  text-align: center;
  margin-top: 3rem;
  font-weight: 600;
}

/* ========== Contacto (alto contraste) ========== */
#contacto {
  background: var(--salsa); /* antes: verde; ahora oscuro para AA */
  color: var(--cream);
  text-align: center;
  border-top: 5px solid var(--amarillo-maduro);
  border-bottom: 5px solid var(--amarillo-maduro);
}
#contacto .section-title {
  color: var(--amarillo-maduro);
}
#contacto p {
  margin-bottom: 0.5rem;
}
#contacto a {
  color: var(--amarillo-maduro);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin: 0 0.5rem;
  border-radius: 4px;
}
#contacto a:focus-visible {
  outline: 2px solid var(--amarillo-maduro);
  outline-offset: 4px;
}

/* Footer */
footer {
  background: var(--salsa);
  color: var(--cream);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
}

/* ========== Animación fadeUp ========== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.8s ease-out forwards;
}
.fade-up.delay-1 {
  animation-delay: 0.15s;
}
.fade-up.delay-2 {
  animation-delay: 0.3s;
}
.fade-up.delay-3 {
  animation-delay: 0.45s;
}
.fade-up.delay-4 {
  animation-delay: 0.6s;
}

/* Animación automática en cards */
.menu-grid .card,
.builder .card {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.8s ease-out forwards;
}
.menu-grid .card:nth-child(2),
.builder .card:nth-child(2) {
  animation-delay: 0.15s;
}
.menu-grid .card:nth-child(3),
.builder .card:nth-child(3) {
  animation-delay: 0.3s;
}
.menu-grid .card:nth-child(4),
.builder .card:nth-child(4) {
  animation-delay: 0.45s;
}
.menu-grid .card:nth-child(5),
.builder .card:nth-child(5) {
  animation-delay: 0.6s;
}
.menu-grid .card:nth-child(6),
.builder .card:nth-child(6) {
  animation-delay: 0.75s;
}

/* ========== Botón flotante WhatsApp ========== */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 25px;
  right: 25px;
  background-color: var(--verde-pinton);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  transition: transform 0.2s ease-in-out;
}
.whatsapp-float:hover {
  transform: scale(1.1);
}
.whatsapp-float svg {
  stroke: white;
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .builder {
    flex-wrap: wrap;
    gap: 4rem 1.5rem;
  }
  .builder::before,
  .builder .card:not(:last-child)::after {
    display: none;
  }
}
@media (max-width: 480px) {
  header {
    justify-content: center;
  }
  section {
    padding: 3rem 1rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .section-title {
    font-size: 1.75rem;
  }
}
