/* ==========================================
   VEHICLES PAGE STYLES
   ========================================== */

.vehicles-header {
    position: relative;
    padding: 0;
    text-align: center;
    margin-top: 70px;
    min-height: 500px;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--color-black);
}

/* Imagen de fondo - CORREGIDA */
.vehicles-header img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    max-width: none;
    object-fit: cover;
    z-index: 0;
}

/* Overlay oscuro sobre la imagen */
.vehicles-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

/* Contenedor del contenido */
.vehicles-header .container {
    position: relative;
    z-index: 2;
    padding: 2rem;
}

.vehicles-header h1 {
    font-size: 3.5rem;
    color: var(--color-white);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 3px 3px 15px rgba(0, 0, 0, 0.9);
}

.vehicles-header h1 i {
    color: var(--color-red);
    font-size: 3rem;
}

.vehicles-header p {
    font-size: 1.5rem;
    color: var(--color-white);
    opacity: 0.95;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.9);
}

/* Responsive */
@media (max-width: 768px) {
    .vehicles-header {
        min-height: 350px;
        height: 50vh;
    }

    .vehicles-header h1 {
        font-size: 2.5rem;
        gap: 0.5rem;
        flex-direction: row;
    }

    .vehicles-header h1 i {
        font-size: 2rem;
    }

    .vehicles-header p {
        font-size: 1.2rem;
    }
}

/* ==========================================
   FILTERS
   ========================================== */
.filters-section {
    background: var(--color-dark-gray);
    padding: 2rem 0;
    border-bottom: 2px solid var(--color-red);
}

.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    color: var(--color-white);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label i {
    color: var(--color-red);
}

.filter-select {
    padding: 0.8rem;
    border: 2px solid var(--color-gray);
    border-radius: 8px;
    background: var(--color-black);
    color: var(--color-white);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-red);
}

.filter-select option {
    background: var(--color-black);
    color: var(--color-white);
}

/* ==========================================
   VEHICLES GRID
   ========================================== */
.vehicles-section {
    padding: 3rem 0;
    background: var(--color-black);
    min-height: 50vh;
}

.vehicles-count {
    color: var(--color-white);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    opacity: 0.8;
}

.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.vehicle-card {
    background: var(--color-dark-gray);
    border: 2px solid var(--color-gray);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.vehicle-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-red);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

/* CORRECCIÓN: Estilos para el contenedor de imagen - SE ADAPTA A LA IMAGEN */
.vehicle-image-container {
    width: 100%;
    height: auto;
    background: #000;
    overflow: hidden;
    display: block;
    position: relative;
}

.vehicle-image-container img,
.vehicle-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.vehicle-info {
    padding: 1.5rem;
}

.vehicle-title,
.vehicle-name {
    font-size: 1.3rem;
    color: var(--color-white);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.vehicle-price {
    font-size: 1.5rem;
    color: var(--color-red);
    font-weight: 800;
    margin-bottom: 1rem;
}

.vehicle-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-white);
    font-size: 0.9rem;
}

.spec-item i {
    color: var(--color-red);
    width: 20px;
}

.btn-view-more {
    width: 100%;
    padding: 0.8rem;
    background: var(--color-red);
    color: var(--color-white);
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-view-more:hover {
    background: var(--color-red-dark);
    transform: translateY(-2px);
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-white);
}

.no-results i {
    font-size: 4rem;
    color: var(--color-red);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.no-results p {
    opacity: 0.7;
}

/* ==========================================
   VEHICLE MODAL
   ========================================== */
.vehicle-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    overflow-y: auto;
    padding: 2rem;
}

.vehicle-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content-vehicle {
    background: var(--color-dark-gray);
    border: 2px solid var(--color-red);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 0;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--color-red);
    color: var(--color-white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--color-white);
    color: var(--color-red);
    transform: rotate(90deg);
}

.modal-gallery {
    position: relative;
    width: 100%;
}

.main-image-container {
    position: relative;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    margin-bottom: 0;
    width: 100%;
    background: #000;
}

.main-image-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    background: #000;
    display: block;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(220, 38, 38, 0.8);
    color: var(--color-white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.gallery-nav:hover {
    background: var(--color-red);
}

.gallery-nav.prev {
    left: 1rem;
}

.gallery-nav.next {
    right: 1rem;
}

.thumbnails-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    padding: 1rem;
    background: var(--color-black);
}

.thumbnail {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--color-red);
}

.modal-info {
    padding: 2rem;
}

.modal-info h2 {
    color: var(--color-white);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.modal-price {
    font-size: 2.5rem;
    color: var(--color-red);
    font-weight: 900;
    margin-bottom: 2rem;
}

.modal-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--color-black);
    border-radius: 12px;
}

.modal-spec-item,
.spec-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--color-white);
}

.modal-spec-item i {
    color: var(--color-red);
    font-size: 1.2rem;
    width: 25px;
}

.modal-spec-item strong,
.spec-row strong {
    color: var(--color-red);
    margin-right: 0.5rem;
}

.modal-features {
    margin-bottom: 2rem;
}

.modal-features h3 {
    color: var(--color-white);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-white);
    padding: 0.5rem;
    background: var(--color-black);
    border-radius: 8px;
}

.feature-item i {
    color: var(--color-red);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-actions .btn {
    flex: 1;
    justify-content: center;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    .main-image-container img {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .vehicle-image-container {
        height: auto;
    }
    
    .vehicle-image-container img,
    .vehicle-image {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    .main-image-container img {
        width: 100%;
        height: auto;
    }
    
    .filters-container {
        grid-template-columns: 1fr;
    }

    .vehicles-grid {
        grid-template-columns: 1fr;
    }

    .modal-content-vehicle {
        padding: 0;
        margin: 1rem;
    }

    .main-image-container img {
        height: 300px;
    }

    .modal-info {
        padding: 1.5rem;
    }

    .modal-price {
        font-size: 2rem;
    }

    .modal-specs {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }
}