/* =========================================
   VARIABLES CORPORATIVAS
========================================= */
:root {
    --color-primary: #9B1B30; /* Rojo Soland */
    --color-dark: #121212;
    --color-light: #F4F4F4;
    --color-gray: #222222;
    --header-height: 190px; /* Ajuste exacto para la nueva barra gigante */
}

/* =========================================
   ANIMACIONES (KEYFRAMES)
========================================= */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* =========================================
   CONFIGURACIÓN GENERAL
========================================= */
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height); 
}

body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-light);
    color: var(--color-dark);
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    margin-top: 0;
}

/* =========================================
   NAVEGACIÓN (HEADER) Y LOGO - ESCRITORIO
========================================= */
header {
    position: fixed;
    width: 100%;
    background-color: #ffffff;
    z-index: 1000;
    border-bottom: 3px solid var(--color-primary);
    top: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    margin-left: 40px;
}

.logo img {
    height: 170px;
    width: auto;
    object-fit: contain;
    display: block;
}

.menu-toggle {
    display: none;
}

.nav-menu {
    margin-right: 40px;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu ul li a {
    color: var(--color-dark);
    text-decoration: none;
    margin-left: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    display: block;
    padding: 10px 0;
}

.nav-menu ul li a:hover {
    color: var(--color-primary);
}

/* =========================================
   SECCIÓN HERO (PORTADA PRINCIPAL)
========================================= */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(18, 18, 18, 0.7), rgba(18, 18, 18, 0.85)), url('/img/fondo-andamios.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    text-align: center;
    /* CAMBIO CLAVE: Padding top dinámico para empujar el texto debajo de la barra gigante */
    padding: var(--header-height) 20px 0 20px; 
    box-sizing: border-box; /* Evita que el padding rompa la altura 100vh */
    position: relative;
}

.hero-overlay h1 {
    font-size: 4.5rem;
    margin-bottom: 15px;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    animation: fade-in-up 1s ease-out forwards;
    opacity: 0;
}

.hero-overlay p {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: #dddddd;
    line-height: 1.6;
    animation: fade-in-up 1s ease-out 0.5s forwards;
    opacity: 0;
}

/* =========================================
   COMPONENTES (BOTONES, DIVISORES, FLECHA)
========================================= */
.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 15px 40px;
    border: none;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(155, 27, 48, 0.4);
    animation: fade-in-up 1s ease-out 1s forwards;
    opacity: 0;
}

.btn-primary:hover {
    background-color: #7a1525;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(155, 27, 48, 0.6);
    color: #ffffff;
}

.divider {
    height: 4px;
    width: 70px;
    background-color: var(--color-primary);
    margin-bottom: 40px;
}

.scroll-down-arrow {
    position: absolute;
    bottom: 30px;
    left: 40px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    text-decoration: none;
    animation: float 2s ease-in-out infinite, fade-in-up 1s ease-out 1.5s forwards;
    opacity: 0;
    z-index: 10;
}

/* =========================================
   BOTÓN FLOTANTE DE WHATSAPP
========================================= */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 35px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #1ebe57;
    transform: scale(1.1);
    color: #FFF;
}

/* =========================================
   ESTRUCTURA DE SECCIONES
========================================= */
.content-section {
    padding: 120px 20px 100px 20px;
}

.dark-bg {
    background-color: var(--color-gray);
    color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.content-section h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

/* =========================================
   GRILLAS Y TARJETAS (SERVICIOS)
========================================= */
.grid-servicios, .grid-contacto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.card-servicio {
    background-color: #ffffff;
    color: var(--color-dark);
    padding: 50px 30px;
    border-top: 5px solid var(--color-primary);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.card-servicio:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card-servicio i {
    font-size: 3.5rem;
    color: var(--color-primary);
    margin-bottom: 25px;
}

.card-servicio h3 {
    font-size: 1.3rem;
    color: var(--color-dark);
    margin-bottom: 15px;
}

.card-servicio p {
    line-height: 1.6;
    color: #555555;
    margin-bottom: 0;
}

.dark-bg .card-servicio {
    background-color: #1a1a1a;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.dark-bg .card-servicio h3 { color: #ffffff; }
.dark-bg .card-servicio p { color: #aaaaaa; }

/* =========================================
   FORMULARIO Y CONTACTO
========================================= */
.info-contacto p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.info-contacto strong {
    color: var(--color-primary);
    margin-right: 5px;
}

.info-contacto i {
    width: 30px;
    color: var(--color-primary);
    font-size: 1.2rem;
}

form {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

input, textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #dddddd;
    background-color: #f9f9f9;
    box-sizing: border-box;
    border-radius: 4px;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: #ffffff;
}

/* =========================================
   PIE DE PÁGINA (FOOTER)
========================================= */
footer {
    background-color: var(--color-dark);
    color: #aaaaaa;
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid #333;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* ==================================================================
   MEDIA QUERIES - OPTIMIZACIÓN PARA MÓVILES Y TABLETS
   ================================================================== */

@media screen and (max-width: 992px) {
    .logo { margin-left: 20px; }
    .nav-menu { margin-right: 20px; }
    .hero-overlay h1 { font-size: 3.5rem; }
    .scroll-down-arrow { left: 20px; }
}

@media screen and (max-width: 768px) {
    
    .content-section { padding: 80px 20px 60px 20px; }
    .content-section h2 { font-size: 2rem; text-align: center; }
    .divider { margin: 0 auto 30px auto; }

    header { padding: 0; } 
    
    .logo { margin-left: 5px; } 
    .logo img { height: 170px; } 

    /* CAMBIO CLAVE: Estilos del botón Hamburguesa para que parezca un botón real */
    .menu-toggle {
        display: block; 
        cursor: pointer;
        background-color: var(--color-primary); /* Fondo rojo */
        border: none;
        margin-right: 15px;
        padding: 12px 10px; /* Más padding para hacerlo cuadrado/rectangular */
        border-radius: 5px; /* Bordes suaves */
        z-index: 1100;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Sombra sutil */
    }

    .menu-toggle .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        transition: all 0.3s ease-in-out;
        background-color: #ffffff; /* Líneas blancas sobre el fondo rojo */
        border-radius: 2px;
    }

    /* Animación del botón activo (líneas siguen siendo blancas) */
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); background-color: #ffffff; }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); background-color: #ffffff; }

    .nav-menu {
        position: absolute;
        top: 100%; 
        left: 0;
        width: 100%;
        height: 100vh; 
        background-color: rgba(255, 255, 255, 0.98);
        margin: 0;
        display: block;
        transition: all 0.5s ease;
        transform: translateX(100%); 
        opacity: 0;
        border-top: 1px solid #eee;
        z-index: 1050;
        overflow-y: auto; 
    }

    .nav-menu.active {
        transform: translateX(0); 
        opacity: 1;
    }

    .nav-menu ul {
        flex-direction: column; 
        align-items: center;
        padding-top: 50px; 
    }

    .nav-menu ul li {
        width: 100%;
        text-align: center;
    }

    .nav-menu ul li a {
        margin: 0;
        padding: 20px 0;
        font-size: 1.2rem; 
        border-bottom: 1px solid #eee;
    }
    
    .nav-menu ul li:last-child a { border-bottom: none; }

    .hero-section { background-attachment: scroll; } 
    .hero-overlay h1 { font-size: 2.5rem; letter-spacing: 1px; }
    .hero-overlay p { font-size: 1.1rem; margin-bottom: 30px; }
    .btn-primary { padding: 12px 30px; font-size: 0.9rem; }
    
    .scroll-down-arrow {
        display: block; 
        position: absolute;
        bottom: 30px;
        left: 50%; 
        transform: translateX(-50%); 
        font-size: 2rem;
        color: white;
        cursor: pointer;
        text-decoration: none;
        animation: float 2s ease-in-out infinite, fade-in-up 1s ease-out 1.8s forwards;
        opacity: 0; 
        z-index: 10;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 30px;
    }

    .grid-servicios, .grid-contacto {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .card-servicio { padding: 40px 20px; }
    .card-servicio i { font-size: 3rem; }

    .info-contacto { text-align: center; margin-bottom: 20px; }
    .info-contacto p { justify-content: center; font-size: 1rem; }
    
    form { padding: 30px 20px; }
}

@media screen and (max-width: 480px) {
    .hero-overlay h1 { font-size: 2rem; }
    .content-section h2 { font-size: 1.8rem; }
}