/* ═══════════════════════════════════════════════════════════════
   MARKETPLACE.CSS — Comprehensive Marketplace Styling
   ═══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════
   LAYOUT GRID
   ══════════════════════════════════════════════ */
.main-layout {
    margin: 0 auto;
    display: grid;
    grid-template-columns: 275px 1fr;
    gap: 2rem;
    padding: 2rem;
}

/* ══════════════════════════════════════════════
   SIDEBAR FILTERS — IMPROVED UX
   ══════════════════════════════════════════════ */
.filters {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: sticky;
    top: 83px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg);
    display: flex;
    flex-direction: column;
}

/* Webkit scrollbar styling */
.filters::-webkit-scrollbar {
    width: 6px;
}
.filters::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}
.filters::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
.filters::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.filters h3 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-group {
    margin-bottom: 1.25rem;
}

.filter-group label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.filter-group select,
.filter-group input[type="number"],
.filter-group input[type="range"] {
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    outline: none;
    background: white;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(217,32,39,0.1);
}

/* Price slider styling */
.price-slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.price-slider-container input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.price-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(217,32,39,0.3);
}

.price-slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(217,32,39,0.4);
}

.price-slider-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(217,32,39,0.3);
    border: none;
}

.price-slider-container input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(217,32,39,0.4);
}

.price-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    padding: 0.5rem 0;
}

/* Filter action buttons — always visible */
.filter-actions {
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    margin: 1rem 0 -1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-filter {
    width: 100%;
    padding: 0.7rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.btn-filter:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-filter:active {
    transform: translateY(0);
}

.btn-clear {
    width: 100%;
    padding: 0.55rem;
    background: transparent;
    color: var(--muted);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    display: block;
    text-align: center;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-clear:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* ══════════════════════════════════════════════
   RESULTS HEADER & VIEW TOGGLE
   ══════════════════════════════════════════════ */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.results-header.enhanced {
    flex-wrap: wrap;
    gap: 1rem;
}

.results-count {
    font-size: 1.05rem;
    color: var(--text);
    flex: 1;
}

.results-count strong {
    font-weight: 800;
    color: var(--primary);
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    user-select: none;
}

.view-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.view-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ══════════════════════════════════════════════
   ACTIVE FILTERS CHIPS
   ══════════════════════════════════════════════ */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    min-height: 1px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.filter-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-chip::after {
    content: '✕';
    font-weight: 700;
}

/* ══════════════════════════════════════════════
   CARS GRID — GRID & LIST VIEWS
   ══════════════════════════════════════════════ */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.cars-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* ══════════════════════════════════════════════
   CAR CARD — GRID VIEW
   ══════════════════════════════════════════════ */
.car-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1),
                box-shadow 0.35s cubic-bezier(0.16,1,0.3,1),
                border-color 0.35s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.car-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

/* Car image */
.car-img {
    height: 260px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.car-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease;
}

.car-card:hover .car-img img {
    transform: scale(1.08);
}

.no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

/* Car badges */
.car-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    gap: 0.4rem;
    z-index: 2;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.badge-nuevo {
    background: #10b981;
    color: white;
}

.badge-certificado {
    background: #3b82f6;
    color: white;
}

.badge-oferta {
    background: #ef4444;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

/* Favorite button */
.btn-favorite {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-favorite:hover {
    background: white;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-favorite.active {
    background: #ef4444;
    color: white;
}

/* Car body */
.car-body {
    padding: 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.car-year-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    width: fit-content;
}

.car-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.car-sub {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.7rem;
}

.car-price {
    font-size: 1.6rem !important;
    font-weight: 800;
    color: var(--primary);
    margin: 0.5rem 0;
}

.car-specs {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
    flex: 1;
    align-items: flex-start;
}

.car-spec {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--muted);
}

/* Car footer */
.car-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.agency-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text);
    font-weight: 600;
}

.agency-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.car-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.compare-checkbox {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text);
    user-select: none;
    transition: color 0.2s;
}

.compare-checkbox:hover {
    color: var(--primary);
}

.compare-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.compare-checkbox input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 700;
}

.view-details {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    transition: text-decoration 0.2s;
}

.car-card:hover .view-details {
    text-decoration: underline;
}

/* ══════════════════════════════════════════════
   CAR CARD — LIST VIEW
   ══════════════════════════════════════════════ */
.cars-grid.list-view .car-card {
    display: grid;
    grid-template-columns: 240px 1fr auto;
    height: 160px;
    align-items: stretch;
}

.cars-grid.list-view .car-img {
    height: 160px;
    border-radius: 16px 0 0 16px;
}

.cars-grid.list-view .car-body {
    padding: 1rem;
    justify-content: flex-start;
}

.cars-grid.list-view .car-title {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.cars-grid.list-view .car-specs {
    margin: 0.4rem 0;
    gap: 1rem;
}

.cars-grid.list-view .car-spec {
    font-size: 0.8rem;
}

.cars-grid.list-view .car-footer {
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    border-top: none;
    border-left: 1px solid var(--border);
    padding: 1rem;
    gap: 0.5rem;
}

.cars-grid.list-view .car-actions {
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
}

/* ══════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--muted);
}

.empty-state .icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* ══════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: all 0.15s;
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ══════════════════════════════════════════════
   SKELETON LOADING
   ══════════════════════════════════════════════ */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.car-card.skeleton {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    pointer-events: none;
}

.skeleton-img {
    height: 260px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

.skeleton-body {
    padding: 1.1rem;
}

.skeleton-title {
    height: 1.2rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-subtitle {
    height: 0.9rem;
    width: 60%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
    margin-bottom: 0.7rem;
}

.skeleton-price {
    height: 1.8rem;
    width: 40%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
    margin-bottom: 0.7rem;
}

.skeleton-specs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.skeleton-spec {
    height: 1rem;
    width: 80px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}

.skeleton-footer {
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.skeleton-agency {
    height: 1rem;
    width: 120px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}

.skeleton-action {
    height: 1rem;
    width: 60px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ══════════════════════════════════════════════
   MODAL & CAROUSEL (from main.css)
   ══════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10,10,20,0.7);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.car-modal {
    background: var(--surface);
    width: 90%;
    max-width: 960px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    transform: translateY(24px);
    transition: transform 0.35s ease;
    position: relative;
}

.modal-overlay.active .car-modal {
    transform: translateY(0);
}

.modal-carousel {
    position: relative;
    background: #080a0e;
    height: 100%;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-carousel img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.modal-carousel img.active {
    display: block;
}

.carousel-images {
    width: 100%;
    height: 100%;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.carousel-btn:hover {
    background: var(--primary);
}

.carousel-prev {
    left: 1rem;
}

.carousel-next {
    right: 1rem;
}

.carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 2;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid transparent;
}

.carousel-dot.active {
    background: white;
    transform: scale(1.4);
    border-color: rgba(255,255,255,0.5);
}

.modal-info {
    padding: 2.5rem 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.06);
    color: var(--text);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    padding-right: 2rem;
    line-height: 1.2;
    color: var(--text);
}

.modal-price {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.25rem;
}

.modal-specs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-spec {
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.modal-desc {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 2rem;
    flex: 1;
    white-space: pre-wrap;
}

.modal-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-agency {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
}

.btn-quote {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--accent);
    color: white;
    padding: 1.1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1rem;
    transition: background 0.2s, transform 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
}

.btn-quote:hover {
    background: #b8922f;
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════════
   COMPARE MODAL & BAR
   ══════════════════════════════════════════════ */
.compare-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
    display: none;
}

.compare-bar:hover {
    transform: translateX(-50%) scale(1.05);
}

#compareModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

#compareModal.active {
    display: flex;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.compare-table th,
.compare-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
    font-size: 0.9rem;
}

.compare-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text);
}

.compare-table img {
    max-width: 120px;
    max-height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

/* ══════════════════════════════════════════════
   MOBILE FILTERS TOGGLE
   ══════════════════════════════════════════════ */
.filters-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    margin-bottom: 1rem;
    width: fit-content;
    transition: all 0.2s;
}

.filters-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.filters-toggle-icon {
    font-size: 1.1rem;
}

.filters-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted);
    cursor: pointer;
    float: right;
    line-height: 1;
    transition: color 0.2s;
}

.filters-close:hover {
    color: var(--text);
}

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

/* Tablets (900px - 1024px) */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 240px 1fr;
    }
}

/* Mobile large (< 900px) */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .filters {
        position: static;
        display: none;
        max-height: unset;
        margin-top: 1rem;
    }

    .filters.show {
        display: flex;
    }

    .filters-toggle {
        display: flex;
    }

    .filters-close {
        display: block;
    }

    .cars-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .skeleton-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Tablets & mobile medium (600px - 900px) */
@media (max-width: 768px) {
    .main-layout {
        padding: 1rem;
        gap: 1.5rem;
    }

    .cars-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .cars-grid.list-view {
        grid-template-columns: 1fr;
    }

    .car-img {
        height: 200px;
    }

    .skeleton-img {
        height: 200px;
    }

    .car-badges {
        top: 0.5rem;
        left: 0.5rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .btn-favorite {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .car-card .car-price {
        font-size: 1.4rem !important;
    }

    .car-actions {
        flex-direction: column;
        gap: 0.4rem;
        align-items: flex-end;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .view-toggle {
        width: 100%;
    }

    .view-btn {
        flex: 1;
    }

    .skeleton-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .modal-carousel {
        min-height: 260px;
        height: 260px;
    }

    .modal-info {
        padding: 1.5rem;
    }

    .car-modal {
        grid-template-columns: 1fr;
    }
}

/* Mobile medium (480px - 600px) */
@media (max-width: 600px) {
    .main-layout {
        padding: 1rem 0.75rem;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .results-count {
        font-size: 0.95rem;
    }

    .view-toggle {
        width: 100%;
    }

    .view-btn {
        flex: 1;
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .filters-toggle {
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .filters {
        border-radius: 8px;
        padding: 1.2rem;
    }

    .filter-group {
        margin-bottom: 1rem;
    }

    .filter-group select,
    .filter-group input {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
    }

    .btn-filter, .btn-clear {
        font-size: 0.85rem;
        padding: 0.6rem;
    }

    .active-filters {
        gap: 0.4rem;
        margin-bottom: 1rem;
    }

    .filter-chip {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .cars-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .car-img {
        height: 200px;
    }

    .skeleton-img {
        height: 200px;
    }

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

    .cars-grid.list-view .car-card {
        grid-template-columns: 1fr;
        height: auto;
    }

    .cars-grid.list-view .car-img {
        height: 180px;
        border-radius: 8px 8px 0 0;
    }

    .cars-grid.list-view .car-footer {
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .pagination {
        margin-top: 1.5rem;
        gap: 0.3rem;
    }

    .pagination a,
    .pagination span {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

/* Mobile small (< 480px) */
@media (max-width: 480px) {
    .main-layout {
        padding: 0.75rem;
    }

    .results-count {
        font-size: 0.9rem;
    }

    .view-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .filters {
        padding: 1rem;
        border-radius: 6px;
    }

    .filter-group select,
    .filter-group input {
        padding: 0.45rem 0.6rem;
        font-size: 0.8rem;
    }

    .btn-filter, .btn-clear {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .cars-grid {
        gap: 0.6rem;
    }

    .car-img {
        height: 180px;
    }

    .skeleton-img {
        height: 180px;
    }

    .car-title {
        font-size: 0.95rem;
    }

    .car-price {
        font-size: 1.3rem !important;
    }

    .car-spec {
        font-size: 0.75rem;
    }

    .pagination a,
    .pagination span {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .filter-chip {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .results-header {
        margin-bottom: 0.75rem;
    }

    .active-filters {
        gap: 0.3rem;
        margin-bottom: 0.75rem;
    }
}

/* ══════════════════════════════════════════════════════════
   RENTAL MODE — Tabs + Cards + Modal
══════════════════════════════════════════════════════════ */

/* Mode Tabs Bar */
.mode-tabs-bar {
    background: #fff;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.mode-tabs-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0;
}
.mode-tab {
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.mode-tab:hover { color: var(--primary); }
.mode-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-count {
    background: #f3f4f6;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
}
.mode-tab.active .tab-count {
    background: var(--primary);
    color: white;
}

/* Header active link */
.header-links a.active {
    color: var(--primary);
    font-weight: 700;
}

/* Rental Badges */
.badge-renta {
    background: #7c3aed;
    color: white;
}
.badge-disponible {
    background: #10b981;
    color: white;
}
.badge-ocupado {
    background: #f59e0b;
    color: white;
}

/* Rental Card */
.rental-card {
    border-left: 3px solid #7c3aed;
}
.rental-card.rented-out {
    opacity: 0.75;
}
.rental-card.rented-out .car-img img {
    filter: grayscale(30%);
}

/* Rental Price Display */
.rental-price {
    color: #7c3aed !important;
    font-size: 1.1rem;
}
.rental-price-alt {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: #9ca3af;
    margin-top: 2px;
}

/* Rental Modal */
.rental-modal {
    border-top: 4px solid #7c3aed;
}
.rental-badge-modal {
    display: inline-block;
    background: #7c3aed;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Rates Box */
.rental-rates-box {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}
.rental-rates-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #5b21b6;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.rental-rates-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.rate-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    min-width: 90px;
    flex: 1;
}
.rate-label {
    font-size: 0.72rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.rate-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #5b21b6;
    margin-top: 0.2rem;
}

/* Status badges in modal */
.rental-status-badge {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0.5rem 0;
}
.status-libre {
    background: #d1fae5;
    color: #065f46;
}
.status-ocupado {
    background: #fef3c7;
    color: #92400e;
}

/* Notes */
.rental-notes-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #92400e;
    margin: 0.5rem 0;
}

/* Rental CTA */
.rental-modal-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}
.rental-cta-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}
.btn-rent {
    background: #7c3aed;
    color: white;
    flex: 1;
}
.btn-rent:hover { background: #6d28d9; }
.btn-rent-email {
    background: transparent;
    color: #7c3aed;
    border: 2px solid #7c3aed;
    flex: 0 0 auto;
}
.btn-rent-email:hover { background: #f5f3ff; }

@media (max-width: 600px) {
    .mode-tabs-inner { padding: 0 0.5rem; }
    .mode-tab { padding: 0.75rem 1rem; font-size: 0.85rem; }
    .rental-rates-grid { gap: 0.5rem; }
    .rate-item { min-width: 70px; padding: 0.5rem; }
    .rental-cta-group { flex-direction: column; }
    .btn-rent-email { flex: 1; }
}
