:root {
    --primary-red: #ff3131;
    --dark-bg: #000000;
    --nav-top-bg: #454546; 
    --cube-size: 300px; 
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    color: white;
    font-family: 'Arial', sans-serif;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* --- OPTIMIZACIÓN DE SCROLL --- */
section {
    scroll-margin-top: 120px;
}

/* --- FONDO ESPACIAL (CORREGIDO PARA MÓVIL) --- */
#star-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10 !important; /* SE MUEVE DETRÁS DE TODO EL CONTENIDO */
    background: #000;
    pointer-events: none !important; /* LOS TOQUES ATRAVIESAN ESTA CAPA */
    transform: translateZ(0);
}

.star {
    position: absolute;
    background: var(--primary-red);
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration) infinite ease-in-out;
    box-shadow: 0 0 5px var(--primary-red);
    will-change: opacity, transform;
}

.shooting-star {
    position: absolute;
    height: 2px;
    background: linear-gradient(-90deg, var(--primary-red), transparent);
    border-radius: 999px;
    filter: drop-shadow(0 0 6px var(--primary-red));
    transform: rotate(45deg); 
    animation: falling-star 3s linear infinite;
    will-change: transform;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { 
        opacity: 1; 
        transform: scale(1.2); 
        box-shadow: 0 0 8px var(--primary-red); 
    }
}

@keyframes falling-star {
    0% { transform: translateX(-200px) translateY(-200px) rotate(45deg); width: 0; opacity: 1; }
    30% { width: 150px; }
    100% { transform: translateX(1200px) translateY(1200px) rotate(45deg); width: 0; opacity: 0; }
}

/* --- NAVBAR (MÁXIMA PRIORIDAD TÁCTIL) --- */
.navbar-container {
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 99999 !important; /* VALOR EXTREMO PARA ESTAR SOBRE TODO */
    pointer-events: auto !important;
}

.nav-top {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--nav-top-bg);
    border-bottom: 2px solid #444;
    height: 80px;
    position: relative;
    overflow: hidden;
    z-index: 100000;
}

.nav-side-button {
    position: absolute;
    top: 0;
    width: 150px; 
    height: 100%;
    background: var(--primary-red);
    z-index: 5;
}

.btn-left { left: 0; clip-path: polygon(0% 0%, 100% 0%, 75% 100%, 0% 100%); }
.btn-right { right: 0; clip-path: polygon(25% 0%, 100% 0%, 100% 100%, 0% 100%); }

.logo-container { position: relative; z-index: 10; }
.logo-container img { height: 60px; display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); transition: 0.3s; }

.nav-bottom {
    display: flex;
    justify-content: center;
    padding: 12px 0;
    background-color: rgba(22, 22, 22, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100001;
pointer-events: auto !important; /* Asegura que la barra reciba clicks */
}

.nav-links { display: flex; list-style: none; margin: 0; padding: 0; gap: 40px; }
.nav-links a { 
    text-decoration: none; 
    color: white; 
    font-size: 13px; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    font-weight: bold; 
    transition: 0.3s;
    position: relative;
    z-index: 100002; /* PRIORIDAD INDIVIDUAL A LOS LINKS */
}
.nav-links a.active { color: var(--primary-red); border-bottom: 2px solid var(--primary-red); padding-bottom: 5px; }

/* --- SECCIONES (JERARQUÍA INTERMEDIA) --- */
.hero, .services-section, .pricing-section, .about-section, .companies-section, .contact-section {
    position: relative;
    z-index: 10; /* MENOR QUE LA NAVBAR */
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 100vh;
    padding: 150px 8% 50px 8%;
    box-sizing: border-box;
}

.hero-text { max-width: 800px; text-align: left; }
.hero-text h1 { font-size: clamp(2.5rem, 8vw, 4.8rem); margin: 0; font-weight: 900; line-height: 0.9; letter-spacing: -2px; text-transform: uppercase; }
.hero-text span { color: var(--primary-red); text-shadow: 0 0 20px rgba(255, 49, 49, 0.6); }
.hero-text p { font-size: clamp(1rem, 2vw, 1.3rem); font-weight: bold; color: #ccc; margin: 35px 0; max-width: 600px; }
.hero-btns { display: flex; gap: 20px; flex-wrap: wrap; }
.btn { padding: 16px 40px; border-radius: 4px; font-weight: 900; text-transform: uppercase; font-size: 14px; text-decoration: none; transition: 0.3s; text-align: center; cursor: pointer; }
.btn-red { background: var(--primary-red); color: white; border: 2px solid var(--primary-red); }
.btn-outline { border: 2px solid #fff; color: white; background: transparent; }

/* --- CUBO --- */
.cube-container { 
    width: var(--cube-size); 
    height: var(--cube-size); 
    perspective: 1200px; 
}
.cube { 
    width: 100%; 
    height: 100%; 
    position: relative; 
    transform-style: preserve-3d; 
    animation: rotateCube 20s infinite linear; 
    will-change: transform;
}
.face { 
    position: absolute; 
    width: var(--cube-size); 
    height: var(--cube-size); 
    border: 2px solid var(--primary-red); 
    background: rgba(0, 0, 0, 0.95); 
    box-shadow: inset 0 0 20px rgba(255, 49, 49, 0.3); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    backface-visibility: hidden;
}
.face img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.front  { transform: translateZ(calc(var(--cube-size) / 2)); }
.back   { transform: rotateY(180deg) translateZ(calc(var(--cube-size) / 2)); }
.right  { transform: rotateY(90deg) translateZ(calc(var(--cube-size) / 2)); }
.left   { transform: rotateY(-90deg) translateZ(calc(var(--cube-size) / 2)); }
.top    { transform: rotateX(90deg) translateZ(calc(var(--cube-size) / 2)); }
.bottom { transform: rotateX(-90deg) translateZ(calc(var(--cube-size) / 2)); }

@keyframes rotateCube { from { transform: rotateX(0deg) rotateY(0deg); } to { transform: rotateX(360deg) rotateY(360deg); } }

/* --- SECCIÓN 2: SERVICIOS --- */
.services-section { padding: 100px 8%; background: rgba(0, 0, 0, 0.7); text-align: center; }
.services-header h2 { font-size: 3rem; font-weight: 900; text-transform: uppercase; margin-bottom: 5px; }
.services-header span { color: var(--primary-red); }
.services-header p { font-size: 1rem; color: #888; margin-bottom: 50px; text-transform: uppercase; letter-spacing: 2px; }
.services-selector { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; max-width: 1100px; margin: 0 auto 40px; }
.service-chip { padding: 12px 20px; background: #1a1a1a; border: 1px solid #333; color: #ccc; font-weight: bold; border-radius: 4px; cursor: pointer; transition: 0.3s; }
.service-chip.selected { background: var(--primary-red); color: white; border-color: var(--primary-red); }

.btn-quote { 
    background: transparent; border: 2px solid var(--primary-red); color: white; padding: 15px 30px; 
    font-weight: 900; text-transform: uppercase; cursor: pointer; transition: 0.3s; margin-top: 25px;
    clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
}
.btn-quote:hover { background: var(--primary-red); box-shadow: 0 0 15px var(--primary-red); }

/* --- SECCIÓN 3: PLANES --- */
.pricing-section { padding: 80px 8%; text-align: center; background: rgba(0,0,0,0.4); }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; max-width: 1200px; margin: 50px auto 0; }
.pricing-card { background: #111; border: 1px solid #222; padding: 40px 20px; border-radius: 4px; position: relative; overflow: hidden; transition: 0.3s; display: flex; flex-direction: column; }
.pricing-card:hover { border-color: var(--primary-red); transform: translateY(-10px); }
.pricing-card::before { content: ''; position: absolute; top: 15px; left: -35px; width: 120px; height: 30px; background: #454546; transform: rotate(-45deg); z-index: 1; }
.pricing-card h3 { color: var(--primary-red); font-size: 1.6rem; font-weight: 900; margin: 0; }
.pricing-card h4 { color: white; font-size: 1.3rem; margin: 5px 0 15px; font-weight: 900; line-height: 1.2; }
.pricing-card .target-text { font-style: italic; color: #666; font-size: 0.85rem; margin-bottom: 25px; }
.pricing-card ul { list-style: none; padding: 0; text-align: left; flex-grow: 1; }
.pricing-card ul li { color: #aaa; padding: 10px 0 10px 25px; border-bottom: 1px solid #222; font-size: 0.95rem; position: relative; }
.pricing-card ul li::before { content: '<'; position: absolute; left: 0; color: var(--primary-red); font-weight: 900; }

/* --- SECCIÓN 4: NOSOTROS --- */
.about-section {
    padding: 100px 8%;
    background: rgba(0, 0, 0, 0.85);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.about-tag { color: var(--primary-red); font-weight: 900; letter-spacing: 2px; font-size: 0.9rem; margin-bottom: 10px; display: block; }
.about-text-content h2 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; margin-bottom: 25px; text-transform: uppercase; }
.about-text-content h2 span { color: var(--primary-red); }
.about-text-content p { color: #aaa; line-height: 1.6; margin-bottom: 20px; }
.stats-container { display: flex; gap: 40px; margin-top: 30px; }
.stat-item h3 { color: var(--primary-red); font-size: 2rem; font-weight: 900; margin: 0; }
.stat-item p { font-size: 0.8rem; color: #777; text-transform: uppercase; }
.video-box { width: 100%; height: 300px; background: #111; border: 1px solid #333; border-radius: 15px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.video-box video { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.mute-btn { position: absolute; bottom: 15px; right: 15px; background: rgba(255, 49, 49, 0.8); border: none; color: white; padding: 8px 12px; border-radius: 5px; cursor: pointer; z-index: 20; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.about-mini-card { background: rgba(20, 20, 20, 0.8); border: 1px solid #222; padding: 20px; border-radius: 10px; transition: 0.3s; }
.about-mini-card h5 { color: white; font-size: 1rem; margin: 0 0 8px 0; font-weight: 900; }
.about-mini-card p { font-size: 0.85rem; color: #666; margin: 0; }
.about-cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; }

/* --- SECCIÓN 5: CASOS DE ÉXITO --- */
.companies-section {
    padding: 100px 5%;
    background: #000;
    text-align: center;
    overflow: hidden;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1500px;
    margin-top: 60px;
    height: 400px;
    position: relative;
}

.project-container {
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    width: 100%;
    position: relative;
}

.project-card {
    width: 450px;
    height: 280px;
    background: #0a0a0a;
    border: 3px solid var(--primary-red);
    border-radius: 15px;
    padding: 10px;
    position: absolute;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 0 15px rgba(255, 49, 49, 0.3);
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.project-card.prev {
    transform: translateX(-320px) rotateY(35deg) translateZ(-200px) scale(0.85);
    opacity: 0.6;
    z-index: 5;
    pointer-events: auto;
}

.project-card.active {
    transform: translateX(0) rotateY(0deg) translateZ(100px) scale(1.05);
    opacity: 1;
    z-index: 10;
    pointer-events: auto;
    box-shadow: 0 0 40px rgba(255, 49, 49, 0.6);
}

.project-card.next {
    transform: translateX(320px) rotateY(-35deg) translateZ(-200px) scale(0.85);
    opacity: 0.6;
    z-index: 5;
    pointer-events: auto;
}

.project-video-wrap {
    width: 100%;
    height: 85%;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.project-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-label {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.label-icon { width: 14px; filter: invert(1); }

.slider-controls {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.arrow {
    background: var(--primary-red);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    transition: 0.3s;
    z-index: 100;
}

.arrow:hover { transform: scale(1.1); box-shadow: 0 0 20px var(--primary-red); }

/* --- SECCIÓN 6: CONTACTO --- */
.contact-section { 
    padding: 100px 8% 50px; 
    background: rgba(0, 0, 0, 0.9); 
    text-align: center; 
}
.contact-container { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; max-width: 1200px; margin: 50px auto 0; text-align: left; }
.method-item { display: flex; align-items: center; gap: 20px; background: rgba(69, 69, 70, 0.2); padding: 20px; border-radius: 8px; border: 1px solid #333; transition: 0.3s; text-decoration: none; color: white; margin-bottom: 15px; }
.method-item:hover { border-color: var(--primary-red); transform: translateX(10px); }
.method-item div span { display: block; font-size: 0.8rem; color: #777; text-transform: uppercase; }
.method-item div strong { font-size: 1.1rem; }

footer { padding: 40px 8%; background: #000; border-top: 1px solid #222; text-align: center; position: relative; z-index: 10; color: #444; font-size: 0.8rem; }

/* ==========================================
   RESPONSIVO CORREGIDO Y OPTIMIZADO
   ========================================== */

@media (max-width: 1024px) { 
    .hero { flex-direction: column; text-align: center; padding-top: 160px; gap: 40px; justify-content: flex-start; } 
    .hero-text { text-align: center; display: flex; flex-direction: column; align-items: center; }
    .hero-btns { justify-content: center; }
    .about-section { grid-template-columns: 1fr; text-align: center; }
    .stats-container { justify-content: center; }
    .contact-container { grid-template-columns: 1fr; text-align: center; }
}

@media (max-width: 768px) { 
    :root { --cube-size: 160px; }
    
    section {
        scroll-margin-top: 130px; /* COMPENSACIÓN DE NAVBAR MÓVIL */
    }

    .nav-top { height: 70px; }
    .logo-container img { height: 45px; }
    .nav-side-button { width: 70px; }
    .nav-bottom { padding: 10px 0; }
    
    /* MEJORA EL ÁREA TÁCTIL PARA DEDOS */
    .nav-links { 
        gap: 12px; 
    }
    .nav-links a { 
        font-size: 10px; 
        letter-spacing: 0.5px; 
        padding: 8px 4px; /* MÁS FÁCIL DE TOCAR */
    }

    .hero { padding: 140px 5% 40px 5%; }
    .hero-text h1 { font-size: 2.1rem; text-align: center; }
    .hero-text p { margin: 20px auto; font-size: 0.95rem; text-align: center; max-width: 90%; line-height: 1.4; }
    
    .cube-container { margin: 20px auto 0 auto; } 
    
    .front  { transform: translateZ(80px); }
    .back   { transform: rotateY(180deg) translateZ(80px); }
    .right  { transform: rotateY(90deg) translateZ(80px); }
    .left   { transform: rotateY(-90deg) translateZ(80px); }
    .top    { transform: rotateX(90deg) translateZ(80px); }
    .bottom { transform: rotateX(-90deg) translateZ(80px); }

    .btn { width: 100%; padding: 14px 0; margin-bottom: 5px; }
    .about-cards-grid { grid-template-columns: 1fr; }
    .service-chip { width: 100%; text-align: center; }

    .project-card { width: 280px; height: 180px; }
    .project-card.prev { transform: translateX(-140px) rotateY(35deg) translateZ(-150px) scale(0.8); }
    .project-card.next { transform: translateX(140px) rotateY(-35deg) translateZ(-150px) scale(0.8); }
    
    .video-box { min-height: 200px; }
}