/* ==========================================================================
   Dealership Boilerplate — Mobile Responsive Overrides
   Developer : Ben de Kooker
   Website   : http://dealership.local
   Email     : info@bdekooker.co.za
   Cell      : +27 76 481 8324

   Comprehensive mobile-first responsive overrides. Loaded AFTER app.css
   and premium.css so it takes precedence. Covers all breakpoints:
   - Large desktop:  > 992px (default styles apply)
   - Tablet:          768px – 991px
   - Mobile:          480px – 767px
   - Small mobile:    < 480px
   ========================================================================== */

/* ========================================================================
   TABLET (max-width: 991.98px)
   ======================================================================== */
@media (max-width: 991.98px) {

    /* ---- Navbar ---- */
    .navbar-premium { padding: .65rem 0; }
    .navbar-premium .navbar-brand { font-size: 1.25rem; }
    .navbar-premium .navbar-brand .brand-icon { width: 38px; height: 38px; font-size: 1.1rem; }
    .navbar-premium .navbar-brand img { height: 42px !important; }

    /* Mobile nav: full-width dropdown panel */
    .navbar-premium .navbar-collapse {
        margin-top: 1rem;
        padding: 1rem;
        background: #fff;
        border-radius: var(--bdk-radius);
        box-shadow: var(--bdk-shadow);
        border: 1px solid var(--bdk-border);
    }
    .navbar-premium .navbar-nav { width: 100%; }
    .navbar-premium .nav-link {
        padding: .75rem 1rem !important;
        border-radius: var(--bdk-radius-sm);
        font-size: 1rem;
    }
    .navbar-premium .nav-link:hover { background: var(--bdk-cream); }
    .navbar-premium .nav-link::after { display: none; }
    .navbar-premium .nav-item.ms-lg-3 { margin-top: .5rem; margin-left: 0 !important; }
    .navbar-premium .nav-item .btn { width: 100%; text-align: center; }

    /* Top contact bar: simplify */
    .top-contact-bar { font-size: .8rem; padding: .4rem 0; }
    .top-contact-bar .me-4 { margin-right: .75rem !important; }

    /* ---- Hero ---- */
    .hero-premium { min-height: auto; padding: 3rem 0; }
    .hero-premium .hero-content { padding: 2rem 0; }
    .hero-premium h1 { font-size: 2.25rem; }
    .hero-premium .hero-lead { font-size: 1.05rem; }
    .hero-premium .hero-cta { flex-direction: column; }
    .hero-premium .hero-cta .btn { width: 100%; }
    .hero-premium .hero-stats { gap: 1.5rem; margin-top: 2rem; }
    .hero-premium .hero-stat .stat-num { font-size: 1.75rem; }
    .hero-scroll-cue { display: none; }

    /* ---- Sections ---- */
    .section { padding: 3rem 0; }
    .section-sm { padding: 2rem 0; }
    .section-lg { padding: 4rem 0; }

    /* ---- Section titles ---- */
    .section-title { font-size: 1.5rem; }
    .section-subtitle { font-size: .95rem; }

    /* ---- Stats section ---- */
    .stats-section { padding: 2.5rem 0; }
    .stats-section .stat-num { font-size: 2rem; }
    .stats-section .stat-label { font-size: .8rem; }

    /* ---- CTA band ---- */
    .cta-band { padding: 2rem; }
    .cta-band h3 { font-size: 1.5rem; }
    .cta-band .row { flex-direction: column; }
    .cta-band .col-lg-4 { text-align: center !important; margin-top: 1rem; }

    /* ---- Page hero ---- */
    .page-hero { padding: 2.5rem 0 2rem; }
    .page-hero h1 { font-size: 1.75rem; }
    .page-hero p { font-size: .95rem; }

    /* ---- Filter sidebar: move above listings ---- */
    .vehicles-listing-wrapper .col-lg-3 { order: 2; margin-top: 1.5rem; }
    .vehicles-listing-wrapper .col-lg-9 { order: 1; }

    /* ---- Vehicle details ---- */
    .detail-gallery-main { aspect-ratio: 4 / 3; }
    .detail-price-card .price-value { font-size: 1.75rem; }
    .sticky-top { position: static !important; }

    /* ---- Footer ---- */
    .footer-premium { padding: 3rem 0 1rem; }
    .footer-premium .footer-brand { font-size: 1.25rem; }
    .footer-premium .footer-brand .brand-icon { width: 38px; height: 38px; font-size: 1.1rem; }
    .footer-premium .footer-brand img { height: 42px !important; }
}

/* ========================================================================
   MOBILE (max-width: 767.98px)
   ======================================================================== */
@media (max-width: 767.98px) {

    /* ---- Container ---- */
    .container { padding-left: 1rem; padding-right: 1rem; }

    /* ---- Top contact bar: show only phone ---- */
    .top-contact-bar .d-flex > span:not(:first-child),
    .top-contact-bar .me-4:not(:first-child) { display: none; }

    /* ---- Navbar ---- */
    .navbar-premium .navbar-brand { font-size: 1.1rem; }
    .navbar-premium .navbar-brand .brand-icon { width: 34px; height: 34px; font-size: 1rem; }
    .navbar-premium .navbar-brand img { height: 38px !important; }

    /* ---- Hero ---- */
    .hero-premium { padding: 2rem 0; }
    .hero-premium .hero-content { padding: 1.5rem 0; }
    .hero-premium h1 { font-size: 1.75rem; line-height: 1.15; }
    .hero-premium h1::after { display: none; }
    .hero-premium .hero-eyebrow { font-size: .7rem; padding: .3rem .75rem; }
    .hero-premium .hero-lead { font-size: .95rem; margin-bottom: 1.5rem; }
    .hero-premium .hero-cta .btn { font-size: .9rem; padding: .75rem 1.5rem; }
    .hero-premium .hero-stats {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 1rem;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
    .hero-premium .hero-stat { flex: 1 1 30%; min-width: 90px; }
    .hero-premium .hero-stat .stat-num { font-size: 1.5rem; }
    .hero-premium .hero-stat .stat-label { font-size: .7rem; }

    /* ---- Sections ---- */
    .section { padding: 2.5rem 0; }
    .section-sm { padding: 1.5rem 0; }

    /* ---- Section headers ---- */
    .section-title { font-size: 1.35rem; }
    .section-subtitle { font-size: .9rem; }
    .section-eyebrow { font-size: .7rem; }

    /* ---- Trust badges: 2 columns ---- */
    .trust-strip { padding: 1.5rem 0; }
    .trust-item { padding: .25rem; }
    .trust-item .trust-icon { width: 44px; height: 44px; font-size: 1.2rem; }
    .trust-item .trust-title { font-size: .9rem; }
    .trust-item .trust-text { font-size: .75rem; }

    /* ---- Stats section: 2 columns ---- */
    .stats-section { padding: 2rem 0; }
    .stats-section .stat-block { padding: 1rem .5rem; }
    .stats-section .stat-block:not(:last-child)::after { display: none; }
    .stats-section .stat-block:nth-child(odd)::after {
        content: '';
        position: absolute;
        right: 0;
        top: 15%;
        bottom: 15%;
        width: 1px;
        background: rgba(255, 255, 255, 0.1);
    }
    .stats-section .stat-num { font-size: 1.75rem; }

    /* ---- Vehicle cards ---- */
    .vehicle-card .card-body { padding: 1.1rem; }
    .vehicle-card .vehicle-title { font-size: 1.05rem; }
    .vehicle-card .vehicle-price { font-size: 1.25rem; }
    .vehicle-card .vehicle-specs { gap: .65rem; font-size: .8rem; }
    .vehicle-card .btn-view { padding: .45rem 1rem; font-size: .8rem; }
    .vehicle-card .vehicle-quick-info { font-size: .72rem; }

    /* ---- Testimonials ---- */
    .testimonial-card { padding: 1.5rem; }
    .testimonial-card .testimonial-text { font-size: .9rem; }
    .testimonial-card .quote-mark { font-size: 3rem; }

    /* ---- Brand strip: scrollable ---- */
    .brand-strip { padding: 2rem 0; }
    .brand-strip .row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .brand-strip .col { flex: 0 0 auto; min-width: 120px; }
    .brand-strip .brand-logo { font-size: 1.1rem; }

    /* ---- CTA band ---- */
    .cta-band { padding: 1.5rem; border-radius: 16px; }
    .cta-band h3 { font-size: 1.25rem; }
    .cta-band p { font-size: .9rem; }
    .cta-band .btn { width: 100%; }

    /* ---- Page hero ---- */
    .page-hero { padding: 2rem 0 1.5rem; }
    .page-hero h1 { font-size: 1.5rem; }
    .page-hero p { font-size: .9rem; }
    .page-hero .breadcrumb { font-size: .8rem; margin-bottom: .5rem; }

    /* ---- Filter card ---- */
    .filter-card .filter-header { padding: 1rem; }
    .filter-card .filter-header h6 { font-size: .95rem; }
    .filter-card .filter-body { padding: 1rem; }

    /* ---- Vehicle details ---- */
    .detail-gallery-main { aspect-ratio: 4 / 3; }
    .detail-gallery-thumbs img { width: 60px; height: 45px; }
    .detail-price-card { padding: 1.25rem; }
    .detail-price-card .price-value { font-size: 1.5rem; }
    .detail-spec-row { padding: .65rem 0; }
    .detail-spec-row .spec-label { font-size: .85rem; }
    .detail-spec-row .spec-value { font-size: .85rem; }

    /* ---- Forms ---- */
    .card-premium .card-body { padding: 1.25rem !important; }
    .form-premium .form-control,
    .form-premium .form-select { font-size: .9rem; padding: .6rem .8rem; }
    .form-premium .form-label { font-size: .8rem; }
    .form-premium .input-group-text { font-size: .85rem; }

    /* ---- Footer ---- */
    .footer-premium { padding: 2.5rem 0 1rem; }
    .footer-premium h5, .footer-premium h6 { font-size: .9rem; margin-bottom: .75rem; }
    .footer-premium .footer-link { font-size: .85rem; padding: .25rem 0; }
    .footer-premium .footer-contact-item { font-size: .85rem; }
    .footer-premium .footer-social { width: 36px; height: 36px; font-size: 1rem; }
    .footer-premium .newsletter-form input { font-size: .8rem; padding: .55rem .75rem; }
    .footer-premium .footer-bottom { font-size: .8rem; padding-top: 1rem; margin-top: 2rem; }

    /* ---- PWA install banner ---- */
    #pwaInstallBanner { left: 8px !important; right: 8px !important; max-width: none; padding: 1rem; }
    #pwaInstallBanner .pwa-banner-icon { width: 40px; height: 40px; font-size: 1.2rem; }

    /* ---- Back to top ---- */
    #backToTop { width: 42px; height: 42px; bottom: 16px; right: 16px; font-size: 1.05rem; }

    /* ---- Auth pages ---- */
    .auth-card-body { padding: 1.5rem 1.25rem; }
    .auth-card h1 { font-size: 1.35rem; }
    .auth-brand { font-size: 1.35rem; }
    .auth-brand .brand-icon { width: 40px; height: 40px; font-size: 1.2rem; }

    /* ---- Alerts ---- */
    .alert { padding: .75rem 1rem; font-size: .9rem; }

    /* ---- Pagination ---- */
    .pagination .page-link { padding: .5rem .75rem; font-size: .9rem; }

    /* ---- Vehicle card quick-info: always visible on touch ---- */
    .vehicle-card .vehicle-quick-info {
        opacity: 1;
        transform: translateY(0);
        background: linear-gradient(180deg, transparent 0%, rgba(13, 59, 102, 0.7) 100%);
        padding: .5rem .85rem;
    }
}

/* ========================================================================
   SMALL MOBILE (max-width: 479.98px)
   ======================================================================== */
@media (max-width: 479.98px) {

    .container { padding-left: .75rem; padding-right: .75rem; }

    /* ---- Hero ---- */
    .hero-premium h1 { font-size: 1.5rem; }
    .hero-premium .hero-lead { font-size: .9rem; }
    .hero-premium .hero-stats { gap: .75rem; }
    .hero-premium .hero-stat { flex: 1 1 45%; }
    .hero-premium .hero-stat .stat-num { font-size: 1.35rem; }
    .hero-premium .hero-stat .stat-label { font-size: .65rem; }

    /* ---- Trust badges: 1 column ---- */
    .trust-strip .col-6 { width: 100%; }

    /* ---- Stats: 1 column ---- */
    .stats-section .col-6 { width: 100%; }
    .stats-section .stat-block { padding: .75rem; }
    .stats-section .stat-block::after { display: none !important; }
    .stats-section .stat-block:not(:last-child) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* ---- Vehicle card ---- */
    .vehicle-card .card-body { padding: 1rem; }
    .vehicle-card .vehicle-title { font-size: 1rem; }
    .vehicle-card .vehicle-make { font-size: .7rem; }
    .vehicle-card .vehicle-price { font-size: 1.15rem; }
    .vehicle-card .vehicle-specs { font-size: .75rem; gap: .5rem; }
    .vehicle-card .vehicle-footer { flex-wrap: wrap; gap: .5rem; }
    .vehicle-card .btn-view { width: 100%; justify-content: center; }

    /* ---- Section titles ---- */
    .section-title { font-size: 1.2rem; }
    .section-eyebrow { font-size: .65rem; }

    /* ---- Footer: stack everything ---- */
    .footer-premium .col-lg-2,
    .footer-premium .col-lg-3,
    .footer-premium .col-md-4 { width: 100%; }

    /* ---- Forms ---- */
    .card-premium .card-body { padding: 1rem !important; }

    /* ---- PWA banner: stack ---- */
    #pwaInstallBanner { flex-direction: column; text-align: center; gap: .5rem; }
    #pwaInstallBanner .pwa-banner-actions { flex-direction: row; width: 100%; }
    #pwaInstallBanner .pwa-banner-actions .btn { flex: 1; }

    /* ---- Auth pages ---- */
    .auth-card-body { padding: 1.25rem 1rem; }
    .auth-card .input-group-text { padding: .5rem .6rem; }
    .auth-card .form-control { padding: .6rem .75rem; font-size: .9rem; }

    /* ---- Vehicle details: tiny thumbnails ---- */
    .detail-gallery-thumbs img { width: 50px; height: 38px; }

    /* ---- Buttons: full width ---- */
    .btn-lg { width: 100%; }

    /* ---- Alerts ---- */
    .alert { font-size: .85rem; }
}

/* ========================================================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================================================== */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .navbar-premium .nav-link { min-height: 44px; display: flex; align-items: center; }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }

    /* Remove hover-only effects */
    .vehicle-card:hover { transform: none; }
    .vehicle-card:hover .vehicle-image-wrap img { transform: none; }
    .card-premium:hover { transform: none; }

    /* Always show vehicle quick-info on touch */
    .vehicle-card .vehicle-quick-info {
        opacity: 1;
        transform: translateY(0);
    }
    .vehicle-card .vehicle-image-wrap::after { opacity: 1; }

    /* Remove parallax on touch */
    .hero-premium .hero-bg { transform: none !important; }

    /* Larger filter inputs */
    .filter-card .form-control,
    .filter-card .form-select { min-height: 40px; font-size: .9rem; }

    /* Larger pagination */
    .pagination .page-link { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
}

/* ========================================================================
   PRINT (bonus)
   ======================================================================== */
@media print {
    .navbar-premium, .footer-premium, .top-contact-bar,
    #backToTop, #pwaInstallBanner, .hero-scroll-cue,
    .filter-card, .cta-band, .brand-strip, .hero-cta { display: none !important; }
    .hero-premium { min-height: auto; color: #000; background: #fff !important; }
    .hero-premium .hero-overlay { display: none; }
    .hero-premium .hero-bg { display: none; }
    .hero-premium h1, .hero-premium .hero-lead { color: #000 !important; }
    .section { padding: 1rem 0; }
    .vehicle-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}