/* IMPORTANTE: Configuración Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    /* EMPUJAMOS EL CONTENIDO: Al usar fixed, debemos dar espacio arriba 
       para que el Hero no se esconda detrás del menú */
    padding-top: 110px !important; 
}

/* En móviles el padding es menor porque ocultamos la top-bar */
@media (max-width: 768px) {
    body {
        padding-top: 70px !important; 
    }
}

/* ======================================================
    NUEVO: Contenedor Padre (USAMOS FIXED)
====================================================== */
.header-wrapper {
    /* Fixed asegura que el componente flote sobre el index.html */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9999 !important; /* Prioridad máxima sobre cualquier sección */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: block !important;
}
/* ======================================================
    1. TOP BAR - Datos de Contacto (CORREGIDO Y COMPLETO)
====================================================== */
.top-bar {
    background-color: var(--dark-light); 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
    font-size: 0.85rem;
    padding: 8px 5%;
    position: relative; 
    width: 100%;
}

.top-bar-container {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- LADO IZQUIERDO: Datos (Tel, Mail, Dir) --- */
.top-bar .contact-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 20px !important;
}

.top-bar .contact-info a, 
.top-bar .contact-info span {
    color: var(--text-gray);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap; /* Evita que el texto baje */
}

/* Reset específico para iconos de contacto (para que no sean cuadros verdes) */
.top-bar .contact-info i {
    width: auto !important;
    height: auto !important;
    background: none !important;
    box-shadow: none !important;
    font-size: 0.9rem !important;
    color: var(--accent) !important; /* Azul/Verde técnico */
    display: inline-block !important;
}

.top-bar .contact-info a:hover {
    color: #25d366; 
}

/* --- LADO DERECHO: Redes Sociales --- */
.top-bar .social-icons {
    display: flex !important;
    gap: 15px !important;
    align-items: center !important;
}

.top-bar .social-icons a {
    color: var(--text-gray) !important;
    text-decoration: none;
    font-size: 1rem !important;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    /* Aseguramos que no hereden fondos ni tamaños raros */
    width: auto !important;
    height: auto !important;
    background: none !important;
    box-shadow: none !important;
}

/* Hover para redes sociales */
.top-bar .social-icons a:hover {
    color: #25d366 !important; 
    transform: translateY(-2px);
}

/* Responsive: Ocultar en móviles */
@media (max-width: 768px) {
    .top-bar {
        display: none;
    }
}
/* ======================================================
    2. NAVBAR - ElectricJoscam
====================================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 5%;
    background: var(--navbar-bg);
    
    /* Relative respecto al .header-wrapper */
    position: relative !important; 
    width: 100% !important;
    z-index: 9998;
    border-bottom: 3px solid var(--accent);
}

.logo, .nav-social {
    flex: 1; 
    display: flex;
    align-items: center;
}

.nav-links {
    flex: 2;
    display: flex;
    justify-content: center;
    list-style: none;
    align-items: center;
}

.logo-img {
    height: 55px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.nav-links li a {
    color: var(--white);
    text-decoration: none;
    margin: 0 1rem;
    transition: 0.3s;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.nav-links li a:hover {
    color: var(--accent);
}

.nav-links li a.active {
    color: var(--accent);
    font-weight: 900;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
}

.btn-contacto {
    background: var(--accent);
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    color: #ffffff !important;
    text-decoration: none;
}

/* Ajuste adicional para el anclaje de secciones */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 140px; 
}




/* ======================================================
    7. MENU MÓVIL (Hamburguesa y Overlay) - Optimizado
====================================================== */

/* Botón hamburguesa: Visible solo en móviles mediante Media Query */
.mobile-menu-btn {
    display: none; /* Se activa en el media query abajo */
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2001; /* Asegura visibilidad sobre otros elementos */
    padding: 10px;
    line-height: 1;
}

.mobile-menu-btn:hover {
    color: var(--accent);
}

/* Menú lateral (Overlay) */
.mobile-overlay {
    position: fixed;
    top: 0;
    right: -100%; /* Escondido a la derecha */
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--dark-light);
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
    
    /* Bajamos el contenido para que empiece DEBAJO de la navbar */
    padding: 140px 40px 40px 40px !important; 
    
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    visibility: hidden; /* Evita clics accidentales mientras está oculto */
    overflow-y: auto; /* Permite scroll si hay muchos links */
}

/* Estado activo: Se desliza desde la derecha */
.mobile-overlay.active {
    right: 0 !important;
    visibility: visible !important;
}

/* Botón de cerrar (X) */
.close-menu {
    position: absolute;
    top: 40px !important; /* Bajamos la X considerablemente para que no se tape */
    right: 30px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2.8rem;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
    transition: color 0.3s ease;
}

.close-menu:hover {
    color: var(--accent);
}

/* Lista de enlaces móviles */
.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0; /* Margen extra superior */
}

.mobile-nav-links li {
    margin-bottom: 30px;
    opacity: 0;
    transform: translateX(20px);
    transition: 0.4s ease;
}

/* Animación de entrada escalonada cuando se activa */
.mobile-overlay.active .mobile-nav-links li {
    opacity: 1;
    transform: translateX(0);
}

.mobile-overlay.active li:nth-child(1) { transition-delay: 0.1s; }
.mobile-overlay.active li:nth-child(2) { transition-delay: 0.2s; }
.mobile-overlay.active li:nth-child(3) { transition-delay: 0.3s; }
.mobile-overlay.active li:nth-child(4) { transition-delay: 0.4s; }
.mobile-overlay.active li:nth-child(5) { transition-delay: 0.5s; }

.mobile-nav-links li a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    transition: color 0.3s ease;
}

.mobile-nav-links li a:hover {
    color: var(--accent);
    padding-left: 10px;
}

/* --- RESPONSIVE - FORZAR VISIBILIDAD --- */
@media (max-width: 968px) {
    .nav-links {
        display: none !important; 
    }

    .mobile-menu-btn {
        display: flex !important; /* Forzamos flex para centrar icono */
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    /* Aseguramos que el contenedor padre no corte el botón */
    .navbar {
        overflow: visible !important;
    }
}
