/* Catálogo y ficha de vehículo */

.coches-section {
    padding: 40px 5%;
    background: #f8f9fa;
    min-height: 60vh;
}

.coches-cabecera {
    max-width: 1200px;
    margin: 0 auto 30px;
    text-align: center;
}

.coches-cabecera h1 {
    color: #333;
    border-bottom: 3px solid var(--azul, #007bff);
    display: inline-block;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.coches-cabecera p {
    color: #666;
    margin: 0;
}

.car-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.car-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .08);
    transition: transform .3s ease;
    border: 1px solid #eef2f6;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.car-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, .12);
}

.car-image-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f1f3f5;
    position: relative;
}

.car-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.car-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.car-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.car-title a {
    color: inherit;
    text-decoration: none;
}

.car-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    text-transform: uppercase;
}

.car-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: #007bff;
    white-space: nowrap;
}

.car-acabado {
    font-size: .85rem;
    color: #777;
    margin-bottom: 15px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.car-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.car-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #444;
    background: #f0f2f5;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
}

.car-acciones {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-ver-coche,
.btn-vista-rapida {
    flex: 1;
    padding: 13px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: .9rem;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: .3s;
    text-decoration: none;
    display: block;
}

.btn-ver-coche {
    background: #007bff;
    color: #fff;
}

.btn-ver-coche:hover { background: #0056b3; }

.btn-vista-rapida {
    background: #fff;
    color: #007bff;
    border: 2px solid #007bff;
}

.btn-vista-rapida:hover { background: #eaf4ff; }

/* --- Modal vista rápida --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #fff;
    width: 95%;
    max-width: 1050px;
    height: 90vh;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .5);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 35px;
    cursor: pointer;
    z-index: 100;
    color: #fff;
    background: rgba(0, 0, 0, .35);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
}

.popup-gallery {
    flex: 1.3;
    background: #000;
    display: flex;
    flex-direction: column;
}

.main-img-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.main-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumb-strip {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    background: #111;
}

.thumb-strip img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: .5;
    flex-shrink: 0;
}

.thumb-strip img.active {
    opacity: 1;
    border: 2px solid #007bff;
}

.popup-details {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* --- Ficha --- */
.ficha {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 5% 60px;
}

.migas {
    font-size: 13px;
    color: #777;
    margin-bottom: 18px;
}

.migas a { color: #007bff; text-decoration: none; }
.migas span { margin: 0 6px; }

.ficha-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 35px;
    align-items: start;
}

.ficha-galeria {
    background: #000;
    border-radius: 14px;
    overflow: hidden;
}

.ficha-galeria .principal {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.ficha-miniaturas {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    background: #111;
}

.ficha-miniaturas img {
    width: 78px;
    height: 56px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    opacity: .55;
    flex-shrink: 0;
}

.ficha-miniaturas img.active { opacity: 1; border: 2px solid #007bff; }

.ficha-datos h1 {
    font-size: 1.8rem;
    margin: 0 0 6px;
    color: #222;
}

.ficha-acabado {
    color: #666;
    font-weight: 600;
    margin-bottom: 18px;
}

.ficha-precio {
    font-size: 2.2rem;
    font-weight: 800;
    color: #007bff;
    margin-bottom: 6px;
}

.ficha-nota {
    font-size: .85rem;
    color: #666;
    margin-bottom: 22px;
}

.ficha-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: .95rem;
}

.ficha-tabla th,
.ficha-tabla td {
    text-align: left;
    padding: 10px 6px;
    border-bottom: 1px solid #eef2f6;
}

.ficha-tabla th {
    color: #666;
    font-weight: 600;
    width: 45%;
}

.ficha-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-principal,
.btn-secundario {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: .25s;
}

.btn-principal { background: #25d366; color: #fff; }
.btn-principal:hover { background: #1eb757; }

.btn-secundario {
    background: #fff;
    color: #007bff;
    border: 2px solid #007bff;
}

.btn-secundario:hover { background: #eaf4ff; }

.ficha-similares {
    margin-top: 60px;
}

.ficha-similares h2 {
    font-size: 1.4rem;
    margin-bottom: 22px;
    color: #222;
}

.aviso-vendido {
    background: #fff8e6;
    border: 1px solid #ffe8b8;
    color: #6b4b00;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 22px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .modal-content {
        flex-direction: column;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    .popup-gallery { height: 42vh; flex: none; }
    .ficha-grid { grid-template-columns: 1fr; }
    .ficha-precio { font-size: 1.8rem; }
}
