@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500&display=swap');

/* ── RESET ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── BODY ── */
body {
    font-family: 'DM Sans', "Segoe UI", Arial, sans-serif;
    background: #eef2f7;
    color: #111;
    -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════
   HEADER & NAVBAR
════════════════════════════════ */

.top-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #000;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 48px;
    height: 80px;
}

.logo img {
    height: 46px;
    width: auto;
    display: block;
}

/* ── MENU ── */
.menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    margin-left: auto;
}

.menu li {
    display: flex;
    align-items: center;
    height: 80px;
    color: white;
}

.menu a {
    position: relative;
    display: flex;
    align-items: center;
    height: 50%;
    padding: 0 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #aaa;
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.menu a::after {
    content: "";
    position: absolute;
    left: 14px;
    bottom: -4px;
    width: 0%;
    height: 2px;
    background: #cc0000;
    transition: 0.3s;
}

.menu a:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.menu a:hover::after {
    width: calc(100% - 28px);
}

/* ── CERRAR SESIÓN ── */
.menu li:has(.logout-btn) {
    margin-left: 12px;
}

.logout-btn {
    padding: 9px 20px;
    border: 1.5px solid #cc0000;
    border-radius: 6px;
    background: transparent;
    color: #cc0000;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.logout-btn:hover {
    background: #cc0000;
    color: #fff;
}

/* ── HOLA USUARIO ── */
.menu li:last-child {
    margin-left: 8px;
    padding: 0 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: #666;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-left: 1px solid rgba(255,255,255,0.08);
}

.menu li strong,
.menu li:last-child strong {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.5px;
    padding: 0 8px;
    margin-left: 4px;
    white-space: nowrap;
}

/* ── HAMBURGUESA ── */
.menu-toggle {
    display: none;
    font-size: 22px;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    user-select: none;
}

.menu-logo {
    display: none;
}

.menu-logo img {
    width: 120px;
}

.menu-close {
    display: none;
}

/* ════════════════════════════════
   LAYOUT
════════════════════════════════ */

.container {
    max-width: 1300px;
    margin: auto;
    padding: 40px 30px;
    width: 100%;
}

.main-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
}

.content-catalogo {
    flex: 1;
    min-width: 0;
}

/* ════════════════════════════════
   SIDEBAR FILTROS
════════════════════════════════ */

.sidebar-filtros {
    position: sticky;
    top: 10px;
    align-self: flex-start;
    transition: transform 0.3s ease;
}

.sticky-content {
    position: sticky;
    top: 10px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #ffffff;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.filtros-header h2 {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    color: #111827;
}

.filtro-vertical {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.filtro-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filtro-group label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #634b4c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    background: rgba(214,15,15,0.1);
    color: #d60f0f;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.modern-slider {
    cursor: pointer;
    height: 6px;
    accent-color: #d60f0f;
}

/* ── BOTÓN FILTROS MÓVIL ── */
.btn-filtros-movil {
    display: none;
    width: 100%;
    padding: 12px;
    background: #111;
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    border-radius: 20px;
}

.btn-cerrar-filtros {
    display: none;
}

/* ════════════════════════════════
   INPUTS & SELECTS (globales)
════════════════════════════════ */

input,
select {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: 0.3s;
    color: #0a0a0a;
}
input,
select,
textarea {
    color: #111 !important;
    background-color: #fff !important;
    -webkit-text-fill-color: #111 !important;
    caret-color: #111;
}

input:focus,
select:focus {
    border-color: #d60f0f;
    outline: none;
    box-shadow: 0 0 0 3px rgba(214,15,15,0.15);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-text-fill-color: #111 !important;
    box-shadow: 0 0 0px 1000px #fff inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ════════════════════════════════
   BOTONES GENÉRICOS
════════════════════════════════ */

.btn-primary {
    background: #d60f0f;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
}

.btn-primary:hover {
    background: #7c0a0a;
    transform: translateY(-2px);
}

/* ════════════════════════════════
   GRID CATÁLOGO
════════════════════════════════ */

.catalogo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* ════════════════════════════════
   CARD COCHE
════════════════════════════════ */

.coche {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    cursor: pointer;
    position: relative;
    transition: 0.25s ease;
    border: 1px solid #ececec;
}

.coche:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.10);
}

.coche img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-horizontal {
    display: flex;
    gap: 15px;
    height: 100%;
    padding: 14px;
}

.card-img {
    width: 45%;
    min-width: 150px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #ddd;
}

.card-img img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
}

.card-info {
    width: 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    background: #f3f4f6;
    padding: 16px;
    border-radius: 12px;
}

/* ── INFO CARD ── */
.info { padding: 20px; }

.card-info .marca,
.marca {
    font-weight: 700;
    font-size: 18px;
    color: #111827;
    display: flex;
    justify-content: center;
}

.card-info .modelo,
.modelo {
    font-size: 13px;
    color: #4b5563;
    background: #e5e7eb;
    padding: 5px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.card-info .detalles,
.detalles {
    font-size: 13px;
    color: #111827;
    background: #e5e7eb;
    padding: 5px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
}

.card-info .precio,
.precio {
    margin-top: 8px;
    font-weight: 800;
    color: #ef4444;
    font-size: 22px;
    background: #e5e7eb;
    padding: 5px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
}

/* ── FAVORITO ── */
.fav {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.92);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    cursor: pointer;
    z-index: 30;
    border: 1px solid #f0f0f0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transition: 0.2s;
}

.fav.active { color: #db2121; background: #fff; }
.fav:hover  { transform: scale(1.08); }

/* ── ESTADOS RIBBON ── */
.img-estado {
    filter: grayscale(100%) brightness(0.82);
    opacity: 0.92;
}

.estado-ribbon {
    position: absolute;
    top: 16px;
    left: -44px;
    width: 165px;
    text-align: center;
    transform: rotate(-45deg);
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 8px 0;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.28);
    pointer-events: none;
}

.estado-ribbon.estado-vendido   { background: #dc2626; }
.estado-ribbon.estado-reservado { background: #f59e0b; }

/* ── BOTÓN ELIMINAR ── */
.btn-eliminar {
    margin-top: 15px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #ef4444;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-eliminar:hover { background: #dc2626; }

/* ════════════════════════════════
   MODAL VEHÍCULO
════════════════════════════════ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.70);
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 30px 16px;
    z-index: 3000;
}

.modal-box {
    position: relative;
    width: min(1050px, 92vw);
    max-height: 92vh;
    overflow-y: auto;
    background: #f5f5f5;
    border-radius: 18px;
    padding: 22px 22px 26px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.30);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.modal-close-inside,
#cerrarModalVehiculo,
#cerrarModal {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #111;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    z-index: 60;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.modal-contenido {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.modal-top {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 34px;
    align-items: start;
    margin-top: 8px;
}

.modal-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    overflow: hidden;
    background: #ddd;
    box-shadow: 0 10px 25px rgba(0,0,0,0.10);
}

.modal-img,
.modal-main-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.galeria { width: 100%; }

.modal-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
}

.modal-thumbs img {
    width: 90px;
    height: 70px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 5px;
    border: 2px solid transparent;
    transition: 0.2s;
}

.modal-thumbs img:hover {
    border: 2px solid red;
    transform: scale(1.05);
}

.modal-info-pro {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 6px;
}

.modal-info-pro .titulo {
    font-size: 24px;
    font-weight: 800;
    color: #111;
    margin: 0;
}

.precio-pro,
#modalPrecio,
.precio-box {
    font-size: 32px;
    font-weight: 900;
    color: #d60f0f;
    margin-bottom: 5px;
}

.modal-right {
    background: #f3f4f6;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
}

.grid-datos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

#modalDesc {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
    margin-top: 20px;
    line-height: 1.6;
    white-space: pre-line;
}

.dato {
    background: #f9fafb;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.valor {
    font-size: 15px;
    font-weight: 700;
    color: #111;
}

.ficha p { margin: 8px 0; }

.modal-acciones {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-ver-pro,
#btnVerVehiculo {
    flex: 1;
    min-width: 180px;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: #e10600;
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-ver-pro:hover,
#btnVerVehiculo:hover { background: #b70000; }

.btn-favorito-modal {
    flex: 1;
    min-width: 180px;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: #111;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-favorito-modal.active { background: #e10600; color: #fff; }

.btn-secundario-modal {
    flex: 1;
    min-width: 160px;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: #374151;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-secundario-modal:hover { background: #111827; }

/* ── RECOMENDADOS ── */
.rec-titulo {
    margin: 6px 0 0;
    font-size: 16px;
    font-weight: 700;
}

.rec-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.modal-recomendados {
    width: 100%;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-top: 10px;
    border-top: 1px solid #eee;
    scroll-behavior: smooth;
}

.modal-rec-card {
    flex: 0 0 calc((100% - 30px) / 4);
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: 0.2s;
    overflow: hidden;
}

.modal-rec-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.modal-rec-img-wrap {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #ddd;
}

.modal-rec-img-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-rec-info { padding: 8px; }
.modal-rec-titulo { font-size: 13px; font-weight: 600; color: #111; }
.modal-rec-precio { font-size: 13px; font-weight: 700; color: #d60f0f; }

.rec-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 2;
}

.rec-btn.left  { left: -10px; }
.rec-btn.right { right: -10px; }
.rec-btn:hover { background: #f3f3f3; }

/* ════════════════════════════════
   MODAL AUTH
════════════════════════════════ */

#cerrarModalAuth {
    position: absolute;
    top: 8px;
    right: 10px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
}

#cerrarModalAuth:hover { color: #000; }

.modal-auth-content { text-align: left; }

.modal-auth-content h2 {
    font-size: 16px;
    margin-bottom: 6px;
    color: #222;
}

.modal-auth-texto {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
}

.btn-auth-principal {
    display: inline-block;
    background: #fa0000;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.btn-auth-principal:hover { background: #e30000; }

.modal-auth-login {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.modal-auth-login a { color: #ff0000; text-decoration: none; }

/* ════════════════════════════════
   COMPARADOR
════════════════════════════════ */

.comparador-panel {
    position: fixed;
    top: 0;
    right: -50vw;
    width: 50vw;
    max-width: 50vw;
    height: 100vh;
    background: #ffffff;
    z-index: 5000;
    box-shadow: -10px 0 30px rgba(0,0,0,0.25);
    padding: 28px;
    overflow-y: auto;
    transition: right 0.3s ease;
}

.comparador-panel.active { right: 0; }

.comparador-cerrar {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    font-size: 24px;
    cursor: pointer;
}

.comparador-seleccionado,
.comparador-buscador,
.tabla-comparacion { margin-top: 20px; }

.comparador-buscador input { width: 100%; }

.comparador-card {
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-top: 10px;
    cursor: pointer;
    background: #f9fafb;
}

.comparador-card:hover { background: #f3f4f6; }

.comparador-card img {
    width: 90px;
    height: 65px;
    object-fit: cover;
    border-radius: 8px;
}

.tabla-comparacion table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.tabla-comparacion th,
.tabla-comparacion td {
    border: 1px solid #e5e7eb;
    padding: 8px;
    font-size: 13px;
    text-align: left;
}

.tabla-comparacion th { background: #f3f4f6; }

/* ════════════════════════════════
   PAGINACIÓN
════════════════════════════════ */

.paginacion {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 8px;
}

.paginacion button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 6px;
}

.paginacion button.active {
    background: #d60f0f;
    color: white;
    border-color: #d60f0f;
}

.paginacion button:hover { background: #f3f3f3; }

/* ════════════════════════════════
   FOOTER
════════════════════════════════ */

.footer {
    background: #111;
    color: #ddd;
    text-align: center;
    padding: 40px 20px;
    margin: 20px auto 0;
    font-size: 14px;
    border-radius: 22px;
    width: 90%;
    box-shadow: 0 10px 10px rgba(0,0,0,0.5);
}

.footer p { margin: 8px 0; }
.footer .web { color: #ef4444; font-weight: 600; }

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */

@media (max-width: 1150px) {
    .menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #111;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 24px 0;
        border-left: 1px solid rgba(255,255,255,0.06);
        transition: right 0.3s ease;
        z-index: 9999;
        margin-left: 0;
    }

    .menu.active { right: 0; }

    .menu li {
        width: 100%;
        height: auto;
        text-align: center;
        padding: 0;
    }

    .menu a {
        width: 100%;
        height: auto;
        padding: 14px 28px;
        border-radius: 0;
        font-size: 13px;
    }

    .logout-btn { margin: 8px 28px; }

    .menu li strong { padding: 14px 28px; }

    .menu-toggle {
        display: flex;
        align-items: center;
    }

    .menu-logo {
        display: block;
        margin-bottom: 20px;
        padding: 0 28px;
    }

    .menu-close {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        width: 100%;
        padding: 8px 24px 20px;
        font-size: 18px;
        color: #666;
        cursor: pointer;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        margin-bottom: 8px;
    }

    .menu li:last-child {
        border-left: none;
        padding: 14px 28px;
    }
}

@media (max-width: 900px) {
    .main-layout { flex-direction: column; }

    .modal-top {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .modal-acciones { flex-direction: column; }

    .btn-ver-pro,
    .btn-favorito-modal,
    #btnVerVehiculo { width: 100%; }

    .comparador-panel {
        right: -100vw;
        width: 100vw;
        max-width: 100vw;
    }

    #modalDesc { grid-template-columns: 1fr; }
}

@media (max-width: 850px) {
    .sidebar-filtros {
        width: 100%;
        position: static;
    }

    .sticky-content {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .btn-filtros-movil { display: block; }

    .sidebar-filtros {
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        height: 100%;
        background: #fff;
        z-index: 1000;
        overflow-y: auto;
        transform: translateX(-100%);
    }

    .sidebar-filtros.activo { transform: translateX(0); }

    .btn-cerrar-filtros {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        background-color: white;
        color: #111;
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        font-size: 20px;
        cursor: pointer;
        z-index: 2000;
    }
}

@media (max-width: 600px) {
    .catalogo-grid { grid-template-columns: 1fr; }

    .card-horizontal { flex-direction: column; }

    .card-img,
    .card-info { width: 100%; }

    .card-img img { min-height: 180px; }

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

    .precio-pro,
    #modalPrecio { font-size: 26px; }

    .modal-rec-card { flex: 0 0 180px; }

    .modal-box {
        width: 95%;
        padding: 15px;
    }
}
.footer .footer-contacto {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer .footer-contacto a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
}

.footer .footer-contacto a:hover {
    color: #ef4444;
}

