/* ============================================
   ESTILOS BASE Y CONFIGURACIÓN GLOBAL
   ============================================ */

* {
    box-sizing: border-box;
    max-width: 100%;
}

html {
    scroll-behavior: smooth;
}

/* Variables CSS para tema oscuro */
.dark {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
}


/* ============================================
   SECCIONES PRINCIPALES - CORREGIDO
   ============================================ */

/* Configuración de secciones con scroll snap y animaciones de entrada */
section {
    /* CAMBIO: Usar min-height en lugar de height fijo */
    min-height: 100vh;
    /* NUEVO: Permitir que la sección crezca con el contenido */
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
    padding: 4rem 1rem;
    /* Animación de entrada inicial (oculto) */
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    scroll-margin-top: 150px;
    /* NUEVO: Asegurar que el contenido no se desborde */
    overflow: visible;
}

/* Animación cuando la sección es visible */
section.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ============================================
   SECCIÓN DE STACK TECNOLÓGICO
   ============================================ */

.tech-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    /* NUEVO: Permitir altura automática */
    height: auto;
    padding: 80px 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Título de la sección tech */
.tech-section h2 {
    text-align: center;
    font-size: 2.5em;
    color: #2d3748;
    margin-bottom: 20px;
    font-weight: 700;
}

/* Descripción de la sección tech */
.tech-section > p {
    text-align: center;
    margin-bottom: 2.5rem;
    color: #cbd5e1;
    font-size: 1.1rem;
    max-width: 700px;
}

/* Grid responsive de tecnologías */
.tech-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1400px;
    width: 100%;
    padding: 0 20px;
}

/* Tarjetas de tecnología con efecto glassmorphism */
.tech-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

/* Efecto hover en tarjetas de tecnología */
.tech-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

/* Contenedor del ícono de tecnología */
.tech-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Imagen del ícono con efecto de sombra */
.tech-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
}

/* Efecto de zoom en ícono al hacer hover */
.tech-card:hover .tech-icon img {
    transform: scale(1.2);
}

/* Título de la tecnología */
.tech-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
    font-weight: 600;
}

/* Descripción de la tecnología */
.tech-card p {
    color: #cbd5e1;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 0;
}


/* ============================================
   SECCIÓN DE SERVICIOS
   ============================================ */

/* Tarjeta de servicio con interactividad */
.service-card {
    cursor: pointer;
    user-select: none;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

/* Contenido flexible del servicio */
.service-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Contenedor del ícono de servicio */
.service-icon-container {
    transition: transform 0.3s ease;
}

/* Efecto hover en ícono de servicio */
.service-card:hover .service-icon-container {
    transform: scale(1.1);
}

/* Efecto al hacer clic en la tarjeta */
.service-card:active {
    transform: scale(0.98);
}

/* Detalles expandibles del servicio */
.service-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out, margin 0.4s ease-out;
}

/* Estado expandido de detalles del servicio */
.service-details.active {
    max-height: 1000px;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 2px solid rgba(17, 147, 212, 0.3);
}


/* ============================================
   SECCIÓN DE FAQ (PREGUNTAS FRECUENTES)
   ============================================ */

/* Respuesta desplegable de FAQ */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

/* Estado expandido de respuesta FAQ */
.faq-answer.active {
    max-height: 500px;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Ícono de expansión FAQ (ej: signo +) */
.faq-icon {
    transition: transform 0.3s ease;
}

/* Rotación del ícono cuando está activo */
.faq-icon.active {
    transform: rotate(45deg);
}


/* ============================================
   BOTÓN FLOTANTE DE WHATSAPP
   ============================================ */

.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
    background-color: #25d366;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: transform 0.3s ease;
}

/* Efecto hover en botón de WhatsApp */
.whatsapp-float:hover {
    transform: scale(1.1);
}

/* Ícono de WhatsApp invertido a blanco */
.whatsapp-float img {
    width: 35px;
    height: 35px;
    filter: invert(1);
}


/* ============================================
   MENÚ MÓVIL
   ============================================ */

#mobileMenu {
    transition: all 0.3s ease-in-out;
}


/* ============================================
   MODO OSCURO
   ============================================ */

/* Fondo de sección tech en modo oscuro */
.dark .tech-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Títulos en modo oscuro */
.dark h2,
.dark .tech-card h3 {
    color: #fff;
}

/* Textos secundarios en modo oscuro */
.dark .tech-card p,
.dark .tech-section > p {
    color: #cbd5e1;
}


/* ============================================
   MEDIA QUERIES - RESPONSIVE DESIGN
   ============================================ */

/* ===== LAPTOPS Y PANTALLAS MEDIANAS (1024px - 1366px) ===== */
@media (min-width: 1024px) and (max-width: 1366px) {
    section {
        /* Reducir padding en laptops */
        padding: 3rem 1rem;
        /* Ajustar margen superior */
        scroll-margin-top: 100px;
    }
    
    .tech-section {
        padding: 60px 20px;
    }
    
    .tech-section h2 {
        font-size: 2.2em;
        margin-bottom: 15px;
    }
    
    h2 {
        font-size: 2.5rem;
    }
}

/* ===== TABLETS (640px - 768px) ===== */
@media (min-width: 640px) {
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== DESKTOP PEQUEÑO (768px - 1024px) ===== */
@media (min-width: 768px) {
    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== DESKTOP GRANDE (1024px+) ===== */
@media (min-width: 1024px) {
    .tech-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    h2 {
        font-size: 3rem;
    }
}

/* ===== TABLETS Y MENORES (max-width: 768px) ===== */
@media (max-width: 768px) {
    section {
        /* Reducir padding en tablets */
        padding: 2rem 1rem;
        scroll-margin-top: 70px;
    }
    
    .tech-section h2 {
        font-size: 2em;
    }

    .tech-grid {
        grid-template-columns: 1fr;
    }

    #mobileMenu a {
        display: block;
        padding: 8px 0;
        text-align: center;
    }

    html,
    body {
        scroll-snap-type: y mandatory;
        scroll-behavior: smooth;
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
}

/* ===== DISPOSITIVOS MÓVILES (max-width: 767px) ===== */
@media (max-width: 767px) {
    html,
    body {
        scroll-snap-type: none;
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
    
    section {
        padding: 2rem 0.5rem;
        scroll-margin-top: 60px;
    }
}

/* ===== MÓVILES PEQUEÑOS (max-width: 640px) ===== */
@media (max-width: 640px) {
    .service-card {
        min-height: auto;
    }

    .service-details.active {
        max-height: 1200px;
    }
}

/* ===== MÓVILES MUY PEQUEÑOS (max-width: 480px) ===== */
@media (max-width: 480px) {
    section {
        padding: 1.5rem 0.5rem;
        scroll-margin-top: 60px;
    }
}