* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --secondary: #00b8d4;
    --background: #ffffff;
    --foreground: #1a1a1a;
    --muted: #f5f5f5;
    --muted-foreground: #666666;
    --border: #e0e0e0;
    --accent: #f0f9ff;
    --logo-height: 92px;
    /* Balanced for aesthetics and layout stability */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--foreground);
    background-color: var(--background);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-scrolled,
.header-opaque {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    /* Reduced padding for standard look */
}

.logo img {
    height: var(--logo-height);
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
}


.logo img:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    /* Ensures button and links are perfectly aligned */
}

.nav-menu a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.header-scrolled .nav-menu a,
.header-opaque .nav-menu a {
    color: var(--foreground);
}

.nav-menu a::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Nav CTA Button - Premium Version */
.nav-cta {
    display: inline-block;
    padding: 0.85rem 2.2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    margin-left: 1.2rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.nav-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: all 0.6s;
}

.nav-cta:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 102, 204, 0.4);
    filter: brightness(1.1);
}

.nav-cta:hover::before {
    left: 100%;
}

.header-scrolled .nav-cta,
.header-opaque .nav-cta {
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.nav-cta:active {
    transform: translateY(-1px) scale(0.98);
}

@media (max-width: 1100px) {
    .nav-cta {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .nav-cta {
        display: none;
        /* Hide in mobile menu by default, or move inside? */
        /* Let's make it visible inside the mobile menu too but with different styling */
    }

    .nav-menu.active .nav-cta {
        display: block;
        margin: 1rem 0;
        text-align: center;
        width: 100%;
    }
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
}

.header-scrolled .mobile-menu-btn span,
.header-opaque .mobile-menu-btn span {
    background: var(--foreground);
}

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: black;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.85) 0%, rgba(0, 184, 212, 0.75) 100%);
    z-index: 2;
    transition: background 0.3s ease;
}

/* Cursor follower effect */
.cursor-follower {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(0, 184, 212, 0.4) 50%, transparent 70%);
    border: 2px solid rgba(255, 255, 255, 0.6);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 4;
    opacity: 0;
    transition: opacity 0.3s ease, width 0.2s ease, height 0.2s ease;
    mix-blend-mode: screen;
    box-shadow:
        0 0 20px rgba(0, 184, 212, 0.6),
        0 0 40px rgba(0, 184, 212, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    color: white;
    max-width: 900px;
    padding: 2rem;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.btn-primary {
    background: white;
    color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

/* Services Section */
.services {
    padding: 6rem 0;
    background: var(--background);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.service-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.service-card:hover .service-overlay {
    opacity: 0.95;
}

.service-overlay.networks {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.8));
}

.service-overlay.audiovisual {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.9), rgba(219, 39, 119, 0.8));
}

.service-overlay.infrastructure {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(147, 51, 234, 0.8));
}

.service-overlay.security {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.8));
}

.service-overlay.cabling {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.8));
}

.service-overlay.smart {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.9), rgba(249, 115, 22, 0.8));
}

.service-content {
    padding: 2rem;
}

.service-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.service-content p {
    color: var(--muted-foreground);
    line-height: 1.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --logo-height: 72px;
    }

    .nav-menu {
        display: none;
        /* Hidden by default on mobile */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        align-items: center;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        z-index: 1100;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex !important;
        /* Show when active */
    }

    .nav-menu a {
        color: #000000 !important;
        font-size: 1.2rem;
        display: block;
        /* Ensure they have dimension */
        padding: 0.5rem;
        /* clickable area */
    }

    .mobile-menu-btn {
        display: flex;
        z-index: 1200;
        padding: 10px;
        position: relative;
    }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
        background-color: var(--foreground);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
        background-color: var(--foreground);
    }

    /* Fix for header spacing on mobile */
    .hero-content {
        padding-top: 6rem;
        padding-bottom: 3rem;
    }

    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        padding: 0 10px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons .btn {
        width: 100%;
        padding: 0.8rem;
    }

    .hero-stats {
        gap: 1rem;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    /* Partes del Partners slider en móvil */
    .partners {
        padding: 3rem 0;
    }

    .partners .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .slide-track img {
        height: 50px;
    }
}

@media (max-width: 480px) {
    :root {
        --logo-height: 60px;
    }

    .container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Contact Map */
.map-iframe {
    border: 0;
}