/* ========================================== */
/* TRANSDRIVE - STYLE.CSS MEJORADO */
/* ========================================== */

/* ========================================== */
/* FUENTES Y CONFIGURACIÓN BASE */
/* ========================================== */

@font-face {
    font-family: 'logo-fuente';
    src: url('../resources/fuente-logo.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-image: repeating-conic-gradient(#efefef 0% 25%, #efefef 0% 50%);
    background-position: 0 0, 11px 11px;
    background-size: 10px 10px;
    background-color: #fafcfe;
    font-family: 'Work Sans', sans-serif;
    overflow-x: hidden;
    width: 100%;
}

/* ========================================== */
/* TIPOGRAFÍA Y TEXTOS */
/* ========================================== */

.font-display {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.05em;
}

.titulo {
    font-family: 'logo-fuente', sans-serif;
    font-weight: bold;
    color: #4d4d4d;
    font-size: clamp(14pt, 4vw, 16pt);
}

.subtitulo {
    font-family: sans-serif;
    font-weight: bold;
    color: #4d4d4d;
    font-size: clamp(10pt, 3vw, 12pt);
    letter-spacing: clamp(2px, 1vw, 8px);
}

.text-shadow {
    text-shadow: 
        2px 2px 2px rgba(92, 92, 92, 0.9),
        1px 1px 2px rgba(0, 0, 0, 0.9),
        -1px -1px 2px rgba(0, 0, 0, 0.9),
        -2px -2px 2px rgba(92, 92, 92, 0.9);
}

.text-gray { color: #6a6a6a; }
.text-graylight { color: #a3a3a3; }
.text-graydark { color: #3a3a3a; }

.text-slider {
    color: #f5f5f5;
    font-weight: bold;
}

/* ========================================== */
/* NAVEGACIÓN */
/* ========================================== */

.navbar {
    min-width: 0;
}

.logo {
    height: 50px;
    max-height: 60px;
    width: auto;
    float: left;
}

.bg-header {
    background: linear-gradient(135deg, #0c2d48 0%, #1a1a2e 100%);
}

.bg-text-menu {
    font-weight: bold;
    color: #8f8d8d;
    font-size: 14pt;
    transition: all 0.3s ease;
}

.bg-text-menu:hover {
    border-bottom: solid 2px #fefdfb;
    color: #eeefed;
    background-color: #0b2d92;
}

.bg-text-menu-active {
    font-weight: bold;
    color: #3b3b3b;
    font-size: 14pt;
}

/* ========================================== */
/* ANIMACIONES */
/* ========================================== */

@keyframes mover {
    from { transform: translateX(0); }
    to { transform: translateX(-10%); }
}

@keyframes zoomIn {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

@keyframes flashEffect {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.imagen-animada {
    width: 120%;
    height: 120%;
    object-fit: cover;
    position: absolute;
    top: -10%;
    left: -10%;
    animation: mover 15s ease-in-out infinite alternate;
}

.flash {
    animation: flashEffect 0.4s ease-in-out;
}

/* Animaciones de scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================== */
/* CARRUSELES Y SLIDERS */
/* ========================================== */

/* Hero Carousel */
#myCarousel,
#hero-carousel {
    margin-top: 80px;
    position: relative;
    width: 100%;
    overflow: hidden;
}

#myCarousel img,
#hero-carousel img,
#flotaCarousel img,
#rallyCarousel img,
#busCarousel img,
#rally-carousel img,
#bus-carousel img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 500px;
}

/* Rally carousel items */
.rally-item,
.bus-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.rally-item:first-child,
.bus-item:first-child {
    opacity: 1;
}

/* Animación tipo distorsión suave para rally */
.rally-img {
    transition: transform 0.5s ease, filter 0.4s ease;
    border-radius: 1rem;
    will-change: transform, filter;
}

.rally-img:hover {
    transform: scale(1.05) rotate(0.5deg) skew(0.5deg, 0.5deg);
    filter: contrast(120%) saturate(115%) brightness(110%);
}

/* ========================================== */
/* VIDEOS */
/* ========================================== */

video.video-container,
.video-container video {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

/* Video thumbnails */
.video-thumbnail video,
.video-thumbnail-mobile video {
    pointer-events: none;
}

/* ========================================== */
/* GALERÍA */
/* ========================================== */

.gallery-container {
    height: 350px;
    overflow: hidden;
    position: relative;
}

.gallery-image {
    transition: transform 4s ease-in-out, opacity 0.2s;
    transform: scale(1);
    width: auto;
    height: 100%;
    object-fit: cover;
}

.gallery-img {
    height: 450px;
    width: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* ========================================== */
/* EFECTOS Y UTILIDADES */
/* ========================================== */

.bg-transparente {
    background-color: rgba(99, 99, 99, 0.57);
}

.div-shadow {
    transition: transform 300ms ease;
}

.div-shadow:hover {
    transform: scale(1.1);
}

.bg-formulario {
    background-color: #f1f1f1;
    color: #333333;
}

.bg-formulario input,
.bg-formulario textarea {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #ccc;
}

.bg-formulario input::placeholder,
.bg-formulario textarea::placeholder {
    color: #999999;
}

/* Glass morphism effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hover zoom effect */
.hover-zoom {
    overflow: hidden;
}

.hover-zoom img {
    transition: transform 0.5s ease;
}

.hover-zoom:hover img {
    transform: scale(1.1);
}

/* Sucursales hover */
.sucursal {
    transition: transform 0.3s ease, color 0.3s ease;
}

.sucursal:hover {
    text-decoration: underline;
    color: #eaeaeb;
}

.sucursal:hover a {
    color: #0dcaf0 !important;
}

/* ========================================== */
/* SCROLLBARS PERSONALIZADOS */
/* ========================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #FF6B35;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #004E89;
}

.scrollbar-custom::-webkit-scrollbar {
    height: 6px;
}

.scrollbar-custom::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.scrollbar-custom::-webkit-scrollbar-thumb {
    background: #FF6B35;
    border-radius: 10px;
}

.scrollbar-custom::-webkit-scrollbar-thumb:hover {
    background: #F7931E;
}

/* ========================================== */
/* MENÚ MÓVIL */
/* ========================================== */

.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.mobile-menu.active {
    max-height: 500px;
}

/* ========================================== */
/* RESPONSIVE - TABLET (768px - 1024px) */
/* ========================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    #myCarousel,
    #hero-carousel {
        margin-top: 80px;
    }
    
    #myCarousel img,
    #hero-carousel img,
    #flotaCarousel img,
    #rallyCarousel img,
    #busCarousel img {
        max-height: 400px;
    }
    
    video.video-container {
        max-height: 60vh;
    }
    
    .gallery-img {
        height: 300px;
    }
    
    .bd-placeholder-img.rounded-circle {
        width: 120px !important;
        height: 120px !important;
    }
}

/* ========================================== */
/* RESPONSIVE - MÓVIL (max-width: 767px) */
/* ========================================== */

@media (max-width: 767.98px) {
    /* Navegación móvil */
    #myCarousel,
    #hero-carousel {
        margin-top: 60px;
    }
    
    .logo {
        height: 40px;
    }
    
    /* Imágenes y carruseles */
    #myCarousel img,
    #hero-carousel img,
    #flotaCarousel img,
    #rallyCarousel img,
    #busCarousel img {
        max-height: 250px;
    }
    
    .imagen-animada {
        width: 300%;
    }
    
    /* Videos */
    video.video-container {
        max-height: 300px;
    }
    
    /* Galería */
    .gallery-img {
        height: 220px;
    }
    
    .gallery-container {
        height: 250px;
    }
    
    /* Textos */
    .featurette-heading {
        font-size: 1.5rem !important;
    }
    
    /* SVG circulares */
    .bd-placeholder-img.rounded-circle {
        width: 80px !important;
        height: 80px !important;
    }
    
    /* Botones */
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Secciones */
    section {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Ocultar contenido hero en móvil */
    .hero-content-mobile-hide {
        display: none !important;
    }
    
    .hero-controls-mobile-hide {
        display: none !important;
    }
    
    /* Contenedores de ancho completo */
    section,
    .container,
    .row,
    .col,
    [class*="col-"],
    .card,
    .carousel,
    .carousel-item,
    .carousel-inner,
    iframe,
    img:not(.logo),
    video {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ========================================== */
/* RESPONSIVE - MÓVIL PEQUEÑO (max-width: 480px) */
/* ========================================== */

@media (max-width: 480px) {
    #myCarousel,
    #hero-carousel {
        margin-top: 50px;
    }
    
    #myCarousel img,
    #hero-carousel img {
        max-height: 200px;
    }
    
    .gallery-img {
        height: 180px;
    }
    
    .gallery-container {
        height: 200px;
    }
    
    .titulo {
        font-size: 12pt;
    }
    
    .subtitulo {
        font-size: 9pt;
        letter-spacing: 2px;
    }
    
    .logo {
        height: 35px;
    }
}

/* ========================================== */
/* UTILIDADES ADICIONALES */
/* ========================================== */

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.b-example-divider {
    width: 100%;
    height: 3rem;
    background-color: rgba(0, 0, 0, 0.1);
    border: solid rgba(0, 0, 0, 0.15);
    border-width: 1px 0;
    box-shadow: 
        inset 0 0.5em 1.5em rgba(0, 0, 0, 0.1),
        inset 0 0.125em 0.5em rgba(0, 0, 0, 0.15);
}

/* ========================================== */
/* OPTIMIZACIÓN DE PERFORMANCE */
/* ========================================== */

/* Prevenir movimientos innecesarios durante animaciones */
.animate-on-scroll,
.imagen-animada,
.rally-img,
.hover-zoom img {
    will-change: transform;
}

/* Forzar aceleración de hardware */
.carousel-item,
.rally-item,
.bus-item {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ========================================== */
/* SIMULADOR CAROUSEL - CSS */
/* ========================================== */

/* Contenedor principal del carousel */
#simulador-carousel {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 66.67%; /* Aspect ratio 3:2 (ajustar según necesites) */
    background-color: #f5f5f5;
    overflow: hidden;
}

/* Slides del simulador */
.simulador-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
    transform: translateZ(0); /* Hardware acceleration */
    backface-visibility: hidden;
}

.simulador-slide.active {
    opacity: 1;
    z-index: 2;
}

.simulador-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mantiene proporción sin deformar */
    object-position: center; /* Centra la imagen */
}

/* Animación de entrada para las slides */
@keyframes fadeSlide {
    0% {
        opacity: 0;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.simulador-slide.active {
    animation: fadeSlide 0.8s ease-out;
}

/* ========================================== */
/* INDICADORES */
/* ========================================== */

.simulador-indicator {
    cursor: pointer;
    background-color: white;
    transition: all 0.3s ease;
}

.simulador-indicator.active {
    opacity: 1 !important;
    transform: scale(1.3);
    background-color: #FF6B35; /* Color primary */
}

.simulador-indicator:hover {
    opacity: 0.9 !important;
    transform: scale(1.1);
}

/* ========================================== */
/* CONTROLES DE NAVEGACIÓN */
/* ========================================== */

.simulador-prev,
.simulador-next {
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Mostrar controles al hacer hover en el carousel */
#simulador-carousel:hover .simulador-prev,
#simulador-carousel:hover .simulador-next {
    opacity: 1;
}

.simulador-prev:hover,
.simulador-next:hover {
    background-color: rgba(0, 0, 0, 0.8) !important;
    transform: translateY(-50%) scale(1.1);
}

.simulador-prev:active,
.simulador-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* ========================================== */
/* RESPONSIVE */
/* ========================================== */

/* Tablet */
@media (max-width: 1024px) {
    #simulador-carousel {
        padding-bottom: 70%; /* Aspect ratio más cuadrado en tablet */
    }
    
    .simulador-prev,
    .simulador-next {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

/* Móvil */
@media (max-width: 768px) {
    /* Ocultar controles en móvil */
    .simulador-prev,
    .simulador-next {
        display: none !important;
    }
    
    #simulador-carousel {
        padding-bottom: 75%; /* Aspect ratio 4:3 en móvil */
    }
    
    /* Indicadores más grandes en móvil para mejor touch */
    .simulador-indicator {
        width: 12px !important;
        height: 12px !important;
    }
    
    .simulador-indicator.active {
        transform: scale(1.2);
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    #simulador-carousel {
        padding-bottom: 80%; /* Aspect ratio más alto en pantallas muy pequeñas */
    }
}

/* ========================================== */
/* OPTIMIZACIÓN DE PERFORMANCE */
/* ========================================== */

/* Prevenir movimientos durante animaciones */
.simulador-slide {
    will-change: opacity;
}

/* Mejorar rendering en navegadores webkit */
.simulador-slide,
.simulador-indicator,
.simulador-prev,
.simulador-next {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================== */
/* EFECTOS ADICIONALES (OPCIONAL) */
/* ========================================== */

/* Efecto de sombra en el contenedor */
#simulador-carousel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#simulador-carousel:hover::before {
    opacity: 1;
}

/* Overlay gradient sutil en las imágenes */
.simulador-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) 70%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.simulador-slide:hover::after {
    opacity: 1;
}