/* ==========================================
   1. RESET Y BASE (EVITAR DESBORDAMIENTO)
   ========================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    overflow-x: hidden; /* Esto elimina la pantalla ancha */
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
}

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

:root {
    --naranja: #FF6600;
    --negro-puro: #000000;
    --blanco: #ffffff;
    --azul-link: #4CB1FC;
}

/* ==========================================
   2. HEADER Y NAVEGACIÓN
   ========================================== */
header {
    background: #1f1f1f;
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 9999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

header nav {
    max-width: 1250px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 25px;
}

.logo img { height: 40px; border-radius: 8px; }

/* Menú Escritorio */
.nav-links { display: flex; list-style: none; gap: 2rem; }
.nav-links a { text-decoration: none; color: var(--blanco); font-weight: 500; }

/* Botón Hamburguesa (Oculto en escritorio) */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}
.menu-toggle span { width: 25px; height: 3px; background: var(--blanco); }

/* ==========================================
   3. RESPONSIVE Y MENÚ MÓVIL
   ========================================== */
@media (max-width: 768px) {
    /* 1. Asegura que el móvil no se desplace lateralmente */
    body, html {
        overflow-x: hidden;
        width: 100%;
    }

    /* 2. Botón Hamburguesa */
    .menu-toggle { 
        display: flex !important; 
        position: absolute; 
        right: 15px; 
        top: 20px; 
    }

    /* 3. Menú Desplegable (Posición fija para evitar el ancho de 1250px) */
    .nav-links {
        display: none; 
        position: fixed; /* Cambiado de absolute a fixed */
        top: 80px;
        left: 0;
        width: 100vw; /* Ocupa el 100% de la ventana, no del contenedor */
        height: calc(100vh - 80px);
        background: #1f1f1f;
        flex-direction: column;
        padding: 20px;
        text-align: center;
        z-index: 9999;
    }

    .nav-links.active { display: flex !important; }
    
    /* 4. Forzar color blanco en los links */
    .nav-links a { color: #ffffff !important; font-size: 1.2rem; }
    
    .nav-links li { padding: 15px 0; border-bottom: 1px solid #333; width: 100%; }
    
    /* 5. Evitar que el grid rompa el ancho */
    .grid-servicios { grid-template-columns: 1fr !important; width: 100% !important; }
}

/* ==========================================
   4. SECCIONES Y COMPONENTES
   ========================================== */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #111; color: white; text-align: center; }

.grid-servicios {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1250px;
    margin: 0 auto;
    padding: 50px 25px;
}

.card-servicio { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.card-servicio img { width: 100%; height: 250px; object-fit: cover; }
.card-body { padding: 20px; }

footer { background: #000; color: #fff; text-align: center; padding: 50px 0; }