:root {
    --primary: #0f172a;
    --brand-blue: #1565c0;       /* Azul corporativo del logo CN */
    --brand-blue-dark: #0d47a1;
    --accent: #ca8a04;           /* Dorado/ámbar premium */
    --accent-light: #facc15;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px -15px rgba(0, 0, 0, 0.2);
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --gradient-accent: linear-gradient(135deg, #ca8a04 0%, #eab308 100%);
    --gradient-brand: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
}
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4rem; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }

img { max-width: 100%; border-radius: 12px; }

.section-title {
    font-size: 3rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title.center {
    display: block;
    text-align: center;
}

.highlight {
    color: var(--accent);
    position: relative;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--accent);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--accent);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(202, 138, 4, 0.2);
}

.btn-outline {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: transparent;
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    border: 2px solid var(--white);
    transition: var(--transition);
}

.btn-outline:hover {
    background-color: var(--white);
    color: var(--primary);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.1);
    border-top: 5px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    padding: 1rem 0;
    background: var(--white);
    box-shadow: 0 2px 20px rgba(21, 101, 192, 0.12);
    border-bottom: 3px solid var(--brand-blue);
}

.navbar.scrolled {
    background: var(--glass);
    backdrop-filter: blur(12px);
    padding: 0.8rem 0;
    box-shadow: 0 4px 24px rgba(21, 101, 192, 0.18);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-blue);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--brand-blue);
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
}

/* Mobile Menu Improvements */
@media (max-width: 992px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--primary);
        flex-direction: column;
        justify-content: center;
        transition: var(--transition);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        display: flex !important; /* Always flex but hidden by right -100% */
    }

    .nav-links.active-mobile {
        right: 0;
    }

    .nav-links a {
        color: var(--white);
        font-size: 1.5rem;
    }
}

/* Hero */
.hero {
    height: 100vh;
    background:
        linear-gradient(
            160deg,
            rgba(13, 71, 161, 0.82) 0%,
            rgba(15, 23, 42, 0.88) 60%,
            rgba(15, 23, 42, 0.95) 100%
        ),
        url('../images/hero_bg.png') center/cover no-repeat;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: center;
    position: relative;
    padding-top: 80px; /* compensar navbar fija */
}

.hero h1 {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.5rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
    opacity: 0.9;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--white);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--white);
    border-radius: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 20px); opacity: 0; }
}

/* Stats */
.stats {
    padding: 4rem 0;
    background: var(--primary);
    color: var(--white);
    margin-top: -60px;
    position: relative;
    z-index: 10;
    border-radius: 20px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    text-align: center;
}

.stat-card h3 {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* Nosotros */
.nosotros-section {
    padding: 10rem 0;
}

.brushed-img {
    box-shadow: 20px 20px 0 var(--accent);
}

.features-list {
    list-style: none;
    margin-top: 2rem;
}

.features-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.features-list i {
    color: var(--accent);
    font-size: 1.2rem;
}

/* Servicios */
.servicios-section {
    padding: 8rem 0;
    background-color: #fff;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.service-card {
    background: var(--bg-light);
    padding: 3rem 2rem;
    border-radius: 20px;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.icon-box {
    width: 70px;
    height: 70px;
    background: var(--accent);
    color: var(--white);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.service-card:hover .icon-box {
    background: var(--white);
    color: var(--accent);
}

/* Videos */
.videos-section {
    padding: 8rem 0;
    background: #f1f5f9;
}

.video-container {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Gallery */
.portafolio-section {
    padding: 8rem 0;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.8rem 2rem;
    border: none;
    background: var(--white);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--accent);
    color: var(--white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    height: 400px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent, var(--primary));
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay { bottom: 0; }
.gallery-item:hover img { transform: scale(1.1); }

.gallery-overlay span {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Blog */
.blog-section { padding: 8rem 0; background: #fff; }

.blog-card {
    border-radius: 20px;
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.blog-card:hover { transform: translateY(-5px); }

.blog-card img { border-radius: 0; height: 250px; width: 100%; object-fit: cover; }

.blog-content { padding: 2rem; }

.blog-content .date { color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-bottom: 1rem; display: block; }

.blog-content h3 { margin-bottom: 1rem; font-size: 1.5rem; }

.read-more { color: var(--primary); text-decoration: none; font-weight: 700; display: inline-block; margin-top: 1.5rem; border-bottom: 2px solid var(--accent); }

/* Contacto */
.contacto-section {
    padding: 8rem 0;
    background: var(--primary);
    color: var(--white);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.contact-item i { color: var(--accent); font-size: 1.5rem; }

.social-links { display: flex; gap: 1.5rem; margin-top: 3rem; }
.social-links a { color: var(--white); font-size: 1.8rem; transition: var(--transition); }
.social-links a:hover { color: var(--accent); transform: scale(1.2); }

#contact-form input, #contact-form textarea {
    width: 100%;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    border: none;
    background: rgba(255,255,255,0.05);
    color: var(--white);
    font-family: inherit;
}

#contact-form input:focus, #contact-form textarea:focus {
    outline: 2px solid var(--accent);
    background: rgba(255,255,255,0.1);
}

/* WhatsApp */
.whatsapp-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: #25d366;
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    text-decoration: none;
    transition: var(--transition);
}

.whatsapp-btn:hover { transform: scale(1.1); }

.tooltip {
    position: absolute;
    right: 90px;
    background: var(--white);
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.whatsapp-btn:hover .tooltip { opacity: 1; }

/* Footer */
footer { padding: 4rem 0; background: #080c16; color: rgba(255,255,255,0.5); }

/* ===========================
   MÓVIL — breakpoints
=========================== */

/* Tablet y móvil grande */
@media (max-width: 992px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .section-title { font-size: 2.2rem; }

    /* Navbar */
    .navbar { padding: 0.75rem 0; }
    .logo img { height: 42px; }
    .nav-links { display: none; } /* se muestra vía JS con clase active-mobile */
    .menu-toggle {
        display: block;
        color: var(--brand-blue);
        font-size: 1.6rem;
    }

    /* Hero */
    .hero {
        height: auto;
        min-height: 100svh;
        padding-top: 70px;
        padding-bottom: 4rem;
    }
    .hero h1 {
        font-size: 2.4rem;
        line-height: 1.15;
        word-break: break-word;
        overflow-wrap: break-word;
        padding: 0 1rem;
    }
    .hero p {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    .hero-btns {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .btn-primary,
    .btn-outline {
        padding: 0.85rem 2rem;
        font-size: 0.95rem;
    }

    /* Stats */
    .stats { margin-top: -30px; padding: 2.5rem 1rem; }
    .stat-card h3 { font-size: 2.2rem; }

    /* Nosotros */
    .nosotros-section { padding: 5rem 0; }
    .brushed-img { box-shadow: 10px 10px 0 var(--accent); }

    /* Servicios */
    .servicios-section { padding: 5rem 0; }
    .services-grid { grid-template-columns: 1fr; }

    /* Videos */
    .videos-section { padding: 5rem 0; }
    .video-container iframe { height: 220px; }

    /* Portafolio */
    .portafolio-section { padding: 5rem 0; }
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-item { height: 260px; }
    .gallery-filters { flex-wrap: wrap; gap: 0.5rem; }
    .filter-btn { padding: 0.6rem 1.2rem; font-size: 0.9rem; }

    /* Blog */
    .blog-section { padding: 5rem 0; }
    .blog-grid { grid-template-columns: 1fr; }

    /* Contacto */
    .contacto-section { padding: 5rem 0; }

    /* WhatsApp */
    .whatsapp-btn {
        width: 56px;
        height: 56px;
        font-size: 2rem;
        bottom: 20px;
        right: 20px;
    }
    .tooltip { display: none; }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .section-title { font-size: 1.9rem; }
    .logo img { height: 36px; }
    .stat-card h3 { font-size: 1.8rem; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .gallery-item { height: 220px; }
}

/* Reveal Animation Class */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
