* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', sans-serif; 
}

body { 
    background: #f0f2f5; 
    padding: 20px; 
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
}
/* Filter Sidebar Styles */
.car-listing-container {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

/* .car-filters {
    flex: 0 0 280px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 20px;
} */
.search-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .search-container,
    .search-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .search-container,
    .search-row {
        grid-template-columns: 1fr !important;
    }

    .results-options {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }

    .results-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }

    #mobileFilterToggle {
        display: block;
        margin-bottom: 15px;
        background-color: #253993;
        color: white;
        padding: 10px 15px;
        font-size: 16px;
        border: none;
        cursor: pointer;
    }

    .search-btn,
    .sort-btn {
        width: 100%;
    }

    .keywords-container input {
        width: 100%;
    }

    .results-options select {
        width: 100% !important;
        min-width: unset;
    }
    .results-options {
        width: 100%;
    }
}

.search-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.search-row .keywords-container {
    /* grid-column: span 2; */
    position: relative;
}

select, input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #444;
    background-color: #fff;
    color: #333;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

input {
    background-image: none;
}

.search-btn {
    background-color: #253993;
    color: white;
    border: none;
    padding: 12px 15px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background-color: #112374;
}

h1 {
    font-size: 32px;
    margin: 30px 0 20px;
    font-weight: normal;
}

p {
    margin-bottom: 20px;
    font-size: 16px;
}

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.results-count {
    font-size: 16px;
}

.results-options {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.results-options select {
    width: auto;
    min-width: 120px;
}

.sort-btn {
    background-color: #253993;
    color: white;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.sort-btn:hover {
    background-color: #10216d;
}

.divider {
    border-top: 1px solid #444;
    margin: 20px 0;
}
/* Car Grid Layout */
.car-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.car-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .car-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .car-listing-container {
        flex-direction: column;
    }
    
    .car-filters {
        position: static;
        margin-bottom: 20px;
    }
    
    .car-list {
        grid-template-columns: 1fr;
    }
}

/* Collapsible Filter Groups */
.filter-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-group.active .filter-options {
    max-height: 500px;
    margin-bottom: 15px;
}

/* No Results Message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.no-results h3 {
    color: #253993;
    margin-bottom: 10px;
}

.no-results p {
    color: #666;
    font-size: 15px;
}
/* Responsive Grid for Cars */
.car-list {
    display: grid;
    /* grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); */
    gap: 20px;
    margin-top: 20px;
}

/* Car Card */
.car-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.car-card:hover { 
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}
@media (max-width: 768px) {
    .car-filters {
        position: static;
        margin-bottom: 20px;
        max-height: none;
        overflow: visible;
        padding: 25px 20px;
        border-radius: 12px;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
        background: linear-gradient(135deg, #ffffff, #f9f9f9);
    }

    .filter-group h3 {
        font-size: 16px;
        padding: 10px 0;
        border-bottom: 1px solid #ddd;
        margin-bottom: 8px;
    }

    .filter-options {
        max-height: 1000px; /* allow full expansion */
        overflow-y: visible;
        transition: none;
        gap: 12px;
    }

    .filter-options label {
        padding: 10px;
        background: #f1f3f5;
        border-radius: 6px;
        font-size: 15px;
        transition: background 0.2s;
    }

    .filter-options label:hover {
        background: #e2e6ea;
    }

    .filter-reset {
        padding: 12px 18px;
        font-size: 15px;
        background: #253993;
        color: white;
        border-radius: 10px;
    }

    .filter-reset:hover {
        background: #1f2e75;
    }
}
.car-filters {
    scroll-snap-type: y mandatory;
}

.filter-group {
    scroll-snap-align: start;
}
#mobileFilterToggle {
    display: none;
    background-color: #253993;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    width: 100%;
    font-size: 16px;
    margin-bottom: 10px;
    cursor: pointer;
  }
  
  @media screen and (max-width: 768px) {
    #mobileFilterToggle {
      display: block;
    }
  
    .car-filters {
      display: none;
    }
  
    .car-filters.show {
      display: block;
    }

  }
  
.card-header {
    position: relative;
    height: 220px;
    overflow: hidden;
}
.card-header img{
    width: 100%;
}
/* Image Slider */
.card-slider {
    position: relative;
    height: 100%;
}

.slider-nav {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.slider-dot.active { 
    background: rgba(255, 255, 255, 0.9); 
}

.card-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.card-slider img.active { 
    opacity: 1; 
}

.card-body {
    padding: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.car-model {
    font-size: 1.4rem;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-weight: 600;
}

.car-details {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.price {
    font-size: 1.3rem;
    color: #FFDD00;
    font-weight: 700;
    /* margin: 15px 0; */
}

.sold-badge {
    position: absolute;
    top: 15px;
    right: -30px;
    background: #e74c3c;
    color: white;
    padding: 8px 30px;
    transform: rotate(45deg);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 90%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.modal-title {
    font-size: 1.8rem;
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Modal Image Slider */
.modal-slider-container {
    flex: 1;
    min-width: 280px;
}

.modal-slider {
    height: 350px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.modal-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal-slider img.active { 
    opacity: 1; 
}

/* Modal Details */
.modal-details {
    flex: 1;
    min-width: 280px;
}

.modal-details .price {
    font-size: 1.5rem;
    margin: 15px 0;
}

.detail-item {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Close Button */
.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 25px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover { 
    color: #e74c3c; 
}

/* Buttons */
.reserve-btn {
    background: #253993;
    color: white;margin: 5px 0px;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.reserve-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.reserve-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
#modalReserveBtn {
    background: #253993;
    color: white;margin: 5px 0px;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

#modalReserveBtn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

#modalReserveBtn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Slider Navigation Buttons */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 12px;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 2;
}

.slider-arrow:hover { 
    background: rgba(0, 0, 0, 0.8); 
}

.prev { left: 10px; }
.next { right: 10px; }

.d-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .modal-content {
        max-width: 95%;
        padding: 15px;
    }

    .modal-body {
        flex-direction: column;
        gap: 10px;
    }

    .modal-slider {
        height: 250px;
    }

    .car-model {
        font-size: 1.2rem;
    }

    .price {
        font-size: 1.2rem;
    }

    .reserve-btn {
        font-size: 0.9rem;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .car-list {
        grid-template-columns: 1fr;
    }

    .car-card {
        width: 100%;
    }

    .modal-title {
        font-size: 1.5rem;
    }
}
#modalDesc{padding: 20px;font-weight: 500;}#carModal {
    overflow: scroll;
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none; min-width: 100%;
}
/* Add to autotrader.css */
.clp-car-slider img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f5f5f5;
    transition: opacity 0.3s ease;
}

.clp-car-slider img[src*="placeholder"] {
    object-fit: contain;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
}

.clp-car-slider .slick-slide {
    position: relative;
}

.clp-car-slider .slick-slide::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.05);
}
/* Add to your CSS */
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-slider-container {
    position: relative;
    /* height: 400px; */
    width: 100%;
}

.modal-slider img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    object-fit: contain;
    /* height: 400px; */
    /* object-fit: cover; */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-slider img.active {
    opacity: 1;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
}

.slider-arrow.prev {
    left: 10px;
}

.slider-arrow.next {
    right: 10px;
}

.slider-nav {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 5px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 0;
}

.slider-dot.active {
    background: #253993;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.d-flex {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}
.modal-slider-container .slider-nav{display: none;}
#modalDesc {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.reserve-btn, #callNow {
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.reserve-btn {
    background: #253993;
    color: white;
}

#callNow {
    background: #253993;
    color: white;
}
/* Hide scrollbar for Webkit-based browsers (Chrome, Safari) */
#carModal::-webkit-scrollbar {
    display: none;
}
/* Loader Styles */
.loader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.9);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}

.spinner {
width: 50px;
height: 50px;
border: 5px solid #f3f3f3;
border-top: 5px solid #253993;
border-radius: 50%;
animation: spin 1s linear infinite;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
} 