/* ===== CONFIGURACIÓN GLOBAL Y VARIABLES ===== */
:root {
  --color-primary: #05B3BF;
  --color-primary-dark: #049aa7;
  --color-accent: #FC5B25;
  --color-text: #194141;
  --color-bg: #EEE7D9;
  --color-bg-alt: #FFFFFF;
  --font-family: 'Poppins', sans-serif;
  --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.08);
  --nav-height: 70px;
}

/* ===== RESETEO GLOBAL ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
}

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

.container {
  max-width: 1100px;
  margin: auto;
  padding: 1rem 2rem;
}

.section {
  padding: 5rem 0;
}

.alt {
  background: var(--color-bg-alt);
}

h1, h2, h3, h4 {
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.3;
}
h1 { font-size: 3rem; font-weight: 700; }
h2 { font-size: 2.25rem; text-align: center; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.15rem; }

p, li {
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: var(--color-primary);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-accent);
}

/* ===== BOTONES ===== */
.btn-primary {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: scale(1.05);
}

/* ===== NAV ===== */
.nav-container {
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-light);
  height: var(--nav-height);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 2rem;
  max-width: 1200px;
  margin: auto;
}

.logo {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  margin-left: 1.5rem;
  font-weight: 500;
  color: var(--color-text);
  position: relative;
  padding: 0.25rem 0;
}

/* Subrayado animado */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}
.nav-links a:hover::after {
  width: 100%;
}

.btn-nav {
  background: var(--color-primary);
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.btn-nav:hover {
  background: var(--color-primary-dark);
  transform: scale(1.05);
}
.btn-nav::after { display: none; }

/* Botón de Menú Móvil */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle .bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px 0;
  background: var(--color-text);
  transition: all 0.3s ease-in-out;
}

/* ===== HERO ===== */
#hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  min-height: calc(100vh - var(--nav-height));
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
}

.hero-img img {
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

/* ===== VALORES (SOBRE) ===== */
.values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.value {
  background: var(--color-bg-alt);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.value:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-medium);
}

/* ===== CÓMO FUNCIONA ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.step {
  background: var(--color-bg);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-light);
  transition: transform 0.3s ease;
}
.step:hover {
  transform: scale(1.05);
}
.step span {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  line-height: 40px;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* ===== FUNCIONES ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.card {
  background: var(--color-bg-alt);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-light);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-medium);
}
.card img {
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* ===== FAQ ===== */
.faq-item {
  background: var(--color-bg-alt);
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-light);
  border: 1px solid rgba(0,0,0,0.05);
}
.faq-item summary {
  padding: 1.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  list-style: none;
}
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-primary);
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-item p {
  padding: 0 1.5rem 1.5rem;
  margin: 0;
  border-top: 1px solid var(--color-bg);
}

/* ===== CONTACTO ===== */
.contact {
  text-align: center;
}
.socials {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}
.socials img {
  width: 32px;
  height: 32px;
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.socials img:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 2rem;
  background: var(--color-bg);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.9rem;
  margin-top: 2rem;
}

/* ===== ANIMACIÓN (JS) ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, transform;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== TEXTO LEGAL ===== */
.legal-text {
  background: var(--color-bg-alt);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-light);
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
}
.legal-text h4 {
  margin-top: 1.5rem;
  color: var(--color-primary);
}

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

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-img { order: -1; margin-bottom: 2rem; }
  .hero-img img { max-width: 70%; margin: auto; }
  .values { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }

  /* --- Menú Móvil --- */
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1.3rem;
    color: var(--color-text);
  }

  /* Animación botón */
  .nav-toggle.active .bar:nth-child(2) { opacity: 0; }
  .nav-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* --- Ajuste de Secciones --- */
  .section { padding: 4rem 0; }
  .container { padding: 1rem 1.5rem; }
  .values { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}
