/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    /* Colores principales */
    --primary: #009de2;
    --secondary: #ffc000;
    --accent: #ff0084;
    --dark: #1a1a2e;
    --light: #f8fafc;
    
    /* Colores de texto */
    --text: #2d3748;
    --text-light: #718096;
    
    /* Efectos de vidrio */
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Sombras */
    --shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    
    /* Gradientes */
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    --gradient-hover: linear-gradient(135deg, var(--secondary), var(--accent));
}

/* ============================================
   RESET Y ESTILOS BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text);
    overflow-x: hidden;
}

/* ============================================
   BOTÓN FLOTANTE DE WHATSAPP
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
}

/* ============================================
   BARRA DE NAVEGACIÓN
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    height: 100px;
    width: auto;
    object-fit: contain;
}

/* Menú de navegación */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

/* Colores del menú según scroll */
.navbar.scrolled .nav-link {
    color: var(--text);
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(0, 157, 226, 0.1);
}

.navbar:not(.scrolled) .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Línea animada bajo el link */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: all 0.3s ease;
}

.nav-link:hover::after {
    width: 80%;
    left: 10%;
}

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    min-width: 250px;
    box-shadow: var(--shadow);
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    padding: 1rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-content a:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   BOTÓN HAMBURGUESA (MÓVIL)
   ============================================ */
.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    border-radius: 2px;
    transition: 0.3s;
}

.navbar.scrolled .hamburger span {
    background: var(--text);
}

/* Animación del hamburguesa */
.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ============================================
   SECCIÓN HERO CON VIDEOS
   ============================================ */
.hero {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-carousel {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* Slides del carrusel */
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.8s ease-in-out;
    overflow: hidden;
}

.hero-slide.active {
    opacity: 1;
    transform: translateX(0);
}

.hero-slide.prev {
    transform: translateX(-100%);
}

/* Videos de fondo */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
}

/* Overlay oscuro sobre el video */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* Contenido del hero */
.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 0 2rem;
    text-align: center;
    color: white;
    animation: slideInUp 0.8s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Botón CTA */
.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.3);
}

.cta-button:hover::before {
    left: 100%;
}

/* ============================================
   CONTROLES DEL CARRUSEL
   ============================================ */
.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 4;
}

.hero-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.hero-prev {
    left: 30px;
}

.hero-next {
    right: 30px;
}

/* Indicadores */
.hero-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 4;
}

.hero-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-indicator.active {
    background: white;
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   FORMAS FLOTANTES
   ============================================ */
.floating-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: floatShape 15s infinite linear;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    left: 80%;
    animation-delay: 2s;
}

.shape:nth-child(3) {
    width: 60px;
    height: 60px;
    left: 50%;
    animation-delay: 4s;
}

@keyframes floatShape {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10%, 90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* ============================================
   SECCIÓN DE CARACTERÍSTICAS
   ============================================ */
.features {
    padding: 6rem 2rem;
    background: var(--light);
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    background: var(--accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Tarjetas de características */
.feature-card {
    background: white;
    border-radius: 20px;
    overflow: hidden; /* CLAVE */
    box-shadow: 0 12px 35px rgba(0,0,0,0.1);
    transition: all 0.35s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.18);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin: 1.5rem 1.5rem 0.8rem;
    color: var(--text);
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0 1.5rem 2rem;
}

.feature-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 🔥 ESTO ARREGLA TODO */
    display: block;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--primary);
    color: white;
    padding: 4rem 2rem 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.footer-section p,
.footer-section a {
    color: white;
    line-height: 1.8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #022155;
}

.footer-section ul {
    list-style: none;
}

/* Logo del footer */
.footer-logo {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.footer-logo img {
    height: 100px;
    width: auto;
    object-fit: contain;
}

/* Iconos sociales */
.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Footer bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   PANTALLA DE CARGA
   ============================================ */
.loading {
    position: fixed;
    inset: 0;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   SECCIÓN VIDEO CORPORATIVO
   ============================================ */

.corporate-video {
    padding: 6rem 2rem;
    background: white;
}

.corporate-video-container {
    max-width: 1100px;
    margin: 0 auto;
}

.corporate-video-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.corporate-video-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.corporate-video-header p {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* CONTENEDOR RESPONSIVE */
.corporate-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

/* VIDEO */
.corporate-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: black;
}

/* ============================================
   SECCIÓN CATÁLOGO/BROCHURE
   ============================================ */
.brochure-section {
    padding: 3rem 0;
    background: var(--primary);
}

.brochure-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: white;
}

.brochure-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: white;
}

.brochure-content p {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.brochure-action {
    margin-top: 2rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--gradient-hover);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 157, 226, 0.3);
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 157, 226, 0.4);
}

.download-btn svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   RESPONSIVE DESIGN PARA VIDEOS
   ============================================ */
@media (max-width: 768px) {
    /* Mostrar menú móvil */
    .hamburger {
        display: flex;
    }
    
    /* Ocultar menú desktop */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(26, 26, 46, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        text-align: center;
    }
    
    .nav-link {
        color: white;
        font-size: 1.5rem;
        font-weight: 600;
    }
    
    /* Dropdown móvil */
    .dropdown {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .dropdown-content {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        box-shadow: none;
        border: none;
        display: none;
        max-height: 300px;
        overflow-y: auto;
        text-align: center;
        width: 100%;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        font-size: 1.2rem;
        color: #a0aec0;
        text-align: center;
    }
    
    /* Hero responsive con videos */
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Ocultar controles de navegación en móvil */
    .hero-nav {
        display: none;
    }
    
    .hero-indicators {
        bottom: 20px;
        gap: 10px;
    }
    
    .hero-indicator {
        width: 12px;
        height: 12px;
    }
    
    /* Optimización del video en móvil */
    .hero-video {
        min-width: 100%;
        min-height: 100%;
    }
    
    /* Features responsive */
    .features {
        padding: 4rem 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-image {
        height: 170px;
    }

    .feature-card {
        padding: 1.5rem;
    }

    /* Footer responsive */
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .social-icons {
        justify-content: center;
    }

    .corporate-video {
        padding: 4rem 1rem;
    }

    .corporate-video-header h2 {
        font-size: 2rem;
    }

    .corporate-video-header p {
        font-size: 0.95rem;
    }

    .corporate-video-wrapper {
        border-radius: 14px;
    }    
}

/* ============================================
   RESPONSIVE TABLETS
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .hero-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .hero-prev {
        left: 20px;
    }
    
    .hero-next {
        right: 20px;
    }
}

/* ============================================
   RESPONSIVE PANTALLAS GRANDES
   ============================================ */
@media (min-width: 1920px) {
    .hero-video {
        /* En pantallas 4K, asegurar que el video cubra todo */
        min-width: 100%;
        min-height: 100%;
    }
}

/* ============================================
   OPTIMIZACIONES DE RENDIMIENTO
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .hero-slide,
    .hero-video,
    .cta-button,
    .shape {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}