/* --- VARIABLES --- */
:root {
    --primary-color: #ff4500; /* Naranja deportivo */
    --bg-color: #0d0d0d; 
    --text-dark: #fff; 
    --text-light: #e0e0e0;
    --card-bg: rgba(25, 25, 25, 0.8);
}

/* --- RESET Y FUENTES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, #1a1a1a, #0d0d0d);
    color: var(--text-dark);
}

/* --- HEADER Y NAVEGACIÓN --- */
header {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo span {
    color: var(--primary-color);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--primary-color);
}

/* --- SECCIÓN HERO --- */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3)), 
                url('https://images.unsplash.com/photo-1603584173870-7f23fdae1b7a?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
}

.hero-content {
    max-width: 800px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    text-shadow: 1px 1px 5px rgba(0,0,0,0.8);
}

/* --- ESTRUCTURA PRINCIPAL (Filtros + Catálogo) --- */
.main-container {
    display: flex;
    flex-wrap: wrap;
    padding: 3rem 5%;
    gap: 30px;
}

/* --- FILTROS LATERALES --- */
.filters {
    flex: 1 1 250px;
    background: rgba(255, 255, 255, 0.05); /* Efecto cristal oscuro */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 12px;
    height: fit-content;
}

.filters h3 {
    margin-bottom: 25px;
    color: var(--text-light);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 8px;
}

.filter-group select {
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    outline: none;
    font-size: 1rem;
}

.filter-group select:focus {
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 10px;
}

.btn-primary:hover {
    background-color: #d13800;
    transform: translateY(-2px);
}

/* --- CATÁLOGO DE COCHES (CSS Grid) --- */
.car-catalog {
    flex: 3 1 600px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.car-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer; /* Indicar que se puede hacer clic */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.car-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border-color: rgba(255, 69, 0, 0.5); 
}

.car-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.car-info {
    padding: 20px;
}

.car-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-light);
}

.car-price {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 15px;
}

.car-specs {
    font-size: 0.9rem;
    color: #999;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

/* --- FOOTER --- */
footer {
    background: #050505;
    border-top: 2px solid #222;
    padding: 4rem 5% 2rem;
    margin-top: 3rem;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
}

.footer-col {
    flex: 1 1 250px;
}

.footer-col h4 {
    color: var(--text-light);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col p {
    color: #888;
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #222;
    color: #666;
    font-size: 0.9rem;
}

/* --- VENTANA MODAL (EL CLIC Y LA COMPRA) --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px); 
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-color);
    margin: 5% auto;
    width: 90%;
    max-width: 1000px;
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--text-light);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.close-btn:hover {
    color: var(--primary-color);
}

.modal-body {
    display: flex;
    flex-wrap: wrap;
}

.modal-image {
    flex: 1 1 50%;
    min-height: 300px;
    object-fit: cover;
    border-radius: 12px 0 0 12px;
}

.modal-info-box {
    flex: 1 1 50%;
    padding: 40px;
    color: var(--text-light);
}

.modal-info-box h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2rem;
}

.modal-price {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.modal-details p {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #ccc;
}

.modal-details strong {
    color: white;
}

.car-desc {
    margin-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 15px;
    line-height: 1.6;
    color: #ccc;
}

/* --- BOTONES DEL MODAL Y FORMULARIO DE PAGO --- */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn-secondary {
    padding: 15px;
    background-color: transparent;
    color: var(--text-light);
    border: 1px solid #555;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    flex: 1;
    transition: 0.3s;
}

.btn-secondary:hover {
    background-color: #333;
    border-color: var(--text-light);
}

.btn-buy {
    flex: 2;
}

.checkout-section {
    margin-top: 25px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    animation: modalFadeIn 0.4s ease;
}

.checkout-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.checkout-section input, 
.checkout-section select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: #1a1a1a;
    border: 1px solid #444;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
}

.btn-pay {
    width: 100%;
    padding: 15px;
    background-color: #28a745; 
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.1rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-pay:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .main-container { flex-direction: column; }
    .filters { flex: 1 1 100%; }
}

@media (max-width: 768px) {
    .modal-image {
        border-radius: 12px 12px 0 0;
        height: 250px;
    }
    .modal-info-box { padding: 20px; }
    .action-buttons { flex-direction: column; }
}

@media (max-width: 600px) {
    nav ul { display: none; }
    .hero h1 { font-size: 2.2rem; }
    .car-catalog { grid-template-columns: 1fr; }
}   