/* --- ¡ESTO ES LO QUE TE FALTABA! --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Esto evita que el padding rompa el ancho */
}

:root {
    --bg: #050505;
    --text: #ffffff;
    --card-bg: #111111;
    --border: #333;
    --accent: #fff;
}


body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* (PEGA AQUÍ LOS ESTILOS DEL NAVBAR QUE YA TIENES EN EL INDEX) */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    /* FIX DEFINITIVO DE POSICIÓN */
    height: 100px;
    padding: 0 50px;
    position: fixed;
    top: 0;
    left: 0;  /* Pegado a la izquierda */
    right: 0; /* Pegado a la derecha */
    /* width: 100%; <--- BORRA ESTA LÍNEA, 'right: 0' ya lo hace llenar todo */
    
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-img {
    height: 70px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 10px; /* Espacio entre botones */
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    /* Forma de la cápsula */
    padding: 10px 25px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: var(--accent);
    color: #000000;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}


/* --- HERO VIDEO CATÁLOGO --- */
.cat-hero {
    position: relative;
    width: 100%;
    height: 70vh; /* 70% of viewport height */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.cat-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
}

.cat-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding-top: 80px; /* offset navbar */
}

.cat-hero-title {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: var(--text);
    margin: 0 0 10px 0;
    font-family: 'Impact', sans-serif;
    transform: scaleY(1.1);
    text-shadow: 0 5px 20px rgba(0, 0, 0, 0.9);
}

.cat-hero-subtitle {
    font-size: 1.2rem;
    color: var(--accent);
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* --- CONTENEDOR PRINCIPAL --- */
.catalogo-container {
    padding: 80px 5% 50px; /* Reduced from 150px since Hero is above */
    max-width: 1400px;
    margin: 0 auto;
}

/* --- SELECTOR DE AUTOS CONFIGURABLES --- */
.configurable-showcase {
    margin-bottom: 80px;
}

.showcase-header {
    text-align: center;
    margin-bottom: 40px;
}

.showcase-header h2 {
    font-size: 2.2rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.showcase-header p {
    color: #aaa;
    font-size: 1rem;
}

.configurable-grid {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding: 20px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
}
.configurable-grid::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.config-card {
    flex: 0 0 calc(25% - 23px); /* 4 cards fitting screen mostly */
    min-width: 280px;
    height: 400px;
    position: relative;
    border-radius: 12px;
    background: rgba(20,20,20,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 30px 20px;
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
    scroll-snap-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.config-card img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 90%;
    object-fit: contain;
    z-index: 2;
    transition: all 0.5s ease;
    filter: drop-shadow(0 15px 15px rgba(0,0,0,0.8));
}

.glow-bg {
    position: absolute;
    width: 150px;
    height: 150px;
    background: var(--accent);
    filter: blur(80px);
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.1;
    z-index: 1;
    transition: all 0.5s ease;
}

.config-info {
    position: relative;
    z-index: 3;
    text-align: center;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.config-info h3 {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    white-space: nowrap;
}

.btn-config {
    display: inline-block;
    padding: 8px 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text);
    border: 1px solid var(--accent);
    opacity: 0;
    transition: all 0.4s ease;
}

/* Hover Effects */
.config-card:hover {
    transform: translateY(-15px);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}

.config-card:hover img {
    transform: translate(-50%, -70%) scale(1.1);
}

.config-card:hover .glow-bg {
    opacity: 0.3;
    filter: blur(60px);
}

.config-card:hover .config-info {
    transform: translateY(0);
}

.config-card:hover .btn-config {
    opacity: 1;
    background: var(--accent);
    color: #000;
}

@media (max-width: 1024px) {
    .config-card {
        flex: 0 0 calc(50% - 15px);
    }
}
@media (max-width: 768px) {
    .config-card {
        flex: 0 0 85%;
    }
    .cat-hero-title {
        font-size: 3rem;
    }
}

/* --- HEADER DE INVENTARIO GENERAL --- */
.inventario-general-header {
    text-align: center;
    margin: 80px 0 40px;
}
.inventario-general-header h2 {
    font-size: 2rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
}
.inventario-general-header p {
    color: var(--text-muted);
}

/* TÍTULOS DE CATEGORÍA */
.category-title {
    font-size: 2.2rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 60px 0 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

/* GRID DE AUTOS */
.grid-autos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 80px;
}

/* TARJETA DE AUTO REDISEÑADA */
.car-card {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    position: relative;
    padding: 0;
}

.card-image {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(30,30,30,0.5) 0%, transparent 70%);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all 0.5s ease;
    padding: 20px;
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.8));
    transition: transform 0.5s ease;
}

.car-card:hover .card-image {
    background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, transparent 70%);
}

.car-card:hover .card-image img {
    transform: scale(1.1) translateY(-10px);
}

.card-info {
    padding: 25px 0;
    transition: all 0.3s ease;
}

.card-info h3 {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    color: var(--text);
    transition: color 0.3s ease;
}

.card-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0; /* Ocultamos por defecto */
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.car-card:hover .card-info h3 {
    color: var(--accent);
}

.car-card:hover .card-info p {
    opacity: 1;
    transform: translateY(0);
}

/* --- EL MODAL (VENTANA FLOTANTE) --- */
.modal-overlay {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    /* Fondo oscuro transparente */
    backdrop-filter: blur(8px);
    /* Efecto borroso pro */
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Cuando se activa con JS */
.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #111;
    width: 90%;
    max-width: 1000px;
    border-radius: 20px;
    border: 1px solid #333;
    position: relative;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

/* Layout del Modal (Grid) */
.modal-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    /* Imagen grande, Datos a la derecha */
    gap: 40px;
    align-items: center;
}

.modal-img-container img {
    width: 100%;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6));
}

.modal-details .badge {
    background-color: #333;
    color: #fff;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-details h2 {
    font-size: 3rem;
    margin: 15px 0 5px;
    text-transform: uppercase;
    line-height: 1;
}

.modal-details .price {
    color: #888;
    font-weight: 300;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

/* Tabla de Specs */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 40px;
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    padding: 20px 0;
}

.spec-item {
    display: flex;
    flex-direction: column;
}

.spec-item .label {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.spec-item .value {
    font-size: 1.1rem;
    font-weight: bold;
}

/* Botones */
.modal-actions {
    display: flex;
    gap: 15px;
}

.btn-modal {
    flex: 1;
    text-align: center;
    padding: 15px;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: all 0.3s;
}

.btn-modal.primary {
    background-color: #fff;
    color: #000;
}

.btn-modal.primary:hover {
    background-color: #ccc;
}

.btn-modal.secondary {
    border: 1px solid #fff;
    color: #fff;
}

.btn-modal.secondary:hover {
    background-color: #fff;
    color: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .modal-details h2 {
        font-size: 2rem;
    }

    .specs-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}