/* ========== LISTING SECTION ========== */

.listing-section {
    padding: 5rem 2rem;
    scroll-margin-top: calc(var(--nav-height) - 20px);
}

.listing-container {
    max-width: 1400px;
    margin: 0 auto;
}

.cars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* Active class for filter buttons */
.btn-active {
    background-color: var(--gold);
    color: #000000;
}

.no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.no-results i {
    font-size: 1rem;
    color: var(--gold);
}

.no-results p {
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.btn-clear-hint {
    margin-top: 8px;
    padding: 12px 28px;
    background: var(--gold);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-clear-hint:hover {
    background: var(--gold-hover);
}

.view-available-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.view-available-btn i {
    color: var(--gold);
}

.view-available-btn:hover i {
    color: #000;
}


/* ========== CAR CARD ========== */
.car-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.car-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    cursor: pointer;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background-color: var(--primary-bg);
    transition: transform 0.4s ease;
}

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

.car-card.sold-card {
    opacity: 0.7;
}

.car-card.car-card.sold-card .card-image img {
    filter: grayscale(100%);
}

.car-card.sold-card:hover .card-image img {
    filter: grayscale(100%);
    transform: none;
}

.card-share-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: rgba(255, 255, 255, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.card-share-btn:hover {
    color: rgb(255, 255, 255);
    transform: scale(1.1);
}

.card-share-btn:active {
    transform: scale(0.95);
}

.car-card:hover .card-share-btn {
    display: flex;
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-specs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.specs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.specs-row span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.specs-row span i {
    font-size: 0.78rem;
    flex-shrink: 0;
}

.card-price {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.card-price strong {
    /* highlight class is added to price, so color is not given */
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
}

.negotiable-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.card-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.btn-whatsapp-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: transparent;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

.btn-whatsapp-card i {
    font-size: 1.2rem;
    color: #25d366;
}

.btn-whatsapp-card:hover {
    background-color: #25d366;
    border-color: #25d366;
    transform: translateY(-2px);
}

.btn-whatsapp-card:hover i {
    color: #ffffff;
}

.btn-whatsapp-card:active {
    transform: scale(0.95);
}

.btn-details {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    color: #000000;
    background: linear-gradient(135deg,
            #c9a227 0%,
            #f5d060 50%,
            #c9a227 100%);
}

.btn-details:hover {
    transform: translateY(-2px);
}

.btn-details:active {
    transform: scale(0.95);
}

.btn-details .fa-arrow-right {
    transition: transform 0.3s ease;
}

.btn-details:hover .fa-arrow-right {
    transform: translateX(4px);
}

/* Media Queries */
@media (max-width: 1200px) {
    .cars-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cars-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 1.6rem;
    }

    .section-description {
        font-size: 0.9rem;
    }

    .card-share-btn {
        display: flex;
    }
}

@media (max-width: 550px) {
    .listing-section {
        padding: 3rem 1rem;
    }

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

    .car-card {
        display: flex;
        flex-direction: column;
    }

    .card-image {
        width: 100%;
        aspect-ratio: 4/3;
    }
}

@media (max-width: 360px) {

    .no-results i,
    .no-results p {
        font-size: 0.8rem;
    }

    .btn-clear-hint {
        padding: 10px 22px;
        font-size: 12px;
    }
}

/* ========== MODAL ========== */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

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

.modal-container {
    position: relative;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 1rem;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.modal-close:hover {
    background-color: var(--gold);
    color: #000000;
    transform: scale(1.1);
}

.modal-swiper {
    width: 100%;
    height: 350px;
    flex-shrink: 0;
    background-color: #000000;
    /* space for dots at bottom */
    padding-bottom: 30px;
    box-sizing: border-box;
}

.modal-swiper .swiper-slide {
    width: 100%;
    height: 100%;
}

.modal-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

/* ARROWS */
.modal-swiper .swiper-button-prev,
.modal-swiper .swiper-button-next {
    color: var(--gold);
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-swiper .swiper-button-prev:hover,
.modal-swiper .swiper-button-next:hover {
    background-color: var(--gold);
    color: #000000;
}

/* Swiper generates its arrow icons using the ::after pseudo element. To resize them you target ::after and change font-size. */
.modal-swiper .swiper-button-prev::after,
.modal-swiper .swiper-button-next::after {
    font-size: 0.8rem;
    font-weight: 900;
}

/* DOTS */
.modal-swiper .swiper-pagination {
    position: absolute;
    bottom: 10px;
}

.modal-swiper .swiper-pagination-bullet {
    background-color: var(--text-secondary);
    opacity: 1;
}

.modal-swiper .swiper-pagination-bullet-active {
    background-color: var(--gold);
}

.modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Custom Scrollbar for Modal */
.modal-body::-webkit-scrollbar {
    width: 5px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background-color: var(--gold);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background-color: var(--gold-hover);
}

.modal-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-car-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.8px;
}

.modal-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
}

.modal-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.spec-label,
.spec-value {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.spec-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--secondary-bg);
}

.spec-label i {
    color: var(--text-secondary);
    width: 16px;
    text-align: center;
}

.spec-value {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--card-bg);
}

.modal-specs span:nth-last-child(-n+2) {
    border-bottom: none;
}

.modal-price-block {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.modal-price {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    /* added hightlight class to  modal-price, so no color needed */
}

.modal-negotiable {
    font-size: 0.75rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-style: italic;
    color: var(--text-secondary);
}

.modal-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-family: 'Inter', sans-serif;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.5rem;
}

.modal-call-btn,
.modal-whatsapp-btn {
    text-decoration: none;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.modal-call-btn {
    background-color: var(--gold);
    color: #000000;
    border: 2px solid var(--gold);
}

.modal-call-btn i {
    color: green;
}

.modal-call-btn:hover {
    background-color: var(--gold-hover);
    border-color: var(--gold-hover);
    transform: translateY(-2px);
}

.modal-whatsapp-btn {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--gold);
}

.modal-whatsapp-btn i {
    color: #25d366;
    font-size: 1.2rem;
}

.modal-whatsapp-btn:hover i {
    color: green;
}

.modal-whatsapp-btn:hover {
    background-color: var(--gold);
    color: #000000;
    transform: translateY(-2px);
}

.modal-call-btn:active,
.modal-whatsapp-btn:active {
    transform: scale(0.95);
}

/* Media Queries */
@media (max-width: 550px) {
    .modal-swiper {
        height: 240px;
    }

    .modal-swiper .swiper-button-prev,
    .modal-swiper .swiper-button-next {
        display: none;
    }

    .modal-car-name {
        font-size: 1.1rem;
    }

    .modal-price {
        font-size: 1.3rem;
    }
}

@media (max-width: 410px) {

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

    .modal-call-btn,
    .modal-whatsapp-btn {
        width: 70%;
    }

    .spec-label,
    .spec-value {
        font-size: 0.75rem;
    }

    .spec-label i {
        width: 15px;
    }
}

/* ========== LIGHTBOX ========== */

.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    z-index: 3001;
}

.lightbox-close:hover {
    background-color: var(--gold);
    color: #000000;
}