/* --- 1. CONFIGURACIÓN DE COLORES Y TIPOGRAFÍA --- */
:root {
    --bg: #F7F7F2;      /* Crema suave de fondo */
    --navy: #1A1E2C;    /* Azul casi negro */
    --gray: #555555;    /* Gris oscuro */
    --transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

* { 
    margin: 0; padding: 0; box-sizing: border-box; 
    font-family: 'Inter', sans-serif !important; 
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body { background-color: var(--bg); color: var(--navy); overflow-x: hidden; line-height: 1.5; }

/* --- 2. HEADER Y NAVEGACIÓN --- */
header {
    position: fixed; top: 0; width: 100%; padding: 30px 60px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1000; mix-blend-mode: difference;
}
.nav-logo { width: 60px; height: auto; filter: brightness(0) invert(1); }
nav a {
    text-decoration: none; color: white !important;
    text-transform: uppercase; font-size: 10px; letter-spacing: 3px;
    margin-left: 40px; transition: opacity 0.4s;
}

/* --- 3. HERO --- */
.hero {
    height: 65vh; padding-top: 80px;
    display: flex; flex-direction: column; justify-content: center;
    align-items: center; text-align: center;
}
.main-logo { width: 320px; height: auto; margin-bottom: 15px; }
.hero-subtitle { font-size: 11px; letter-spacing: 8px; text-transform: uppercase; opacity: 0.7; }

/* --- 4. TÍTULOS DE SECCIÓN --- */
.section-header-centered, .horizontal-section {
    width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center;
}
#galeria-proyectos .section-label, .section-header-centered .section-label {
    display: block; font-size: 14px; text-transform: uppercase;
    letter-spacing: 6px; text-indent: 6px; color: var(--gray);
    padding: 80px 0 40px 0; font-weight: 500;
}

/* --- 5. GALERÍA HORIZONTAL (CORRECCIÓN VIVALDI) --- */
.horizontal-slider {
    display: flex; overflow-x: auto; gap: 25px;
    padding: 0 10% 40px 10%; scrollbar-width: none; 
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    
    /* PROPIEDADES PARA BLOQUEAR GESTOS DEL NAVEGADOR */
    touch-action: pan-x; 
    overscroll-behavior-x: contain; 
}
.horizontal-slider::-webkit-scrollbar { display: none; } 
.slide-item { flex: 0 0 450px; height: 320px; scroll-snap-align: start; overflow: hidden; }
.slide-item img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); transition: var(--transition); }
.slide-item:hover img { filter: grayscale(0%); transform: scale(1.05); }

/* --- 6. GRID DE PROYECTOS Y DIAGONALES --- */
.content-grid { padding: 80px 10% 200px 10%; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px; }
.section-card { cursor: pointer; transition: var(--transition); }
.card-diagonal-2 { margin-top: 100px; } 
.card-diagonal-3 { margin-top: 200px; } 
.img-container { width: 100%; height: 500px; overflow: hidden; margin-bottom: 30px; }
.img-container img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); transition: var(--transition); }
.section-card h2 { font-size: 18px; font-weight: 300; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 12px; }

/* --- 7. VIDEO CINEMA Y RESEÑA --- */
.video-cinema-section { width: 100%; background-color: #3c3c3b; padding: 100px 0; margin: 60px 0; display: flex; justify-content: center; }
.video-cinema-container { width: 100%; max-width: 1150px; padding: 0 5%; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform: scale(1.1); }

.studio-review { width: 100%; padding: 140px 0; display: flex; justify-content: center; text-align: center; }
.review-content { width: 90%; max-width: 850px; }
.quote-text { font-size: 42px; font-weight: 200; font-style: italic; color: #3c3c3b; margin-bottom: 40px; }
.quote-text::before { content: ""; display: block; width: 40px; height: 1px; background-color: rgba(60, 60, 59, 0.3); margin: 0 auto 30px auto; }

/* --- 8. MODALES --- */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg); z-index: 2000; display: none; padding: 60px 0; overflow-y: auto;
}
.close-modal { position: fixed; top: 40px; right: 40px; cursor: pointer; font-size: 11px; letter-spacing: 2px; z-index: 2010; }

/* REGLA DEL CONTADOR (AÑADIDA/CORREGIDA) */
.slider-counter {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 11px;
    letter-spacing: 4px;
    font-weight: 300;
    text-transform: uppercase;
    color: var(--navy);
    margin-bottom: 15px;
}

/* Contenido Equipamiento (Tablas) */
.ficha-main-title { text-align: center; font-size: 32px; font-weight: 200; letter-spacing: 12px; text-transform: uppercase; margin: 40px 0; }
.ficha-tecnica-grid { max-width: 900px; margin: 60px auto; padding: 0 40px; }
.ficha-row { display: flex; border-top: 1px solid rgba(26, 30, 44, 0.15); padding: 35px 0; gap: 50px; }
.ficha-label { flex: 0 0 200px; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 4px; }
.ficha-value { flex: 1; font-size: 14px; font-weight: 300; line-height: 1.8; color: var(--gray); }
.ficha-value strong { display: block; font-size: 10px; margin-top: 10px; color: var(--navy); }

/* Contenido Espacio y Servicios (Texto e Imágenes) */
#modal-espacio.modal, #modal-servicios.modal { background-color: #F7F7F2 !important; padding: 80px 0 !important; }
.modal-text-grid p { max-width: 700px; margin: 0 auto 30px auto; font-size: 16px; font-weight: 300; line-height: 2; text-align: center; }
.modal-image-full img { display: block; max-width: 900px; width: 90%; margin: 40px auto; filter: grayscale(100%); transition: var(--transition); }
.modal-image-full img:hover { filter: grayscale(0%); }

/* Slider del modal */
.modal-horizontal-slider {
    display: flex; overflow-x: auto; gap: 10px; padding-bottom: 50px;
    scrollbar-width: none; scroll-snap-type: x mandatory;
    touch-action: pan-x; overscroll-behavior-x: contain;
}
.modal-slide-item { flex: 0 0 70vw; height: 60vh; scroll-snap-align: center; overflow: hidden; }
.modal-slide-item img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); }

/* --- 9. FOOTER (CORREGIDO) --- */
footer { 
    background-color: var(--navy); 
    color: white; 
    padding: 140px 10% 120px 10%; 
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

footer h2 { 
    font-size: 60px; 
    font-weight: 200; 
    letter-spacing: 15px; 
    color: white !important; 
    margin: 0 0 20px 0; /* Margen exacto abajo de YOIN */
    line-height: 1;
    text-indent: 15px; /* Compensa el letter-spacing para centrar perfecto */
}

.footer-tagline {
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 2px;
    opacity: 0.8;
    margin: 0 0 40px 0; /* Distancia entre la pregunta y el botón */
    line-height: 1;
}

.footer-link { 
    color: white !important; 
    text-decoration: none; 
    font-size: 17px; 
    letter-spacing: 6px; 
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.6); 
    padding-bottom: 8px;
    display: inline-block;
    line-height: 1;
    transition: opacity 0.3s;
}

.footer-link:hover {
    opacity: 0.7;
}

/* --- 10. MODO OSCURO AUTOMÁTICO --- */
@media (prefers-color-scheme: dark) {
    :root { --bg: #1A1E2C; --navy: #F7F7F2; --gray: #f0f0f0; }
    body, .modal, #modal-espacio.modal, #modal-servicios.modal { background-color: var(--bg) !important; color: var(--navy) !important; }
    footer { background-color: #F7F7F2 !important; color: #1A1E2C !important; }
    footer h2, .footer-link { color: #1A1E2C !important; }
    .nav-logo, .main-logo { filter: brightness(0) invert(1); }
    .quote-text { color: #F7F7F2 !important; }
    .video-cinema-section, .video-wrapper { background-color: #F7F7F2 !important; }
    .ficha-row { border-top: 1px solid rgba(247, 247, 242, 0.2); }
    .quote-text::before { background-color: rgba(247, 247, 242, 0.3); }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    /* Reducimos el padding lateral para ganar espacio */
    header { 
        padding: 20px 20px; 
    }

    /* Reducimos el logo para que no empuje el menú */
    .nav-logo { 
        width: 45px; 
    }

    /* Forzamos a que el nav no rompa líneas */
    nav {
        display: flex;
        white-space: nowrap;
    }

    /* Ajustamos el tamaño y margen de los enlaces para móviles */
    nav a {
        font-size: 8px; /* Un poco más pequeño para asegurar que quepan */
        margin-left: 15px; /* Reducimos el espacio entre ellos */
        letter-spacing: 2px; /* Reducimos ligeramente el espaciado entre letras */
    }

    /* Otras reglas existentes que ya tenías */
    .content-grid { grid-template-columns: 1fr; padding: 60px 10%; }
    .card-diagonal-2, .card-diagonal-3 { margin-top: 0; }
   .ficha-row { 
        flex-direction: column; 
        gap: 5px !important;    /* Reduce el espacio gigante entre título y descripción */
        padding: 20px 0 !important; /* Reduce el espacio entre cada bloque de servicio */
    }

    .ficha-label {
        flex: none;
        margin-bottom: 5px;     /* Espacio mínimo bajo el título */
        font-size: 9px;         /* Ajuste ligero para etiquetas en móvil */
    }

    .ficha-value {
        font-size: 13px;        /* Tamaño de lectura cómodo para móvil */
        line-height: 1.6;
    }
}
    .modal-slide-item { flex: 0 0 92vw; }
    .quote-text { font-size: 28px; }
}
/* --- FIX FINAL GESTOS --- */
.slider-wrapper {
    width: 100%;
    position: relative;
    /* Evita que el navegador use el gesto de "atrás" en esta zona */
    touch-action: pan-x; 
    overscroll-behavior-x: contain;
    overflow: hidden;
}

.horizontal-slider {
    display: flex; 
    overflow-x: auto !important; /* Forzamos el scroll horizontal */
    gap: 25px;
    padding: 0 10% 40px 10%;
    scrollbar-width: none; 
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; 
    
    /* Refuerzo de propiedades */
    touch-action: pan-x;
    overscroll-behavior-x: contain;
}

/* --- CORRECCIÓN PESO FUENTE SECTION-LABEL --- */

.section-label {
    display: block;
    font-family: 'Inter', sans-serif !important;
    /* Forzamos el peso más fino disponible (Thin/Extra Light) */
    font-weight: 300 !important; 
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 6px;
    color: var(--gray);
    margin-bottom: 30px;
    text-align: center;
}

/* Específicamente para la sección studio-review si quieres asegurar la jerarquía */
.studio-review .section-label {
    font-weight: 300 !important;
    opacity: 0.8; /* Un toque de transparencia ayuda a que se vea más fino visualmente */
}