@font-face {
    font-family: 'Glacial Indifference';
    src: url('fonts/glacial-indifference.regular.otf') format('truetype');
}

body {
    font-family: 'Glacial Indifference', Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: inline;
    text-align: center;
    justify-content: center;
    align-items: center;
}

header {
    text-align: center;
    width: 100%;
    height: 210px;
    background-image: url(images/banner3.jpg);
}

.logo img {
    width: 450px; /* Adjust as necessary */
    margin-top: 55px;
}

/* --- NAVEGACIÓN HORIZONTAL BASE --- */
nav { width: 100%; text-align: center; }
nav ul { 
    list-style-type: none; 
    padding: 0; 
    margin: 0; 
    display: flex; 
    justify-content: center; 
    z-index: 9999 !important;
}
nav ul a { 
    display: block; 
    padding: 10px 15px; 
    text-decoration: none; 
    color: #ffffff; 
}
.nav-toggle { display: none; } /* Oculto siempre si no hay JS */

nav ul a:hover {
    text-decoration: underline; /* Subrayado al pasar el ratón */
}

.gallery {
    padding: 20px;
}

.image-row {
    display: flex;
    justify-content: space-around;
}

.image-row img {
    width: 250px; /* Adjust as necessary */
    margin: 5px;
}

.image-row2 {
    display: flex;
    justify-content: space-around;
}

.image-row2 img {
    width: 200px; /* Adjust as necessary */
    margin: 5px;
}

.image-row3 img {
    width: 75px; /* Adjust as necessary */
    height: 75px;
    padding: 15px;
}

.gallery a {
    font-size: 35px;
    list-style-type: none;
}

.gallery a:hover {
    text-decoration: underline; /* Subrayado al pasar el ratón */
}


.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
}

.menu-list {
    display: flex;
}

.menu-list.active {
    display: block;
}

.botonmas {
    max-width: 190px;      /* Limita el tamaño a tu medida ideal */
    width: 100%;           /* Hace que sea responsive si la pantalla es muy chica */
    height: auto;          /* Mantiene la proporción original para que no se deforme */
    display: block;        /* Obliga a la imagen a comportarse como un bloque para poder centrarla */
    margin: 25px auto;     /* Mantiene tus 25px de margen arriba/abajo, y el "auto" la centra a los lados */
    cursor: pointer;       /* Cambia el cursor por la "manito" para que parezca un botón real */
}

.whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: white;
    padding: 15px;
    font-size: 24px;
    z-index: 1000;
    text-align: center;
    text-decoration: none;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    margin-bottom: 40px;
}

.faq-question {
    font-family: 'Glacial Indifference', Arial, sans-serif;
    width: 100%;
    background-color: #f2f2f2;
    color: black;
    border: none;
    padding: 15px;
    text-align: left;
    outline: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    display: none;
    padding: 15px;
    background-color: #ffffff;
    border-top: 1px solid #ccc;
}

.toggle-icon {
    font-size: 24px;
}

.contact-form {
    max-width: 600px;
    margin: 40px auto;
    text-align: left;
}

.contact-form h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 28px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.contact-form button {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: darkblue;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
}

.contact-form button:hover {
    background-color: #002850;
}

.social-embed {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-bottom: 50px;
}

footer {
    background-image: url(images/banner3.jpg);
}

.container {
    width: 400px;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative; /* Usamos posicionamiento absoluto */
    left: 50%;
    transform: translate(-50%, 0%); /* Centrado perfecto */
    text-align: center;
  }

.financiacion-wrapper {
    width: 400px;
    padding: 20px;
    margin-bottom: 50px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative; /* Usamos posicionamiento absoluto */
    left: 50%;
    transform: translate(-50%, 0%); /* Centrado perfecto */
    text-align: center;
  }
  
  h1 {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  form {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  label {
    font-size: 16px;
    text-align: left;
  }
  
  select {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
  }
  
  .result {
    margin-top: 20px;
  }
  
  .result img {
    width: 300px;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    margin: 10px 0;
  }
  
  .result a {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
  }
  
  .result a:hover {
    background-color: #0056b3;
  }

  .form-container {
    width: 400px;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 1px rgba(0, 0, 0, 0.1);
    position: relative; /* Usamos posicionamiento absoluto */
    left: 50%;
    transform: translate(-50%, 0%); /* Centrado perfecto */
    text-align: center;
  }
  
  .hidden {
    display: none;
  }
  
  label {
    display: block;
    margin-top: 10px;
  }
  
  input, select, textarea, button {
    width: 100%;
    margin-top: 5px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
  }
  
  button {
    background-color: #007BFF;
    color: white;
    border: none;
    cursor: pointer;
    margin-top: 20px;
  }
  
  button:hover {
    background-color: #0056b3;
  }
  
  .time-select {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

/* Contenedor principal */
.container-usados {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Contenedor de filtros en diseño horizontal */
.filtro-container {
    display: flex;
    flex-wrap: wrap; /* Permite ajustar en pantallas pequeñas */
    gap: 10px; /* Espaciado entre elementos */
    align-items: center; /* Centra los elementos verticalmente */
    justify-content: center; /* Alinea hacia la izquierda */
}

.filtro-container label {
    margin-right: 5px; /* Espaciado entre etiqueta y campo */
}

.filtro-container select,
.filtro-container input {
    width: 120px; /* Ancho de los campos */
    padding: 5px;
    font-size: 14px;
}


/* Botones normales */
.filtro-container button {
    display: flex; /* Alinear los botones en línea */
    gap: 10px; /* Separación entre botones */
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap; /* Evita que el texto del botón haga "wrap" */
    margin-top: 4px;
}

/* Contenedor de los autos */
.cars-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 3 columnas */
    gap: 40px; /* Espaciado entre autos */
    width: 100%;
    height: auto;
    text-align: center;
}

/* ==========================================================================
   ESTILO DE LOS AUTOS (CATÁLOGO GENERAL)
   ========================================================================== */
.car-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Empuja el botón hacia abajo */
    height: 100%; /* Si usás grid, esto ayuda a igualar alturas */
    background: #fff; /* Asegura fondo blanco para la tarjeta */
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.car-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.car-item img {
    width: 100%;             /* Que ocupe todo el ancho de la tarjeta */
    height: 250px;           /* Altura fija para que todas sean iguales */
    object-fit: cover;       /* MÁGICO: Recorta la foto para que llene el cuadrado sin estirarse */
    object-position: center; /* Centra el recorte de la foto */
    border-radius: 8px 8px 0 0; /* Bordes redondeados solo arriba */
    display: block;          /* Evita espacios raros abajo */
}

/* ==========================================================================
   DOMANDO LAS IMÁGENES DEL MODAL DE DETALLES (SWIPER REVISADO)
   ========================================================================== */

/* Contenedor general del carrusel */
.swiper-container {
    width: 100%;
    height: 320px !important; /* Altura fija ideal para que luzca el auto */
    margin-bottom: 20px !important;
    background-color: #f8f9fa; /* Fondo gris claro sutil en vez de negro */
    overflow: hidden;
}

/* El contenedor interno donde se inyectan las fotos */
#car-images {
    height: 100% !important;
    display: flex !important;
}

/* Las imágenes individuales */
#car-images .swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Muestra el auto entero sin recortar nada */
    border-radius: 4px;
}

  /* Modal styles */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    max-width: 50%; /* Ajusta el tamaño máximo del modal */
    max-height: 100%; /* Ajusta la altura máxima del modal */
    overflow-y: auto;
    align-items: center; /* Centrar el contenido del modal */
    margin-left: 350px;
}
.modal-header {
    display: flex;
    justify-content: flex-end; /* Botón cerrar a la derecha */
    width: 100%;
}
  .modal-header h2 {
    display: none;
    margin: 0;
  }
  .modal-close {
    position: absolute;
    top: 15px;
    right: 15px; /* Botón cerrar en la esquina superior derecha */
    background: #626c7e;
    border: none;
    font-size: 18px;
    color: #000;
    width: 60px;
    height: 60px;
    text-align: center;
    cursor: pointer;
    border-radius: 50%; /* Botón redondo */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
}
  .modal-body img {
    width: 100%;
    margin-bottom: 10px;
  }
  .modal-body p {
    margin: 5px 0;
  }
  .whatsapp-button {
    background-color: #25d366;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
    display: block;
    margin: 10px auto;
  }
  .whatsapp-button:hover {
    background-color: #1da851;
  }

  .swiper-container {
    width: 100%;
    height: 400px; /* Ajustar el tamaño del slider */
    margin-top: 20px;
}

/* Ajustar las imágenes dentro del slider */
.swiper-slide img {
    max-width: 100%;
    max-height: 380px; /* Ajusta la altura según tus necesidades */
    object-fit: contain; /* Asegura que la imagen no se deforme */
    cursor: pointer; /* Indica que la imagen es clickeable */
}

/* Estilos para el modal de zoom */
.zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow: hidden; /* Asegura que no haya desplazamiento innecesario */
}

.zoom-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.zoom-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: white;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}

.sell-car-form {
    max-width: 600px;
    margin: 40px auto;
    text-align: left;
}

.sell-car-form h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 28px;
}

.sell-car-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
}

.sell-car-form input,
.sell-car-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.sell-car-form button {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: darkblue;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
}

.sell-car-form button:hover {
    background-color: #002850;
}

/* Oculto por defecto en todos lados */
#btn-instalar {
    display: none !important;
}

/* Solo visible cuando el ancho de pantalla es menor a 768px (móviles y tablets) */
@media screen and (max-width: 768px) {
    #btn-instalar {
        display: none !important; /* Seguirá oculto hasta que tu script lo cambie a 'block' */
    }
}

/* Tablets (pantallas entre 768px y 1024px) */
@media screen and (max-width: 1024px) {
    .logo img {
        width: 300px;
    }

    .menu-list {
        flex-wrap: wrap; /* Ajusta el menú a varias líneas si es necesario */
        justify-content: center;
    }

    .gallery .image-row img {
        width: 200px;
    }

    .container-usados {
        margin-top: 10px;
    }

    .filtro-container {
        flex-direction: column; /* Cambia a disposición vertical */
        align-items: center;
    }

    .filtro-container label, 
    .filtro-container select, 
    .filtro-container input {
        width: 80%; /* Aumenta el tamaño en pantallas pequeñas */
        margin-bottom: 10px;
    }

    .cars-container {
        grid-template-columns: repeat(2, 1fr); /* Cambia a 2 columnas */
    }

    .modal-content {
        max-width: 80%; /* Reduce el ancho del modal */
    }

    .swiper-container {
        height: 300px; /* Ajusta el tamaño del slider */
    }
}

/* Móviles (pantallas entre 480px y 768px) */
@media screen and (max-width: 768px) {
    header {
        height: 150px;
        text-align: center;
    }

    .logo img {
        width: 250px;
        margin-top: 20px;
    }

    nav ul a {
        margin: 0 10px;
        font-size: 14px;
    }

    .gallery .image-row img {
        width: 150px;
    }

    .filtro-container {
        gap: 5px;
    }

    .cars-container {
        grid-template-columns: repeat(1, 1fr); /* Cambia a 1 columna */
        gap: 20px;
    }

    .car-item {
        padding: 10px;
    }

    .modal-content {
        max-width: 90%; /* Más pequeño para móviles */
    }

    .swiper-container {
        height: 250px; /* Reduce el tamaño del slider */
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Teléfonos pequeños (pantallas menores a 480px) */
@media screen and (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .logo img {
        width: 200px;
    }

    .nav-toggle {
        display: block; /* Mostrar el botón de menú */
    }

    .menu-list {
        display: none; /* Ocultar el menú en pantallas pequeñas */
    }

    .menu-list.active {
        display: flex;
        flex-direction: column; /* Menú en columna */
        background-color: #333;
        width: 100%;
        padding: 10px;
    }

    .menu-list a {
        color: white;
        padding: 10px;
        text-align: center;
        border-bottom: 1px solid #444;
    }

    .filtro-container {
        flex-direction: column; /* Alinea filtros verticalmente */
        width: 100%;
    }

    .filtro-container label,
    .filtro-container select,
    .filtro-container input {
        width: 100%;
    }

    .cars-container {
        grid-template-columns: 1fr; /* Una sola columna */
    }

    .car-item img {
        max-height: 200px;
    }

    .modal-content {
        max-width: 90%; /* Más pequeño para teléfonos */
        margin: 0 auto;
    }

    .swiper-container {
        height: 200px;
    }
}

/* WhatsApp button responsiveness */
.whatsapp {
    bottom: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
}

.whatsapp img {
    width: 100%;
    height: auto;
}

/* Modal Adjustments for Small Screens */
.modal-body img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: cover;
}

/* --- RESPONSIVE CSS ADAPTATIVO (SIN TOCAR TU CSS ORIGINAL) --- */

@media screen and (max-width: 480px) {
    /* 1. MANTENER TU DISEÑO ORIGINAL Y EVITAR DESBORDE */
    body { width: 100% !important; overflow-x: hidden !important; }
    
    /* 2. REPARACIÓN DEL MENÚ (Para que funcione con tu JS) */
    .nav-toggle { display: block !important; }
    
    nav ul { 
        display: none !important; /* Oculto por defecto */
        flex-direction: column !important; 
        background: #002850; 
        width: 100%;
        position: relative; 
        padding: 0 !important;
        margin: 0 !important;
    }
    
    nav ul.active { 
        display: flex !important; /* Tu JS activa esto */
    }
    
    nav ul li { width: 100%; border-bottom: 1px solid #444; }
    nav ul li a { display: block !important; padding: 15px !important; margin: 0 !important; }

    /* 3. REPARACIÓN DE GRID Y CONTENEDORES (Sin borrar tus medidas) */
    .cars-container { 
        grid-template-columns: 1fr !important; /* Una sola columna en móvil */
        gap: 10px !important; 
    }
    
    .container, .form-container, .contact-form, .sell-car-form { 
        width: 95% !important; 
        margin: 10px auto !important; 
    }
    
    .filtro-container { flex-direction: column !important; }
    .filtro-container select, .filtro-container input { width: 100% !important; }
    
    /* 4. IMÁGENES RESPONSIVE (Evita que se rompa el diseño) */
    img { max-width: 100% !important; height: auto !important; }
    .image-row, .image-row2 { justify-content: center !important; }
}

/* --- REGLAS DE SEGURIDAD PARA EVITAR SCROLL HORIZONTAL --- */

/* 1. Regla global para todas las imágenes (Escritorio y Móvil) */
img { 
    max-width: 100%; /* Obliga a la imagen a no ser más ancha que su contenedor */
    height: auto;     /* Mantiene la proporción para que no se vea estirada */
}

/* 2. Ajustes específicos dentro del Media Query que ya tienes */
@media screen and (max-width: 480px) {
    
    /* Previene que el cuerpo de la web se estire de más */
    body { 
        width: 100% !important; 
        overflow-x: hidden !important; 
    }

    /* Ajuste para las filas de imágenes (Galería y Clientes) */
    .image-row, .image-row2 {
        display: flex !important;
        flex-wrap: wrap !important; /* Permite que bajen si no entran */
        justify-content: center !important;
        gap: 10px !important; /* Espaciado controlado */
        width: 100% !important;
        padding: 0 10px !important; /* Margen de seguridad lateral */
    }

    /* Aseguramos que tus imágenes específicas (250px y 200px) se adapten */
    .image-row img, .image-row2 img {
        /* Siguen intentando ser 250px o 200px, pero 'max-width: 100%' de arriba las frena si el celular es chico */
        margin: 5px !important;
    }
}