/* ======== CONFIGURACIÓN GENERAL Y VARIABLES ======== */
:root {
    --color-primary-start: #ff3300;
    --color-primary-end: #ff9900;
    --color-secondary-start: #dc3545;
    --color-secondary-end: #a71d2a;
    --color-dark: #121212;
    --color-light: #f9f9f9;
    --color-white: #ffffff;
    --color-text: #333;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Lato', sans-serif;
    --shadow-glow: 0 0 30px rgba(255, 100, 0, 0.5);
}

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

html { 
    scroll-behavior: smooth; 
}

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

/* CAMBIO: Se añade padding-top para evitar que el contenido sea ocultado por el header fijo */
main { 
    overflow-x: hidden;
    padding-top: 120px;
}

h1, h2, h3 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
}

.section-title {
    font-size: 2.8rem;
    color: var(--color-dark);
    text-align: center;
    margin-bottom: 4rem;
    font-weight: 700;
}

/* ======== HEADER Y MENÚ HAMBURGUESA (MODIFICADO) ======== */
.main-header {
    padding: 1.5rem 5%; 
    position: fixed; 
    top: 0; 
    width: 100%; 
    z-index: 999;
    transition: background-color 0.3s, padding 0.3s ease;
    background: linear-gradient(90deg, #ff3300, #ff9900); /* Degradado aplicado */
}

.main-header.scrolled { 
    background-color: rgba(255, 255, 255, 0.8); 
    backdrop-filter: blur(10px); 
    border-bottom: 1px solid rgba(0,0,0,0.05); 
    padding: 0.5rem 5%; /* CAMBIO: Padding reducido al hacer scroll */
}

.main-nav { 
    display: flex; 
    justify-content: flex-end; /* CAMBIO: Menú alineado a la derecha, ya que el logo no está en el flujo */
    align-items: center; 
    max-width: 1400px; 
    margin: 0 auto; 
    position: relative; /* CAMBIO: Esencial para posicionar el logo de forma absoluta */
    height: 70px; /* CAMBIO: Altura fija para controlar el espacio */
}

/* CAMBIO: Nueva regla para posicionar el logo */
.nav-logo {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  transition: all 0.3s ease;
}


/* CONTENEDOR DEL LOGO CON GLASSMORPHISM */
.nav-logo-container {
  background: rgba(30, 30, 30, 0.6);
  border: 4px solid #ff6600;
  padding: 10px;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
  position: relative;
  overflow: hidden; /* Para que el brillo no se salga */
}

.nav-logo-container::before {
  content: '';
  position: absolute;
  top: -100%;
  left: -100%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 60%
  );
  transform: rotate(25deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    transform: translate(-100%, -100%) rotate(25deg);
  }
  100% {
    transform: translate(100%, 100%) rotate(25deg);
  }
}

.nav-logo-container:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(255, 100, 0, 0.4);
}

.nav-logo img {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
  transition: width 0.3s ease;
}



/* CAMBIO: Se encoge el logo al hacer scroll para un efecto más pulido */

/* CAMBIO DE TAMAÑO DEL LOGO AL HACER SCROLL */
.main-header.scrolled .nav-logo img {
  width: 120px;
}

/* MENÚ */
.nav-menu {
  display: flex;
  gap: 2rem;
  margin-left: auto;
}

.nav-menu li {
  list-style: none;
}

.nav-menu a {
  text-decoration: none;
  color: white;
  font-weight: bold;
}

/* BOTÓN CONTACTO */
.btn-secondary {
  background-color: white;
  color: #ff3300;
  padding: 8px 16px;
  border-radius: 6px;
}

/* MENÚ HAMBURGUESA */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.bar {
  height: 4px;
  width: 25px;
  background-color: white;
  margin: 3px 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .nav-logo {
    left: 20px;
    transform: none;
  }

  .nav-logo img {
    width: 140px;
  }
}
.main-header.scrolled .nav-logo {
    top: 5px;
}
.main-header.scrolled .nav-logo img {
    width: 120px;
}

.nav-menu { 
    list-style: none; 
    display: flex; 
    align-items: center; 
    gap: 2.5rem; 
}

.nav-menu a { 
    text-decoration: none; 
    color: var(--color-dark); 
    font-family: var(--font-primary); 
    font-weight: 600; 
    position: relative; 
    padding-bottom: 5px; 
}

.nav-menu a::after { 
    content: ''; 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 0; 
    height: 2px; 
    background: linear-gradient(90deg, var(--color-primary-start), var(--color-primary-end)); 
    transition: width 0.3s ease-out; 
}

.nav-menu a:hover::after { 
    width: 100%; 
}

.hamburger { 
    display: none; 
    cursor: pointer; 
    z-index: 1001; /* CAMBIO: Se asegura que esté sobre todo, incluso el menú móvil */
}

.hamburger .bar { 
    display: block; 
    width: 25px; 
    height: 3px; 
    margin: 5px auto; 
    transition: all 0.3s ease-in-out; 
    background-color: var(--color-dark); 
}

/* ======== SECCIÓN HERO CON VIDEO ======== */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5%;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.hero-content {
    z-index: 1;
    color: var(--color-white);
    max-width: 900px;
}

.hero-content h1 {
    font-size: 4.8rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ======== BOTONES ======== */
.btn { 
    padding: 1rem 2.5rem; 
    border-radius: 50px; 
    text-decoration: none; 
    font-weight: 600; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    display: inline-block; 
    border: none; 
    cursor: pointer; 
}

.btn-primary { 
    background: linear-gradient(90deg, var(--color-primary-start), var(--color-primary-end)); 
    color: var(--color-white); 
    box-shadow: var(--shadow-glow); 
}

.btn-primary:hover { 
    transform: translateY(-5px) scale(1.05); 
    box-shadow: 0 0 40px rgba(255, 100, 0, 0.7); 
}

.btn-secondary { 
    background: rgba(255,255,255,0.1); 
    border: 1px solid var(--color-dark); 
    color: var(--color-dark); 
}

.btn-secondary:hover { 
    background: var(--color-dark); 
    color: var(--color-white); 
}

/* ======== ESTILOS DE SECCIONES GENERALES ======== */
.problems-section, .features-section, .stats-section, .cta-section { 
    padding: 7rem 5%; 
}

.problems-section { 
    background: #f1f2f6; 
}

.problems-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 2.5rem; 
    max-width: 1400px; 
    margin: 0 auto; 
}

.features-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 2rem; 
    max-width: 1400px; 
    margin: 0 auto; 
}

.feature-card { 
    background: var(--color-white); 
    padding: 2rem; 
    border-radius: 15px; 
    text-align: center; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.03); 
}

.stats-section { 
    background-color: var(--color-dark); 
    color: var(--color-white); 
    padding: 5rem 5%; 
}

.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 2rem; 
    max-width: 1000px; 
    margin: 0 auto; 
    text-align: center; 
}

.stat-number { 
    font-size: 4.5rem; 
    color: var(--color-primary-end); 
}

.cta-section { 
    text-align: center; 
}

/* ======== ANIMACIONES DE SCROLL ======== */
.hidden { 
    opacity: 0; 
    transition: opacity 0.8s ease-out, transform 0.8s ease-out; 
}

.slide-in-from-bottom { 
    transform: translateY(50px); 
}

.slide-in-from-left { 
    transform: translateX(-50px); 
}

.slide-in-from-right { 
    transform: translateX(50px); 
}

.show { 
    opacity: 1; 
    transform: translate(0, 0); 
}

/* ======== EFECTO 3D FLIP CARD ======== */
.problem-card {
    background-color: transparent;
    min-height: 300px;
    perspective: 1500px;
    border-radius: 20px;
    box-shadow: none;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.problem-card:hover .card-inner,
.problem-card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
}

.card-front {
    background: var(--color-white);
    color: var(--color-text);
}

.card-front i {
    font-size: 3rem; 
    background: linear-gradient(135deg, var(--color-primary-start), var(--color-primary-end)); 
    -webkit-background-clip: text; 
    color: transparent; 
    margin-bottom: 1rem;
}

.card-back {
    background: linear-gradient(135deg, var(--color-secondary-end), var(--color-secondary-start));
    color: var(--color-white);
    transform: rotateY(180deg);
}

.card-back h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.card-back p {
    font-size: 1rem;
}

.statistic-number {
    font-family: var(--font-primary);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-primary-end);
    margin: 0.5rem 0;
    line-height: 1;
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--color-primary-end);
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* ======== FOOTER ======== */
.main-footer-bottom { 
    background-color: var(--color-dark); 
    color: var(--color-light); 
    padding: 3rem 5%; 
    text-align: center; 
    position: relative;
    z-index: 10;
}

.footer-content { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1400px; 
    margin: 0 auto; 
    flex-wrap: wrap; 
    gap: 1.5rem; 
}

.social-icons a { 
    color: var(--color-light); 
    margin: 0 0.5rem; 
    font-size: 1.2rem; 
}

/* ======== ESTILOS RESPONSIVE PARA MÓVILES ======== */
@media (max-width: 992px) {
    .problems-grid, .features-grid, .stats-grid { 
        grid-template-columns: 1fr 1fr; 
    }
   
    .hero-content h1 { 
        font-size: 3.5rem; 
    }

    .footer-content {
        flex-direction: column;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2.2rem;
    }

    .problems-section, .features-section, .stats-section, .cta-section { 
        padding: 4rem 5%;
    }

    .problems-grid, .features-grid, .stats-grid { 
        grid-template-columns: 1fr; 
    }

    /* CAMBIO: Se ajusta el logo para pantallas pequeñas */
    .nav-logo img {
        width: 150px;
    }

    .nav-menu { 
        position: fixed; 
        left: -100%; 
        top: 0; 
        flex-direction: column; 
        justify-content: center; 
        background-color: rgba(255, 255, 255, 0.95); 
        backdrop-filter: blur(10px); 
        width: 100%; 
        height: 100vh; 
        transition: left 0.3s ease-in-out; 
        gap: 3rem; 
    }
   
    .nav-menu.active { 
        left: 0; 
    }
   
    .nav-menu a { 
        font-size: 1.5rem; 
    }
   
    .hamburger { 
        display: block; 
    }
   
    .hamburger.active .bar:nth-child(2) { 
        opacity: 0; 
    }
   
    .hamburger.active .bar:nth-child(1) { 
        transform: translateY(8px) rotate(45deg); 
    }
   
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }
}