/* ==========================================================================
   1. TIPOGRAF脥A Y RESET BASE
   ========================================================================== */
@font-face {
    font-family: 'Inter Variable';
    src: url('assets/Inter-VariableFont_slnt,wght (3).ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter Variable', 'Helvetica Neue', Arial, sans-serif; }
body { color: #1a1a1a; line-height: 1.6; overflow-x: hidden; background-color: #f8f8f8; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 5%; width: 100%; position: relative; }
img { max-width: 100%; height: auto; display: block; }

:root {
    --jd-blue: #1d4ed8; 
    --jd-light-blue: #2563eb;
    --jd-dark: #0f172a;
}

/* ==========================================================================
   2. NAVEGACI脫N Y MEN脷 OVERLAY
   ========================================================================== */
nav {
    position: absolute; top: 0; left: 0; width: 100%; padding: 30px 5%;
    z-index: 10; display: flex; justify-content: space-between; align-items: center;
}
.main-logo { max-width: 250px; width: 100%; height: auto; }
.menu-icon { color: white; font-size: 2.5rem; cursor: pointer; user-select: none; line-height: 1;}

.fullscreen-menu {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background-color: rgba(26, 26, 26, 0.98); z-index: 100;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.fullscreen-menu.active { opacity: 1; pointer-events: auto; }

.close-menu {
    position: absolute; top: 30px; right: 5%; color: white; font-size: 3rem;
    cursor: pointer; line-height: 1; font-weight: 300; user-select: none;
}
.menu-links { list-style: none; text-align: center; }
.menu-links li { margin: 25px 0; transform: translateY(20px); opacity: 0; transition: transform 0.4s ease, opacity 0.4s ease; }
.fullscreen-menu.active .menu-links li { transform: translateY(0); opacity: 1; }
.fullscreen-menu.active .menu-links li:nth-child(1) { transition-delay: 0.1s; }
.fullscreen-menu.active .menu-links li:nth-child(2) { transition-delay: 0.2s; }
.fullscreen-menu.active .menu-links li:nth-child(3) { transition-delay: 0.3s; }
.fullscreen-menu.active .menu-links li:nth-child(4) { transition-delay: 0.4s; }
.menu-links a {
    color: white; text-decoration: none; font-size: 3rem; font-weight: 900;
    text-transform: uppercase; letter-spacing: -1px; transition: color 0.3s;
}
.menu-links a:hover { color: #ef4444; font-style: italic; }

/* ==========================================================================
   3. MODAL DE VIDEO
   ========================================================================== */
.video-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background-color: rgba(0, 0, 0, 0.95); z-index: 200;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.video-modal.active { opacity: 1; pointer-events: auto; }
.close-video {
    position: absolute; top: 30px; right: 5%; color: white; font-size: 3rem;
    cursor: pointer; line-height: 1; font-weight: 300; user-select: none; z-index: 201; transition: color 0.3s;
}
.close-video:hover { color: #ef4444; }
.video-container { width: 90%; max-width: 1000px; box-shadow: 0 10px 40px rgba(0,0,0,0.8); background: #000; border-radius: 8px; overflow: hidden; }
.video-container video { width: 100%; height: auto; display: block; outline: none; }

/* ==========================================================================
   4. HERO SECTION
   ========================================================================== */
.hero {
    position: relative; height: 55vh; min-height: 400px;
    background-size: cover; background-position: center; padding: 40px 5%;
}
.hero-title-img { position: absolute; left: 5%; bottom: 15%; max-width: 500px; width: 80%; z-index: 2; }
.play-video-btn {
    position: absolute; right: 5%; bottom: 15%; display: flex; align-items: center; gap: 15px;
    color: white; font-style: italic; font-size: 1.1rem; text-decoration: none; z-index: 2; cursor: pointer;
}
.play-icon {
    width: 50px; height: 50px; border: 2px solid var(--jd-light-blue); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; background-color: rgba(37, 99, 235, 0.2); transition: transform 0.3s;
}
.play-video-btn:hover .play-icon { transform: scale(1.1); background-color: var(--jd-light-blue); }
.play-icon::after { content: ''; width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 14px; border-color: transparent transparent transparent white; margin-left: 4px; }

/* ==========================================================================
   5. CONTENIDO DEL CASE STUDY (GRID Y TEXTOS)
   ========================================================================== */
.case-study-content {
    background-image: url('assets/CaseStudy_fondo.jpg'); background-size: cover; background-position: top center; background-repeat: no-repeat; padding: 80px 0 100px 0; position: relative;
}
.case-study-grid { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 30px; margin-bottom: 50px; }
.grid-title { grid-column: 2; grid-row: 1; }
.grid-sidebar { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; margin-right: 5px; }
.arrow-down { color: var(--jd-blue); font-size: 1.8rem; font-weight: 300; line-height: 1; margin-bottom: 15px; }
.vertical-text-container {
    writing-mode: vertical-rl; transform: rotate(180deg); color: var(--jd-blue);
    font-size: 0.8rem; font-weight: 400; font-style: italic; letter-spacing: 2px; text-transform: uppercase; white-space: nowrap; 
}
.grid-image { grid-column: 2; grid-row: 2; }
.section-title { font-size: 3.5rem; color: #1a1a1a; line-height: 1.1; letter-spacing: -1.5px; margin-bottom: 30px; font-weight: 400; }
.section-title .title-light { font-weight: 300; font-style: italic; }
.section-title strong { font-weight: 900; }
.car-image-container { width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.car-image-container img { width: 100%; }

.info-section { display: flex; flex-wrap: wrap; gap: 50px; margin-top: 80px; align-items: flex-start; }
.info-heading { flex: 1; min-width: 300px; }
.info-heading h2 { font-size: 5rem; font-weight: 900; line-height: 0.9; color: var(--jd-dark); letter-spacing: -2px; font-style: italic; }
.info-heading h2 span { display: block; font-weight: 300; }
.info-text-blocks { flex: 1.5; min-width: 300px; display: flex; flex-direction: column; gap: 30px; }
.text-block h4 { font-size: 1rem; font-weight: 700; margin-bottom: 5px; color: #000; }
.text-block p { font-size: 0.95rem; color: #333; line-height: 1.5; }
.capacities-footer { text-align: center; margin-top: 80px; font-weight: 700; font-size: 1rem; color: #000; }
.capacities-footer span { color: var(--jd-blue); }

/* ==========================================================================
   6. CARRUSEL PARA CASOS DE ESTUDIO (PROYECTOS)
   ========================================================================== */
.cs-carousel-container {
    width: 100%;
    position: relative; /* Aseguramos que sea el contenedor relativo para las flechas absolutas */
}

.cs-carousel-wrapper {
    width: 100%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    border-radius: 4px;
}

.cs-carousel-track {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.cs-carousel-track::-webkit-scrollbar {
    display: none;
}

.cs-carousel-track:active {
    cursor: grabbing;
}

.cs-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-slide img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

.cs-slider-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    width: 100%;
    flex-wrap: wrap;
}

.cs-dot {
    width: 8px;
    height: 8px;
    background-color: #cbd5e1;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s;
}

.cs-dot.active {
    background-color: #ef4444;
    transform: scale(1.2);
    border-radius: 3px;
}

/* Flechas del Carrusel */
.cs-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5); 
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    transition: background 0.3s ease, transform 0.3s ease;
}

.cs-carousel-arrow:hover {
    background: var(--jd-light-blue);
    transform: translateY(-50%) scale(1.1);
}

.cs-carousel-arrow.prev {
    left: 15px;
}

.cs-carousel-arrow.next {
    right: 15px;
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
footer { background: #1a1a1a; color: #9ca3af; padding: 60px 0 20px 0; font-size: 0.85rem; }
.contact-btn-container { text-align: center; margin-bottom: 60px; }
.contact-btn { display: inline-block; padding: 15px 40px; color: white; text-decoration: none; font-size: 1.5rem; font-weight: bold; border: 2px solid rgba(255,255,255,0.2); transition: border-color 0.3s; }
.contact-btn:hover { border-color: #ef4444; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col strong { color: white; display: block; margin-bottom: 10px; font-size: 1rem; }
.footer-logo { max-width: 200px; margin-bottom: 20px; }
.social-icons { display: flex; gap: 15px; align-items: center; }
.social-icons a img { width: 20px; height: auto; transition: transform 0.3s ease; }
.social-icons a:hover img { transform: scale(1.1); }
.copyright { text-align: center; border-top: 1px solid #333; padding-top: 20px; margin-top: 20px; }

/* ==========================================================================
   8. MEDIA QUERIES (RESPONSIVO)
   ========================================================================== */
@media (max-width: 900px) {
    .case-study-grid { grid-template-columns: 1fr; }
    .grid-sidebar { display: none; }
    .grid-title, .grid-image { grid-column: 1; }
    .info-heading h2 { font-size: 4rem; }
    .section-title { font-size: 2.5rem; }
    .hero-title-img { bottom: 30%; }
    .play-video-btn { bottom: 10%; right: 5%; }
}
@media (max-width: 768px) {
    .info-section { flex-direction: column; gap: 30px; }
    .info-heading h2 { font-size: 3.5rem; }
    .hero { height: 40vh; min-height: 300px; }
    .cs-carousel-arrow { display: none; } /* Ocultar flechas en m贸viles para que arrastren con el dedo */
}
/* ==========================================================================
   9. ESTILOS ESPECÍFICOS PARA EL HOME (INDEX)
   ========================================================================== */

/* Hero del Home */
.hero-home {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    background-color: #000;
}
.hero-home-video {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 0;
}
.hero-home-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); z-index: 1;
}
.hero-home-content { position: relative; z-index: 2; margin-left: 5%; }
.hero-home-content img { max-width: 800px; width: 90%; }

/* Wrappers y Secciones Informativas del Home */
.about-clients-wrapper {
    background: url('assets/figura\ arriba.png') left top / 45% auto no-repeat,
                url('assets/figura\ abajo.png') right bottom / 50% auto no-repeat, #f2f2f2;
}
.about-wrapper { padding: 150px 0 60px 0; }
.about { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.about-title-img { max-width: 450px; }
.about-text { max-width: 500px; font-size: 1rem; color: #555; padding-top: 20px; }
.clients { text-align: center; padding: 40px 20px 40px 20px; background-color: transparent; }
.clients img { max-width: 900px; width: 100%; }

/* Portfolio Navigator Header */
.portfolio-header-container { text-align: left; padding: 0 20px 20px 20px; max-width: 1200px; margin: 0 auto; }
.portfolio-header-container h2 { color: #3b82f6; font-style: italic; font-size: 4rem; font-weight: 300; letter-spacing: -1px; }

.portfolio-services-wrapper {
    background-color: #f2f2f2;
    background-image: url('assets/figura\ 3.jpg'); background-position: center bottom;
    background-size: cover; background-repeat: no-repeat; position: relative; overflow: hidden;
}
.portfolio { background-color: transparent; padding-bottom: 60px; overflow-x: hidden; position: relative; z-index: 2; }
.portfolio-navigator { 
    position: relative; background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.1) 60%), url('assets/navi.jpg') center 20%/cover no-repeat;
    height: 750px; color: white; display: flex; align-items: center; 
}
.portfolio-content { width: 100%; position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.portfolio-content h3 { font-size: 4rem; font-weight: 900; line-height: 1; letter-spacing: -1px; text-transform: uppercase; margin-bottom: 5px; }
.portfolio-content h3 em { font-style: italic; font-weight: 300; }
.portfolio-content p { font-size: 1.5rem; font-style: italic; font-weight: 300; margin-bottom: 20px; }
.link-arrow-red { color: #ef4444; font-size: 1.8rem; margin-left: 10px; transition: transform 0.3s; }
.btn-conocenos { position: absolute; bottom: 40px; right: 0; color: white; text-decoration: none; font-size: 1.2rem; display: inline-flex; align-items: center; }
.btn-conocenos:hover .link-arrow-red { transform: translateX(5px); }

/* Carrusel del Home */
.home-carousel-wrapper { position: relative; width: 100%; margin-top: 20px; }
.carousel-left-mask { position: absolute; left: 0; top: 0; height: 450px; width: 80px; background-color: transparent; z-index: 5; display: flex; align-items: center; justify-content: center; }
.vertical-text { writing-mode: vertical-rl; transform: rotate(180deg); color: #3b82f6; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; white-space: nowrap; user-select: none; }
.vertical-text span { font-size: 1.5rem; transform: rotate(90deg); display: inline-block;}
.mobile-instruction { display: none; color: #3b82f6; font-size: 0.9rem; padding: 0 20px 10px 20px; font-weight: bold; }

.home-carousel-track {
    display: flex; gap: 20px; width: 100%; overflow-x: auto; scroll-behavior: smooth;
    scroll-snap-type: x mandatory; -ms-overflow-style: none; scrollbar-width: none;  
    padding-left: 80px; padding-right: 20px; cursor: grab;
}
.home-carousel-track:active { cursor: grabbing; }
.home-carousel-track::-webkit-scrollbar { display: none; }

.home-slide {
    height: 450px; display: flex; align-items: center; padding: 60px; position: relative;
    color: white; background-color: #333; scroll-snap-align: start; flex: 0 0 850px;
    max-width: 85vw; user-select: none;
}
.slide-mg { background: linear-gradient(to right, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0.1) 80%), url('assets/duodrive.jpg') center/cover no-repeat; }
.slide-geely { background: linear-gradient(to right, rgba(0,0,0,0.8) 10%, rgba(0,0,0,0.4) 80%), url('assets/Geely_Emgrand2025_-101.jpg') center/cover no-repeat; }
.slide-ford { background: linear-gradient(to right, rgba(0,0,0,0.8) 10%, rgba(0,0,0,0.4) 80%), url('assets/fbt.jpg') center/cover no-repeat; }

.home-slider-dots { width: 100%; margin-top: 20px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.home-dot { width: 8px; height: 8px; background-color: #cbd5e1; border-radius: 50%; display: inline-block; cursor: pointer; transition: all 0.3s; }
.home-dot.active { background-color: #ef4444; transform: scale(1.2); border-radius: 3px; }

/* Servicios Home */
.services-wrapper { background-color: transparent; padding: 80px 0 120px 0; position: relative; z-index: 2; }
.services { display: flex; align-items: center; gap: 40px; justify-content: flex-start; padding-left: 60px; }
.reto-text-container { writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; flex-shrink: 0; }
.reto-text-container h2 { font-size: 4rem; font-weight: 900; letter-spacing: -2px; color: #1a1a1a; margin: 0; line-height: 0.9; text-align: right; }
.reto-text-container h2 em { font-style: italic; font-weight: 300; }

.service-lists { display: flex; flex-direction: column; gap: 50px; }
.service-lists h2 { font-size: 3.5rem; font-weight: 900; letter-spacing: -1.5px; color: #1a1a1a; margin-bottom: 15px; }
.service-lists h2 em { font-style: italic; font-weight: 300; }
.service-lists ul { list-style: none; font-size: 1.15rem; line-height: 1.6; color: #555; }
.service-lists .list-top li:nth-child(odd), .service-lists .list-bottom li:nth-child(odd) { color: #2563eb; font-weight: 700; }
.service-lists .list-top li:nth-child(even), .service-lists .list-bottom li:nth-child(even) { color: #555; font-weight: 500; }

/* Contacto Home CTA */
.cta-home { background: url('assets/contacto.jpg') center/cover no-repeat; padding: 150px 0; display: block; cursor: pointer; }

/* Responsivo Home */
@media (max-width: 1240px) {
    .carousel-left-mask { display: none; }
    .mobile-instruction { display: block; }
    .home-carousel-track { padding-left: 20px; }
}
@media (max-width: 768px) {
    .services { flex-direction: column; align-items: flex-start; padding-left: 20px; }
    .reto-text-container { writing-mode: horizontal-tb; transform: none; text-align: left; }
    .reto-text-container h2 { text-align: left; font-size: 3rem; }
    .about { justify-content: center; text-align: center; }
    .about > div { width: 100%; }
    .about-title-img { width: 100%; max-width: 340px; margin: 0 auto; }
    .about-clients-wrapper { background-size: 130% auto, 130% auto; background-position: left -20px top, right -20px bottom; }
    .portfolio-navigator { height: 400px; }
    .portfolio-content h3 { font-size: 2.5rem; }
    .home-slide { width: 90vw; }
}

/* Flechas del Carrusel del Home */
.home-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5); 
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10; /* Se asegura de estar por encima de las imágenes y la máscara */
    border-radius: 50%;
    transition: background 0.3s ease, transform 0.3s ease;
}

.home-carousel-arrow:hover {
    background: #2563eb; /* Color azul JD */
    transform: translateY(-50%) scale(1.1);
}

.home-carousel-arrow.prev {
    left: 15px;
}

.home-carousel-arrow.next {
    right: 15px;
}

/* Ocultar flechas en móviles para que deslicen con el dedo */
@media (max-width: 768px) {
    .home-carousel-arrow {
        display: none;
    }
}