/* =========================================
   1. VARIABLES GLOBALES (Colores y Espacios)
   ========================================= */
:root {
    --color-fondo: #fcfaf7; /* Crema muy claro */
    --color-texto: #333333;
    --color-verde: #95c11f; /* Verde Corporativo Baltinsa */
    --color-azul-oscuro: #1b3951; /* Footer y Textos fuertes */
    --color-dorado: #c99c39; /* Antigreto */
    
    --font-sans: 'Bahnschrift', 'Roboto', 'Montserrat', sans-serif;
    
    --margen-lateral: 15vw; /* Margen del 15% solicitado */
}

/* Responsive: Reducción de márgenes en pantallas pequeñas */
@media (max-width: 1024px) { :root { --margen-lateral: 8vw; } }
@media (max-width: 768px) { :root { --margen-lateral: 5vw; } }

/* =========================================
   2. RESET Y TIPOGRAFÍA BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-fondo);
    color: var(--color-texto);
    line-height: 1.6;
    overflow-x: hidden;
    /* Inicio oculto para el efecto de entrada suave */
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

body.loaded {
    opacity: 1; /* Aparece cuando el preloader termina */
}

h1, h2, h3, h4 {
    color: var(--color-azul-oscuro);
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* =========================================
   3. PRELOADER (Pantalla de carga)
   ========================================= */
#preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--color-fondo);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

/* Animación de latido del logo en el preloader y home */
@keyframes latidoBrillo {
    0% { transform: scale(1); filter: drop-shadow(0 0 0px rgba(200, 156, 57, 0)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(200, 156, 57, 0.4)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0px rgba(200, 156, 57, 0)); }
}

.latido-antigreto {
    animation: latidoBrillo 2.5s infinite ease-in-out;
    width: 150px;
}

/* =========================================
   4. CABECERA Y NAVEGACIÓN (HEADER)
   ========================================= */
header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 25px var(--margen-lateral);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background-color: transparent;
    color: #ffffff; /* Letras blancas sobre fotos */
    transition: all 0.4s ease;
}

/* Estado cuando se hace scroll */
header.scrolled {
    background-color: #ffffff;
    color: var(--color-azul-oscuro);
    padding: 15px var(--margen-lateral);
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.logo-header img {
    height: 40px;
    transition: filter 0.4s ease;
}
/* Al hacer scroll, invertimos el logo blanco a oscuro (si fuera necesario) */
header.scrolled .logo-header img.logo-blanco {
    filter: invert(1) brightness(0.2); 
}

/* Menú Idiomas y Navegación */
.nav-container { display: flex; align-items: center; gap: 40px; }

.idiomas a {
    font-size: 0.85rem;
    font-weight: bold;
    margin-right: 10px;
    opacity: 0.6;
}
.idiomas a.active, .idiomas a:hover { opacity: 1; color: var(--color-verde); }

nav ul { list-style: none; display: flex; gap: 30px; }
nav ul li a { font-size: 0.9rem; font-weight: 500; text-transform: uppercase; }
nav ul li a:hover { color: var(--color-verde); }

/* Hamburguesa (Móvil) */
.hamburger { display: none; cursor: pointer; flex-direction: column; gap: 5px; }
.hamburger span { width: 25px; height: 2px; background-color: currentColor; transition: 0.3s; }

/* =========================================
   5. EFECTOS PARALLAX Y HERO
   ========================================= */
.bg-parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Desactivar Parallax en móviles por rendimiento en iOS */
@media (max-width: 768px) { .bg-parallax { background-attachment: scroll; } }

/* =========================================
   6. ANIMACIONES DE SCROLL (REVEAL)
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   7. BOTONES
   ========================================= */
.btn-verde {
    display: inline-block;
    background-color: var(--color-verde);
    color: #ffffff !important;
    padding: 15px 40px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.3s, transform 0.2s;
}
.btn-verde:hover {
    background-color: #7da518; /* Verde más oscuro */
    transform: translateY(-3px);
}

/* =========================================
   8. FOOTER CORPORATIVO
   ========================================= */
footer {
    background-color: var(--color-azul-oscuro);
    color: #ffffff;
    padding: 60px var(--margen-lateral) 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    align-items: start;
}
.footer-grid h4 { color: var(--color-verde); margin-bottom: 20px; font-size: 1rem;}
.footer-grid p, .footer-grid a { color: rgba(255,255,255,0.7); font-size: 0.85rem; font-weight: 300;}
.footer-grid a:hover { color: var(--color-verde); }
.footer-logo img { height: 40px; filter: brightness(0) invert(1); margin-bottom: 15px;}
.footer-logo-antigreto img { height: 35px; filter: brightness(0) invert(1); opacity: 0.8;}

/* =========================================
   9. MENÚ MÓVIL (MEDIA QUERIES)
   ========================================= */
@media (max-width: 768px) {
    .hamburger { display: flex; z-index: 1001;}
    .nav-menu {
        position: fixed; top: 0; right: -100%; width: 80%; height: 100vh;
        background-color: #ffffff; color: var(--color-azul-oscuro);
        flex-direction: column; justify-content: center; align-items: center;
        transition: 0.4s ease-in-out; box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    }
    .nav-menu.active { right: 0; }
    .nav-menu ul { flex-direction: column; text-align: center; gap: 40px;}
    
    /* Animación Hamburguesa a Cruz */
    .hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}