/* ==========================================================================
   1. VARIABLES DE COLOR Y FUENTES (Optimizado para legibilidad y marca)
   ========================================================================== */
:root {
    --bg-principal: #FFFFFF;       /* Fondo blanco impoluto */
    --bg-secundario: #F5F7FA;      /* Fondo gris claro corporativo para bloques */
    --texto-titulos: #1E3550;      /* Azul oscuro profundo (de tu logo) para máxima jerarquía */
    --texto-cuerpo: #2D3748;       /* Gris carbón oscuro para una lectura descansada */
    --texto-mutado: #627285;       /* Gris medio para descripciones secundarias */
    --accent-gold: #D4AF37;        /* Dorado sutil para detalles de calidad */
    --accent-blue: #2B4C6F;        /* Azul medio para botones y enlaces de acción */
    --accent-blue-hover: #152536;  /* Azul noche para estados interactivos */
    --borde-suave: #E2E8F0;        /* Separadores limpios */
    --whatsapp-green: #25D366;     /* Verde WhatsApp */
    
    /* Tipografías de Alta Gama */
    --fuente-titulos: 'Cinzel', serif;
    --fuente-cuerpo: 'Inter', sans-serif;
    --sombra-premium: 0 12px 24px rgba(43, 76, 111, 0.04);
}

/* ==========================================================================
   2. ESTILOS BASE Y RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--fuente-cuerpo);
    background-color: var(--bg-principal);
    color: var(--texto-cuerpo);
    line-height: 1.7; /* Mayor espacio entre líneas para facilitar la lectura */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-transform: none;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* ==========================================================================
   3. CABECERA, LOGO AGRANDADO Y MENÚ (Optimizado para visibilidad máxima)
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--borde-suave);
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02); /* Sutil separación del fondo */
}

.header-container {
    max-width: 1300px; /* Un poco más ancho para dar aire */
    margin: 0 auto;
    padding: 5px 24px; /* Reducido el padding vertical para que la barra no sea gigantesca */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Ajustes masivos para el logotipo cuadrado */
.brand-logo {
    display: flex;
    align-items: center;
}

.brand-logo .logo-img {
    height: 140px; /* ¡Aumentado drásticamente para que se lea "CRUBRI" a la perfección! */
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
    margin-top: -5px; /* Ajuste milimétrico de posición */
    margin-bottom: -5px;
}

.brand-logo .logo-img:hover {
    transform: scale(1.04); /* Efecto interactivo premium */
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 35px;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--texto-titulos);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    position: relative;
    padding: 8px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-blue);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-blue);
    transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.contact-btn-nav {
    background-color: var(--accent-blue);
    color: #FFFFFF !important;
    padding: 12px 24px !important;
    border-radius: 4px;
    letter-spacing: 1px;
}

.contact-btn-nav:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-1px);
}

.contact-btn-nav::after { display: none !important; }

/* Menú móvil */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--texto-titulos);
}

/* ==========================================================================
   4. PORTADA (HERO CON FILTRO DE CLARIDAD MEJORADO)
   ========================================================================== */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    overflow: hidden;
    background-color: #000;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradiente blanco estratégico para que el texto resalte de forma excelente */
    background: linear-gradient(to bottom, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.75) 100%);
    z-index: 2;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 850px;
}

.hero-subtitle {
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--accent-blue);
    display: inline-block;
    margin-bottom: 20px;
}

.hero-title {
    font-family: var(--fuente-titulos);
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--texto-titulos);
    line-height: 1.3;
    margin-bottom: 25px;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--texto-cuerpo);
    margin-bottom: 40px;
    font-weight: 400;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    display: inline-block;
    padding: 16px 36px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #FFFFFF;
    border: 1px solid var(--accent-blue);
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    border-color: var(--accent-blue-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--texto-titulos);
    border: 1px solid var(--texto-titulos);
}

.btn-secondary:hover {
    background-color: var(--texto-titulos);
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* ==========================================================================
   5. SECCIONES Y TARJETAS DE SERVICIOS
   ========================================================================== */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 20px 80px;
}

.services-section {
    background-color: var(--bg-principal);
}

.section-header {
    text-align: center;
    margin-bottom: 70px;
}

.section-subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent-blue);
    letter-spacing: 3px;
}

.section-title {
    font-family: var(--fuente-titulos);
    font-size: 2.4rem;
    color: var(--texto-titulos);
    margin-top: 12px;
    font-weight: 700;
}

.title-divider {
    width: 50px;
    height: 3px;
    background-color: var(--accent-gold);
    margin: 20px auto 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--bg-secundario);
    padding: 45px 35px;
    border-radius: 6px;
    border: 1px solid var(--borde-suave);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.service-card:hover {
    transform: translateY(-4px);
    background-color: #FFFFFF;
    box-shadow: var(--sombra-premium);
    border-color: var(--accent-blue);
}

.service-icon {
    font-size: 2.2rem;
    margin-bottom: 25px;
    display: inline-block;
}

.service-card-title {
    font-family: var(--fuente-cuerpo);
    font-size: 1.25rem;
    color: var(--texto-titulos);
    margin-bottom: 15px;
    font-weight: 700;
}

.service-card-text {
    color: var(--texto-cuerpo);
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ==========================================================================
   6. GALERÍA DE PROYECTOS REALES
   ========================================================================== */
.gallery-section {
    background-color: var(--bg-secundario);
    border-top: 1px solid var(--borde-suave);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.gallery-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    height: 320px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 25px;
    background: linear-gradient(to top, rgba(30, 53, 80, 0.95) 0%, rgba(30, 53, 80, 0.4) 70%, transparent 100%);
    color: #FFFFFF;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-item:hover .gallery-info {
    transform: translateY(0);
    opacity: 1;
}

.gallery-info h3 {
    font-family: var(--fuente-titulos);
    font-size: 1.3rem;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.gallery-info p {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* ==========================================================================
   7. SECCIÓN CTA (LLAMADA A LA ACCIÓN)
   ========================================================================== */
.cta-section {
    background-color: var(--texto-titulos);
    color: #FFFFFF;
    text-align: center;
    padding: 100px 20px;
}

.cta-container {
    max-width: 750px;
    margin: 0 auto;
}

.cta-section h2 {
    font-family: var(--fuente-titulos);
    font-size: 2.6rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 40px;
    opacity: 0.85;
}

.cta-whatsapp-btn {
    background-color: var(--whatsapp-green) !important;
    border-color: var(--whatsapp-green) !important;
    color: #FFFFFF !important;
    font-size: 0.95rem;
}

.cta-whatsapp-btn:hover {
    background-color: #20ba56 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.cta-phone-text {
    margin-top: 30px !important;
    font-size: 0.95rem !important;
    opacity: 0.8;
}

/* ==========================================================================
   8. PIE DE PÁGINA (FOOTER CORPORATIVO)
   ========================================================================== */
.footer {
    background-color: #FFFFFF;
    color: var(--texto-titulos);
    padding: 70px 20px 30px;
    border-top: 1px solid var(--borde-suave);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    padding-bottom: 50px;
    border-bottom: 1px solid var(--borde-suave);
}

.footer-brand {
    max-width: 450px;
}

.footer-brand h3 {
    font-family: var(--fuente-titulos);
    font-size: 1.1rem;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: var(--accent-blue);
}

.footer-brand p {
    color: var(--texto-mutado);
    font-size: 0.9rem;
}

.footer-links h4 {
    font-size: 0.95rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links a {
    display: block;
    color: var(--texto-mutado);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.footer-links a:hover {
    color: var(--accent-blue);
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    color: var(--texto-mutado);
    font-size: 0.85rem;
}

/* ==========================================================================
   9. COMPONENTES INTERACTIVOS (Boton Flotante, Modales)
   ========================================================================== */
.whatsapp-floating-btn {
    position: fixed;
    bottom: 35px;
    right: 35px;
    background-color: var(--whatsapp-green);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    z-index: 999;
    transition: all 0.3s ease;
}

.whatsapp-floating-btn:hover {
    transform: scale(1.08);
    background-color: #20ba56;
}

.whatsapp-icon {
    width: 30px;
    height: 30px;
    fill: #FFFFFF;
}

.modal-overlay, .lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background-color: #FFFFFF;
    color: var(--texto-cuerpo);
    padding: 45px;
    max-width: 650px;
    width: 90%;
    border-radius: 6px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-close, .lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--texto-titulos);
    cursor: pointer;
}

.lightbox-close { color: #FFFFFF; }

.lightbox-content {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    border: 4px solid #FFFFFF;
}

/* ==========================================================================
   10. RESPONSIVE (MÓVILES)
   ========================================================================== */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #FFFFFF;
        flex-direction: column;
        padding: 40px 30px;
        gap: 25px;
        box-shadow: 0 15px 25px rgba(0,0,0,0.05);
        display: none;
    }
    
    .nav-menu.active { display: flex; }
    
    .brand-logo .logo-img {
        height: 65px; /* Reducción elegante en pantallas pequeñas */
    }
    
    .hero-title { font-size: 2rem; }
    .hero-description { font-size: 1rem; }
    .hero-actions { flex-direction: column; gap: 15px; }
    .section-title { font-size: 1.9rem; }
}