/* --- Global Styles & Fonts --- */
:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --dark: #212529;
    --light: #f8f9fa;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --white: #ffffff;
    --black: #000000;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 60px; /* Space for mobile bottom nav */
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-weight: 700;
    color: var(--dark);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.lead {
    font-size: 1.1rem;
    font-weight: 400;
}

/* --- Utility Classes --- */
.bg-light {
    background-color: var(--light) !important;
}
.bg-dark {
    background-color: var(--dark) !important;
}
.bg-primary {
    background-color: var(--primary) !important;
}
.text-primary {
    color: var(--primary) !important;
}
.text-light {
    color: var(--light) !important;
}
.text-muted {
    color: var(--gray) !important;
}

/* --- Header & Navigation --- */
.trust-badges {
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.navbar {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.navbar-brand {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 0.8rem !important;
}

/* --- Hero Section --- */
.hero-section {
    padding: 60px 0;
    background-color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero-section h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1.2rem;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.hero-image-container:hover .hero-image {
    transform: scale(1.02);
}

/* --- Stats Section --- */
.stats-section {
    border-top: 1px solid var(--light-gray);
    border-bottom: 1px solid var(--light-gray);
}

.stats-section .display-5 {
    font-size: 1.8rem;
}

/* --- Vehicle Inventory --- */
.vehicle-filters {
    border: 1px solid var(--light-gray);
}

/* Mobile vehicle listing style */
#vehicle-list {
    padding: 0;
}

.vehicle-card-mobile {
    display: flex;
    padding: 12px;
    border-bottom: 1px solid var(--light-gray);
    background-color: var(--white);
    transition: all 0.2s ease;
}

.vehicle-card-mobile:hover {
    background-color: #f8f9fa;
}

.vehicle-card-mobile img {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
}

.vehicle-card-mobile .vehicle-details {
    flex: 1;
}

.vehicle-card-mobile h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark);
    line-height: 1.3;
}

.vehicle-card-mobile .vehicle-meta {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 4px;
}

.vehicle-card-mobile .vehicle-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
}

.vehicle-card-mobile .badge-low-mileage {
    background-color: #e9d5ff;
    color: #6b21a8;
}

.vehicle-card-mobile .badge-brand-new {
    background-color: #ccfbf1;
    color: #0d9488;
}

.vehicle-card-mobile .vehicle-location {
    font-size: 0.7rem;
    color: var(--gray);
    margin-bottom: 4px;
}

.vehicle-card-mobile .vehicle-price {
    font-size: 1rem;
    font-weight: 700;
    color: #16a34a;
    margin-top: 4px;
}

.vehicle-card-mobile .vehicle-date {
    font-size: 0.7rem;
    color: var(--gray);
    text-align: right;
}

/* Desktop vehicle card style */
.vehicle-card-desktop {
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--white);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.vehicle-card-desktop:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform: translateY(-5px);
    border-color: var(--primary);
}

.vehicle-card-desktop img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vehicle-card-desktop:hover img {
    transform: scale(1.05);
}

.vehicle-card-desktop .card-body {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.vehicle-card-desktop .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.vehicle-card-desktop .card-price {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.vehicle-features {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-top: 1px solid var(--light-gray);
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--gray);
}

.vehicle-features i {
    color: var(--primary);
    margin-right: 5px;
}

.btn-outline-dark {
    width: 100%;
    font-weight: 600;
    border-radius: 5px;
    border-color: var(--dark);
    color: var(--dark);
    margin-top: auto;
}

.btn-outline-dark:hover {
    background-color: var(--dark);
    color: var(--white);
}

/* Improved Dropdown Filters */
.dropdown-toggle {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    text-align: left;
    background-color: white;
    color: #495057;
    border-radius: 5px;
    font-size: 0.9rem;
}

.dropdown-toggle::after {
    margin-left: auto;
}

.dropdown-menu {
    border: 1px solid rgba(0,0,0,.15);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.dropdown-item {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #f8f9fa;
    color: var(--primary);
}

/* --- Process Section --- */
.process-card {
    background: var(--white);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid var(--light-gray);
    margin: 0 10px;
}

.process-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.process-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.process-card:hover .process-icon {
    transform: scale(1.1);
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--gray);
    opacity: 0.5;
    margin: 0 5px;
}

.carousel-indicators .active {
    background-color: var(--primary);
    opacity: 1;
}

/* --- Financing Section --- */
.financing-calculator {
    border: 1px solid var(--light-gray);
}

.financing-calculator .form-range::-webkit-slider-thumb {
    background: var(--primary);
}

.financing-calculator .form-range::-moz-range-thumb {
    background: var(--primary);
}

.financing-calculator .form-range::-ms-thumb {
    background: var(--primary);
}

.result-box {
    border: 1px solid var(--light-gray);
}

/* --- Inspection Section --- */
.inspection-section {
    background: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)), url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.inspection-image {
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.inspection-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: 80px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* --- Testimonials --- */
.testimonial-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.testimonial-text {
    font-style: italic;
    position: relative;
}

.testimonial-text:before {
    content: '"';
    font-size: 3rem;
    color: var(--primary);
    opacity: 0.2;
    position: absolute;
    top: -20px;
    left: -10px;
}

.testimonial-author img {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

/* --- FAQ Section --- */
.accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--primary);
}

.accordion-body {
    font-size: 0.95rem;
}

/* --- Contact Section --- */
.contact-form {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.business-hours {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* --- Footer --- */
.footer-section {
    background-color: var(--dark);
}

.footer-section a {
    color: var(--light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: var(--primary);
    text-decoration: none;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: var(--primary);
    color: var(--white) !important;
    transform: translateY(-3px);
}

/* Price Badge in Vehicle Cards */
.vehicle-price-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-size: 0.9rem;
}

/* --- Modal/Popup Styling --- */
.modal-body img {
    border-radius: 8px;
}

.modal-body .list-group-item {
    background-color: transparent;
    border-color: #eee;
}

/* Mobile Bottom Navigation */
.fixed-bottom {
    z-index: 1030;
    border-top: 1px solid var(--light-gray);
}

.fixed-bottom a {
    color: var(--gray);
    text-decoration: none;
    display: block;
}

.fixed-bottom a:hover, .fixed-bottom a.active {
    color: var(--primary);
}

.fixed-bottom i {
    display: block;
    margin: 0 auto 4px;
}

/* --- Responsive Adjustments --- */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stats-section .display-5 {
        font-size: 2.2rem;
    }
    
    .hero-section {
        padding: 80px 0;
    }
    
    .hero-section h1 {
        font-size: 2.4rem;
    }
    
    .vehicle-card-desktop .card-title {
        font-size: 1.2rem;
    }
    
    .vehicle-card-desktop .card-price {
        font-size: 1.5rem;
    }
    
    /* Hide mobile elements on desktop */
    .vehicle-card-mobile {
        display: none;
    }
    
    /* Show desktop elements */
    .vehicle-card-desktop {
        display: flex;
    }
}

@media (min-width: 992px) {
    .section-title {
        font-size: 2.2rem;
    }
    
    .hero-section {
        padding: 100px 0;
    }
    
    .hero-section h1 {
        font-size: 2.8rem;
    }
    
    .process-card {
        margin: 0;
    }
    
    .carousel-indicators {
        position: relative;
        margin-top: 20px;
    }
}

@media (min-width: 1200px) {
    .section-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 767px) {
    /* Hide desktop elements on mobile */
    .vehicle-card-desktop {
        display: none;
    }
    
    /* Show mobile elements */
    .vehicle-card-mobile {
        display: flex;
    }
    
    /* Adjust spacing for mobile */
    #vehicles {
        padding-top: 0;
        padding-bottom: 0;
    }
    
    /* Adjust section padding for mobile */
    section {
        padding: 2rem 0;
    }
    
    /* Make sure all content is visible */
    .hero-section, .stats-section, #process, #financing, 
    .inspection-section, #testimonials, .faq-section, 
    #contact, .map-section, .footer-section {
        display: block !important;
    }
}