/* --- ESTILOS GENERALES Y RESETEO --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #0b0b0b; /* Fondo negro profundo */
    color: #e0e0e0;
    line-height: 1.6;
    scroll-behavior: smooth;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* --- ENCABEZADO Y NAVEGACIÓN --- */
header {
    background-color: #141414;
    border-bottom: 2px solid #ff1e27; /* Línea de acento roja deportiva */
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* MODIFICACIÓN: Flexbox para alinear el logo y el texto horizontalmente */
.logo {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px; /* Espacio ideal entre el logo de coche y las letras */
}

/* MODIFICACIÓN: Tamaño controlado para que el logo se vea pequeño y estilizado */
.brand-logo-img {
    height: 100px; /* Ajusta la altura para que combine con el texto */
    width: auto;   /* Evita que la silueta se deforme */
    object-fit: contain;
}

.logo span {
    color: #ff1e27;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

nav ul li a:hover {
    color: #ff1e27;
}

/* --- ESTILOS PARA LA SECCIÓN HERO --- */
.hero {
    /* PASO CLAVE: Reemplaza la ruta de la imagen */
    background: url('img-hero.png') no-repeat center center/cover;
    
    /* Mantiene tu diseño original */
    height: 70vh;
    display: flex;
    align-items: center;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #cf1c1c;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.hero-content p {
    font-size: 1rem;
    max-width: 700px;
    margin: 0 auto 30px auto;
    color: #1786a1;
}

.btn-primary {
    background-color: #ff1e27;
    color: #fff;
    padding: 12px 35px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background-color: #cc141b;
    transform: translateY(-2px);
}

/* --- SECCIÓN SOBRE NOSOTROS --- */
.about-section {
    padding: 60px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.about-box {
    background-color: #141414;
    padding: 40px;
    border-radius: 8px;
    border-left: 4px solid #333;
}

.about-box.text-accent {
    border-left-color: #ff1e27;
}

.about-box h2 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* --- SECCIÓN DE INVENTARIO Y FILTROS --- */
.catalog-section {
    padding: 60px 0;
    border-top: 1px solid #222;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2rem;
    color: #fff;
    letter-spacing: 1px;
}

.section-title p {
    color: #888;
}

/* Barra de Filtros */
.filter-bar {
    background-color: #141414;
    padding: 20px;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-group select {
    background-color: #222;
    color: #fff;
    border: 1px solid #444;
    padding: 8px 15px;
    border-radius: 4px;
    outline: none;
    font-family: inherit;
    cursor: pointer;
}

/* Malla/Grid de Autos */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* Tarjeta de Auto */
.car-card {
    background-color: #141414;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #222;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 30, 39, 0.1);
    border-color: #ff1e27;
}

.car-image-container {
    width: 100%;
    height: 250px; /* Mantiene tu ajuste visual aumentado */
    position: relative;
    overflow: hidden;
    background-color: #1a1a1a;
}

.car-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.car-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff1e27;
    color: #fff;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 3px;
}

.car-info {
    padding: 20px;
}

.car-brand-model {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.car-version {
    font-size: 0.85rem;
    color: #ff1e27;
    margin-bottom: 12px;
    font-weight: 600;
}

.car-specs {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #aaa;
    border-bottom: 1px solid #222;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.car-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.car-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.btn-details {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    border: 1px solid #ff1e27;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-details:hover {
    background-color: #ff1e27;
}

/* --- PIE DE PÁGINA (FOOTER) --- */
footer {
    background-color: #090909;
    padding: 60px 0 20px 0;
    border-top: 2px solid #ff1e27;
    margin-top: 8px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #222;
}

.footer-info h3 {
    color: #fff;
    margin-bottom: 15px;
}

.footer-info p {
    color: #888;
    font-size: 0.9rem;
}

.footer-contact h4 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1rem;
    text-transform: uppercase;
}

.footer-contact ul {
    list-style: none;
}

.footer-contact ul li {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 10px;
}

.footer-contact ul li strong {
    color: #fff;
}

.footer-bottom {
    padding-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

.footer-bottom a {
    color: #888;
}

.footer-bottom a:hover {
    color: #fff;
}

/* Responsivo para móviles */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    nav ul li {
        margin: 0 10px;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
}

/* --- FILTROS DE LOGOS DE MARCAS --- */
.filter-container {
    background-color: #141414;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 40px;
    border: 1px solid #222;
}

.filter-instruction {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
}

.brands-logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.brand-card-filter {
    background-color: #0b0b0b;
    border: 1px solid #222;
    border-radius: 6px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.brand-card-filter img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: grayscale(100%) brightness(200%);
    transition: all 0.3s ease;
}

.brand-card-filter span {
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-card-filter:hover {
    border-color: #ff1e27;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 30, 39, 0.1);
}

.brand-card-filter:hover img {
    filter: grayscale(0%) brightness(100%);
    transform: scale(1.1);
}

.brand-card-filter:hover span {
    color: #fff;
}

.brand-card-filter.active {
    border-color: #ff1e27;
    background-color: rgba(255, 30, 39, 0.05);
}

.brand-card-filter.active img {
    filter: grayscale(0%) brightness(100%);
}

.brand-card-filter.active span {
    color: #ff1e27;
}

/* Filtro secundario de segmento */
.filter-group-secondary {
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 1px solid #222;
    padding-top: 20px;
}

.filter-group-secondary label {
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-group-secondary select {
    background-color: #0b0b0b;
    color: #fff;
    border: 1px solid #444;
    padding: 8px 15px;
    border-radius: 4px;
    outline: none;
    font-family: inherit;
    cursor: pointer;
    min-width: 250px;
}

/* Flechas del carrusel en la tarjeta */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.carousel-btn:hover {
    background-color: #ff1e27;
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

/* --- VENTANA MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #141414;
    border: 2px solid #ff1e27;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 30px rgba(255, 30, 39, 0.2);
    animation: fadeInModal 0.4s ease;
}

@keyframes fadeInModal {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #ff1e27;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

@media (max-width: 768px) {
    .modal-grid { grid-template-columns: 1fr; }
}

.modal-gallery {
    width: 100%;
    height: 350px;
    background-color: #0b0b0b;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.modal-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-details h2 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 5px;
}

.modal-version-sub {
    color: #ff1e27;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
}

.specs-table td {
    padding: 12px 0;
    border-bottom: 1px solid #222;
    font-size: 0.95rem;
}

.specs-table td.spec-label {
    color: #888;
    font-weight: 600;
}

.specs-table td.spec-value {
    color: #fff;
    text-align: right;
}

.modal-price-box {
    background-color: #0b0b0b;
    padding: 15px 20px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #222;
}

.modal-price-label {
    color: #888;
    font-size: 0.9rem;
}

.modal-price-value {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
}

.modal-gallery-container {
    position: relative;
    width: 100%;
    height: 350px;
    background-color: #0b0b0b;
    border-radius: 8px;
    overflow: hidden;
}

.modal-gallery-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    padding: 12px 16px;
    cursor: pointer;
    z-index: 110;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.modal-carousel-btn:hover {
    background-color: #ff1e27;
}

.modal-carousel-btn.prev { left: 15px; }
.modal-carousel-btn.next { right: 15px; }

/* Oculta imágenes que no cargan */
.brand-card-filter img {
    display: block;
    width: 50px; /* O el tamaño que uses */
    height: 50px;
}

/* Si la imagen falla, la oculta completamente para que no estorbe */
.brand-card-filter img[src=""], 
.brand-card-filter img:not([src]) {
    display: none;
}