/* ============================================
   MOBILE RESPONSIVE STYLES
   ValueYourCar - Mobile-First Responsive Design
   ============================================
   
   This file contains all mobile-specific styles.
   All styles are wrapped in media queries to ensure
   desktop design remains unaffected.
   
   Breakpoints:
   - max-width: 992px  (tablets)
   - max-width: 768px  (small tablets/large phones)
   - max-width: 576px  (phones)
   - max-width: 480px  (small phones)
============================================ */

/* ============================================
   1. HAMBURGER MENU SYSTEM
============================================ */

/* Hamburger menu toggle button - hidden on desktop */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1100;
    position: relative;
}

.hamburger-menu span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-color-light, #fff);
    border-radius: 2px;
    transition: all 0.3s ease;
    position: relative;
}

.hamburger-menu span:before,
.hamburger-menu span:after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background-color: var(--text-color-light, #fff);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu span:before {
    top: -7px;
}

.hamburger-menu span:after {
    top: 7px;
}

/* Hamburger animation when menu is open */
.hamburger-menu.active span {
    background: transparent;
}

.hamburger-menu.active span:before {
    transform: rotate(45deg);
    top: 0;
}

.hamburger-menu.active span:after {
    transform: rotate(-45deg);
    top: 0;
}

/* Mobile navigation menu */
.mobile-nav-menu {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: #67b656;
    z-index: 1050;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: grid;
    place-items: center;
    box-sizing: border-box;
}

.mobile-nav-menu.open {
    max-height: 520px;
    padding: 12px 0 18px;
}

.mobile-nav-menu .mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    list-style: none;
    margin: 0;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
}

.mobile-nav-menu .mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    color: var(--text-color-light, #fff);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    transition: background 0.2s ease;
    text-align: center;
}

.mobile-nav-menu .mobile-nav-link:hover,
.mobile-nav-menu .mobile-nav-link:focus {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.mobile-nav-menu .mobile-nav-link .nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Mobile menu divider */
.mobile-nav-divider {
    width: 90%;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 6px auto 10px;
}

/* ============================================
   2. TABLET BREAKPOINT (max-width: 992px)
============================================ */
@media (max-width: 992px) {
    /* Prevent horizontal overflow on tablets */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Charts and grids - 2 columns on tablets */
    .charts-layout {
        grid-template-columns: 1fr !important;
    }
    
    .vyc-cards-row {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    
    .vyc-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
    
    /* Premium analysis hero card */
    .hero-card {
        grid-template-columns: 1fr !important;
    }
    
    .hero-stats {
        border-left: none !important;
        border-top: 1px solid rgba(255,255,255,0.1) !important;
    }
}

/* ============================================
   3. MOBILE BREAKPOINT (max-width: 768px)
============================================ */
@media (max-width: 768px) {
    /* Show hamburger, hide desktop nav */
    .hamburger-menu {
        display: flex;
        flex-shrink: 0;
        margin-right: 0;
    }
    
    .mobile-nav-menu {
        display: block;
    }
    
    .top-bar-right {
        display: none !important;
    }
    
    /* Top bar layout fixes for mobile */
    .top-bar {
        padding: 0 !important;
        overflow: visible !important;
    }
    
    .top-bar-inner {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 16px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }
    
    .top-bar-left {
        flex: 0 0 auto !important;
    }
    
    .top-bar-center {
        position: relative !important;
        left: auto !important;
        transform: none !important;
        max-width: none !important;
        flex: 1 1 auto !important;
        justify-content: center !important;
        pointer-events: auto !important;
        height: auto !important;
    }
    
    /* Ensure logo section is properly sized */
    .logo-section {
        max-width: none !important;
    }
    
    /* Content padding adjustment */
    .content {
        padding-top: 64px;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* ============================================
       3.1 SCROLLY CTA SECTION - MOBILE CRITICAL
    ============================================ */
    .vyc-scrolly-section {
        padding: 40px 0 !important;
    }
    
    .vyc-scrolly-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px !important;
        padding-bottom: 20px !important;
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* CRITICAL: Make scrolly visual visible and properly sized on mobile */
    .vyc-scrolly-visual {
        position: relative !important;
        top: auto !important;
        height: 260px !important;
        min-height: 260px !important;
        width: 100% !important;
        margin-bottom: 24px !important;
        order: -1 !important; /* Place chart BEFORE text on mobile */
        border-radius: 16px !important;
        padding: 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
    
    .vyc-scrolly-visual canvas {
        width: 100% !important;
        height: 100% !important;
    }
    
    .vyc-scrolly-text {
        padding-top: 0 !important;
        order: 1 !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 16px !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 6px !important;
        position: relative !important;
        width: 100% !important;
        box-sizing: border-box !important;
        align-items: center !important;
    }
    
    /* Scrolly steps - more compact on mobile */
    .vyc-scrolly-step {
        min-height: auto !important;
        padding: 16px !important;
        margin-bottom: 0 !important;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 12px;
        border: 1px solid rgba(0, 0, 0, 0.05);
        flex: 0 0 82vw !important;
        max-width: 500px !important;
        scroll-snap-align: center !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        gap: 8px !important;
    }

    /* Scrolly navigation buttons for mobile */
    .scrolly-nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        background: rgba(0,0,0,0.18);
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 6px 14px rgba(0,0,0,0.12);
        z-index: 5;
        backdrop-filter: blur(6px);
    }

    .scrolly-nav-btn.left { left: 4px; }
    .scrolly-nav-btn.right { right: 4px; }

    .scrolly-nav-btn:active { transform: translateY(-50%) scale(0.97); }
    
    .vyc-scrolly-step h3 {
        font-size: 1.2rem !important;
        margin-bottom: 8px !important;
    }
    
    .vyc-scrolly-step p {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }
    
    .vyc-scrolly-step.active {
        transform: none !important;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    
    /* ============================================
       3.2 HERO SECTION - MOBILE
    ============================================ */
    .vyc-hero {
        padding: 60px 0 40px !important;
    }
    
    .vyc-hero-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
    
    .vyc-hero-content {
        text-align: center !important;
    }
    
    .vyc-hero-content h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    .vyc-hero-content p {
        font-size: 1rem !important;
        max-width: 100% !important;
    }
    
    /* Center pill group on mobile */
    .vyc-pill-group {
        justify-content: center !important;
    }
    
    /* Ensure container is full width on mobile */
    .vyc-container {
        width: 100% !important;
        padding: 0 16px !important;
        box-sizing: border-box !important;
    }
    
    .vyc-visual-abstract {
        height: 280px !important;
        border-radius: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Hero chart canvas */
    .vyc-visual-abstract canvas {
        width: 100% !important;
        height: 100% !important;
    }
    
    /* ============================================
       3.3 COMPARISON/VS SECTION - MOBILE
    ============================================ */
    .vyc-compare-container {
        padding: 24px !important;
        border-radius: 20px !important;
    }
    
    .vyc-vs-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .vyc-vs-badge {
        transform: rotate(90deg) !important;
        margin: 8px auto !important;
    }
    
    .vyc-car-card {
        padding: 20px !important;
        border-radius: 12px !important;
    }
    
    .vyc-car-card h4 {
        font-size: 1.1rem !important;
    }
    
    .vyc-car-price {
        font-size: 1.8rem !important;
    }
    
    /* ============================================
       3.4 STATS SECTION - MOBILE
    ============================================ */
    .vyc-stats {
        padding: 40px 0 !important;
    }
    
    .vyc-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .vyc-stat-item {
        padding: 24px 20px !important;
    }
    
    .vyc-stat-item h3 {
        font-size: 2rem !important;
    }
    
    /* ============================================
       3.5 CHARTS AND PLOTS - MOBILE
    ============================================ */
    .charts-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }
    
    .chart-panel {
        padding: 16px !important;
        border-radius: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    /* Panel header center alignment */
    .panel-header {
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin-bottom: 1rem !important;
    }
    
    .panel-header > div {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .panel-header h3 {
        text-align: center !important;
        width: 100% !important;
    }
    
    .panel-header p {
        text-align: center !important;
        width: 100% !important;
    }
    
    .chart-area {
        /* Clamp height to favor mobile viewport while maximizing plot area */
        height: clamp(300px, 60vh, 420px) !important;
        min-height: 300px !important;
        width: 100% !important;
        max-width: 100% !important;
        position: relative !important;
        padding: 8px 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure canvas fills container and bars are visible */
    .chart-area canvas {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        display: block !important;
    }
    
    /* Filter pills center alignment and wrap properly */
    .filter-pills {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin-top: 0.75rem !important;
    }
    
    .filter-pill {
        font-size: 0.7rem !important;
        padding: 5px 10px !important;
        white-space: nowrap !important;
    }
    
    .filter-pill svg {
        width: 11px !important;
        height: 11px !important;
    }
    
    /* ============================================
       3.6 INSIGHT CARDS/CTA BOXES - MOBILE
    ============================================ */
    .insight-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .insight-box {
        padding: 16px !important;
        border-radius: 12px !important;
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
    }
    
    .insight-box h4 {
        text-align: center !important;
        margin-bottom: 0.75rem !important;
    }
    
    .insight-content {
        text-align: left !important;
        font-size: 0.9rem !important;
    }
    
    /* Negotiation teaser box */
    .negotiation-teaser-box {
        margin: 20px auto !important;
        border-radius: 16px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .teaser-content {
        padding: 0 16px 20px !important;
    }
    
    .teaser-headline {
        font-size: 1.4rem !important;
    }
    
    .teaser-cta {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Combined content grid - stack on mobile */
    .combined-content {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .combined-content > * {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Surface cards */
    .surface-card {
        padding: 16px !important;
        border-radius: 20px !important;
    }
    
    /* ============================================
       3.7 PREMIUM ANALYSIS PAGE - MOBILE
    ============================================ */
    .premium-layout {
        padding: 16px 16px 32px !important;
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    .premium-layout > * {
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .premium-header h1 {
        font-size: 1.8rem !important;
    }
    
    .hero-card {
        border-radius: 16px !important;
    }
    
    .hero-main {
        padding: 20px !important;
    }
    
    .hero-stats {
        padding: 20px !important;
    }
    
    .car-identity h2 {
        font-size: 1.6rem !important;
    }
    
    .price-tag .amount {
        font-size: 2.5rem !important;
    }
    
    /* Component ratings - stack on mobile */
    .component-ratings {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    /* Deal gauge smaller on mobile */
    .deal-gauge {
        width: 64px !important;
        height: 64px !important;
    }
    
    .deal-score {
        font-size: 1.4rem !important;
    }
    
    /* ============================================
       3.8 FREE ANALYSIS PAGE - MOBILE
    ============================================ */
    .analysis-shell {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 16px 16px 32px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    .page-header {
        padding: 0 4px !important;
        margin-bottom: 1.5rem !important;
    }
    
    .page-header h1 {
        font-size: 1.8rem !important;
    }
    
    .hero-grid {
        grid-template-columns: 1fr !important;
        padding: 0 !important;
    }
    
    .surface-card {
        margin: 0 auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Mobile pricing gauge containment */
    .value-gauge {
        width: 100% !important;
        padding: 0 12px !important;
        box-sizing: border-box !important;
    }
    
    .price-meter {
        width: calc(100% - 24px) !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
    
    .meter-indicator {
        width: 20px !important;
        height: 20px !important;
    }
    
    .price-meter-labels {
        padding: 0 !important;
        font-size: 0.72rem !important;
    }
    
    .gauge-legend {
        gap: 0.5rem !important;
        padding: 0 12px !important;
        font-size: 0.8rem !important;
    }
    
    .fair-visual {
        padding: 1rem !important;
        gap: 1rem !important;
        min-height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }
    
    .ask-orb {
        width: 180px !important;
        height: 180px !important;
    }
    
    .ask-orb strong {
        font-size: 1.6rem !important;
    }
    
    .fair-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .fair-stat {
        padding: 12px !important;
    }
    
    .fair-stat strong {
        font-size: 1.2rem !important;
    }
    
    /* ============================================
       3.9 BUYER/SELLER TOGGLE - MOBILE
    ============================================ */
    .vyc-toggle-switch {
        flex-direction: row !important;
        width: 100% !important;
        max-width: 320px !important;
    }
    
    .vyc-toggle-option {
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
        flex: 1 !important;
        text-align: center !important;
    }
    
    .vyc-mock-card {
        padding: 20px !important;
        border-radius: 12px !important;
    }
    
    .vyc-mock-price-main {
        font-size: 2rem !important;
    }
    
    /* ============================================
       3.10 FOOTER - MOBILE
    ============================================ */
    .site-footer {
        padding: 32px 0 16px !important;
        margin-top: 40px !important;
    }
    
    .footer-container {
        padding: 0 16px !important;
    }
    
    .footer-row {
        flex-direction: column !important;
        gap: 24px !important;
    }
    
    .footer-col {
        min-width: 100% !important;
        text-align: center !important;
        margin-bottom: 0 !important;
    }
    
    .footer-col h5 {
        font-size: 1rem !important;
        margin-bottom: 12px !important;
    }
    
    .footer-links {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    .footer-links li {
        margin-bottom: 0 !important;
    }
    
    .footer-bottom {
        padding-top: 16px !important;
        margin-top: 16px !important;
    }
    
    /* ============================================
       3.11 FORMS - MOBILE
    ============================================ */
    .form-container {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 16px 16px 32px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    .form-container > * {
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .form-section {
        padding: 20px !important;
        border-radius: 16px !important;
    }
    
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* ============================================
       3.12 BUTTONS & CTAS - MOBILE
    ============================================ */
    .vyc-cta-group {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
        align-items: center !important;
    }
    
    .vyc-btn {
        width: 100% !important;
        max-width: 340px !important;
        text-align: center !important;
        padding: 14px 20px !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
    }
    
    .primary-cta {
        width: 100% !important;
        padding: 14px 20px !important;
    }
    
    /* ============================================
       3.13 MODALS & DROPDOWNS - MOBILE
    ============================================ */
    .profile-dropdown {
        position: fixed !important;
        left: 16px !important;
        right: 16px !important;
        top: auto !important;
        bottom: 20px !important;
        max-width: none !important;
        width: auto !important;
        border-radius: 20px !important;
        padding: 20px !important;
    }
    
    .profile-dropdown-actions {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .profile-dropdown .btn {
        width: 100% !important;
    }
    
    .login-modal-content {
        width: 95% !important;
        max-width: none !important;
        margin: 16px !important;
        border-radius: 20px !important;
    }
    
    /* ============================================
       3.14 TOAST NOTIFICATIONS - MOBILE
    ============================================ */
    .toast-container {
        left: 12px !important;
        right: 12px !important;
        top: 64px !important;
    }
    
    .toast {
        min-width: auto !important;
        max-width: none !important;
    }
    
    /* ============================================
       3.15 SIDEBAR - MOBILE
    ============================================ */
    .saved-cars-sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .sidebar-toggle {
        bottom: 20px !important;
        right: 20px !important;
        left: auto !important;
    }
    
    /* Floating actions */
    .floating-actions {
        bottom: 16px !important;
        left: 16px !important;
        right: auto !important;
    }
    
    .fab {
        width: 48px !important;
        height: 48px !important;
    }
    
    /* ============================================
       3.16 PERSPECTIVE TOGGLE - MOBILE
    ============================================ */
    .perspective-toggle {
        margin-top: 1rem !important;
        padding: 3px !important;
        width: 100% !important;
        max-width: 280px !important;
    }
    
    .perspective-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
        flex: 1 !important;
    }
    
    /* ============================================
       3.17 ABOUT PAGE - MOBILE
    ============================================ */
    .about-container {
        width: 95% !important;
        padding: 24px 20px !important;
        margin: 24px auto !important;
    }
    
    .about-hero {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }
    
    .about-hero .hero-text h1 {
        font-size: 1.6rem !important;
    }
}

/* ============================================
   4. SMALL PHONE BREAKPOINT (max-width: 576px)
============================================ */
@media (max-width: 576px) {
    /* Even smaller text sizes */
    .vyc-hero-content h1 {
        font-size: 1.75rem !important;
    }
    
    .vyc-scrolly-visual {
        height: 240px !important;
        min-height: 240px !important;
        padding: 12px !important;
    }
    
    .chart-area {
        height: 220px !important;
        min-height: 220px !important;
    }
    
    /* Stats grid - single column */
    .fair-stats {
        grid-template-columns: 1fr !important;
    }
    
    /* Price tags smaller */
    .price-tag .amount {
        font-size: 2rem !important;
    }
    
    .vyc-car-price {
        font-size: 1.5rem !important;
    }
    
    .vyc-mock-price-main {
        font-size: 1.75rem !important;
    }
    
    /* Container padding */
    .vyc-container {
        width: 95% !important;
        padding: 0 8px !important;
    }
    
    /* Pill group wrap */
    .vyc-pill-group {
        justify-content: center !important;
    }
    
    .vyc-pill {
        font-size: 0.8rem !important;
        padding: 5px 12px !important;
    }
}

/* ============================================
   5. VERY SMALL PHONE BREAKPOINT (max-width: 480px)
============================================ */
@media (max-width: 480px) {
    /* Top bar adjustments */
    .top-bar-inner {
        padding: 0 8px !important;
    }
    
    .logo-text {
        display: none !important;
    }
    
    .logo-icon {
        width: 32px !important;
        height: 32px !important;
    }
    
    /* Mobile nav - tighter spacing */
    .mobile-nav-menu .mobile-nav-link {
        padding: 12px 16px !important;
        font-size: 0.95rem !important;
    }
    
    /* Scrolly adjustments */
    .vyc-scrolly-visual {
        height: 200px !important;
        min-height: 200px !important;
    }
    
    .vyc-scrolly-step {
        padding: 12px !important;
    }
    
    .vyc-scrolly-step h3 {
        font-size: 1.1rem !important;
    }
    
    .vyc-scrolly-step p {
        font-size: 0.9rem !important;
    }
    
    /* Charts - ensure bars are visible on small screens */
    .chart-area {
        height: clamp(260px, 65vh, 340px) !important;
        min-height: 260px !important;
        padding: 4px 0 !important;
    }
    
    .chart-panel {
        padding: 12px !important;
    }
    
    .panel-header h3 {
        font-size: 1.1rem !important;
    }
    
    .panel-header p {
        font-size: 0.8rem !important;
    }
    
    .filter-pill {
        font-size: 0.65rem !important;
        padding: 4px 8px !important;
    }
    
    /* Similar vehicle cards on small screens */
    .similar-vehicle-card {
        flex: 0 0 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
        padding: 14px !important;
    }
    
    /* Footer tighter */
    .footer-col p {
        font-size: 0.85rem !important;
    }
    
    /* Form inputs */
    .form-group input,
    .form-group select {
        padding: 10px !important;
        font-size: 16px !important; /* Prevent iOS zoom on input focus */
    }
}

/* ============================================
   6. LANDSCAPE ORIENTATION FIXES
============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .vyc-scrolly-visual {
        height: 200px !important;
        min-height: 200px !important;
    }
    
    .mobile-nav-menu {
        max-height: 250px !important;
        overflow-y: auto !important;
    }
    
    .mobile-nav-menu .mobile-nav-link {
        padding: 10px 16px !important;
    }
}

/* ============================================
   7. TOUCH-SPECIFIC OPTIMIZATIONS
============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-link,
    .mobile-nav-link,
    .btn,
    .vyc-btn,
    .primary-cta {
        min-height: 44px;
    }
    
    /* Remove hover effects that don't work on touch */
    .vyc-car-card:hover {
        transform: none !important;
    }
    
    .vyc-feature-card:hover {
        transform: none !important;
    }
    
    .vyc-stat-item:hover {
        transform: none !important;
    }
    
    /* Active states instead */
    .vyc-car-card:active,
    .vyc-feature-card:active,
    .vyc-btn:active {
        transform: scale(0.98) !important;
    }
}

/* ============================================
   8. PRINT STYLES (mobile-friendly printing)
============================================ */
@media print {
    .hamburger-menu,
    .mobile-nav-menu,
    .sidebar-toggle,
    .floating-actions,
    .toast-container {
        display: none !important;
    }
    
    .vyc-scrolly-visual {
        position: relative !important;
        break-inside: avoid;
    }
}

/* ============================================
   9. HIGH CONTRAST / ACCESSIBILITY
============================================ */
@media (prefers-contrast: high) {
    .mobile-nav-menu {
        border-bottom: 2px solid #fff;
    }
    
    .mobile-nav-link {
        border: 1px solid rgba(255, 255, 255, 0.3);
        margin: 4px 0;
    }
}

/* ============================================
   10. REDUCED MOTION
============================================ */
@media (prefers-reduced-motion: reduce) {
    .hamburger-menu span,
    .hamburger-menu span:before,
    .hamburger-menu span:after,
    .mobile-nav-menu,
    .vyc-scrolly-step,
    .vyc-car-card,
    .vyc-feature-card {
        transition: none !important;
    }
    
    .negotiation-teaser-box {
        animation: none !important;
    }
    
    .negotiation-teaser-box::before {
        animation: none !important;
    }
}

/* ============================================
   11. PAGE-SPECIFIC MOBILE STYLES
============================================ */

/* 11.1 Similar Vehicles Section (Paid Analysis) */
@media (max-width: 768px) {
    .similar-vehicles-section {
        margin: 20px auto !important;
        padding: 0 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .similar-vehicles-section h2 {
        font-size: 1.4rem !important;
        text-align: center !important;
        margin-bottom: 0.5rem !important;
    }
    
    .similar-vehicles-section > p {
        text-align: center !important;
        font-size: 0.9rem !important;
        margin-bottom: 1rem !important;
        color: #64748b !important;
    }
    
    .similar-vehicles-grid {
        display: flex !important;
        overflow-x: auto !important;
        gap: 14px !important;
        padding: 12px 4px !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
    }
    
    /* Similar vehicle cards - optimized for touch */
    .similar-vehicle-card {
        flex: 0 0 280px !important;
        min-width: 280px !important;
        max-width: 280px !important;
        padding: 18px !important;
        background: white !important;
        border-radius: 16px !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1) !important;
        border: 2px solid #f1f5f9 !important;
        scroll-snap-align: center !important;
        transition: all 0.3s ease !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1) !important;
    }
    
    /* Touch feedback for cards */
    .similar-vehicle-card:active {
        transform: scale(0.98) !important;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15) !important;
        border-color: #3b82f6 !important;
    }
    
    .similar-vehicle-card h3 {
        font-size: 1.05rem !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
        min-height: 42px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .similar-vehicle-stats {
        display: grid !important;
        gap: 8px !important;
    }
    
    .similar-vehicle-stat {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 6px 0 !important;
        font-size: 0.9rem !important;
        min-height: 32px !important;
    }
    
    .similar-vehicle-stat .label {
        font-weight: 500 !important;
        color: #64748b !important;
    }
    
    .similar-vehicle-stat .value {
        font-weight: 600 !important;
        color: #0f172a !important;
        text-align: right !important;
    }
    
    .similar-vehicle-stat .value.price {
        font-size: 1.15rem !important;
        color: #10b981 !important;
        font-weight: 700 !important;
    }
    
    /* Similarity badge */
    .similarity-badge {
        display: inline-block !important;
        background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
        color: white !important;
        padding: 6px 12px !important;
        border-radius: 12px !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        margin-top: 10px !important;
        text-align: center !important;
    }
    
    /* Scrollbar styling for similar vehicles */
    .similar-vehicles-grid::-webkit-scrollbar {
        height: 6px !important;
    }
    
    .similar-vehicles-grid::-webkit-scrollbar-track {
        background: #f1f5f9 !important;
        border-radius: 3px !important;
    }
    
    .similar-vehicles-grid::-webkit-scrollbar-thumb {
        background: #cbd5e1 !important;
        border-radius: 3px !important;
    }
    
    .similar-vehicles-grid::-webkit-scrollbar-thumb:hover {
        background: #94a3b8 !important;
    }
    
    /* Chart info popover - full width on mobile */
    .chart-info-popover {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 70vh !important;
        border-radius: 20px 20px 0 0 !important;
        transform: translateY(100%) !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3) !important;
    }
    
    .chart-info-popover.active {
        transform: translateY(0) !important;
    }
    
    /* Chart info button - larger touch target on mobile */
    .chart-info-btn {
        width: 36px !important;
        height: 36px !important;
        top: 12px !important;
        right: 12px !important;
        font-size: 0.95rem !important;
        touch-action: manipulation !important;
    }
    
    /* Popover header */
    .popover-header {
        padding: 16px !important;
        position: sticky !important;
        top: 0 !important;
        background: white !important;
        z-index: 10 !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }
    
    .popover-header h4 {
        font-size: 1.1rem !important;
    }
    
    .popover-body {
        padding: 16px !important;
        max-height: calc(70vh - 70px) !important;
        overflow-y: auto !important;
    }
    
    .info-section {
        margin-bottom: 16px !important;
    }
    
    .info-section-title {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
    }
    
    .info-section p {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }
    
    /* Negotiation banner on mobile */
    .negotiation-banner {
        flex-direction: column !important;
        text-align: center !important;
        padding: 16px !important;
        gap: 12px !important;
        margin: 16px 0 !important;
    }
    
    .negotiation-icon {
        margin: 0 auto !important;
    }
    
    .negotiation-text {
        width: 100% !important;
    }
    
    .negotiation-text p {
        font-size: 0.95rem !important;
        margin: 0 !important;
    }
    
    /* Chart layout stacking */
    .chart-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .chart-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .chart-card {
        padding: 16px !important;
    }
    
    /* Value highlight section */
    .value-highlight {
        padding: 16px !important;
        border-radius: 16px !important;
    }
    
    .value-highlight .value {
        font-size: 2rem !important;
    }
    
    /* Ask orb sizing */
    .ask-orb {
        width: 160px !important;
        height: 160px !important;
    }
    
    .ask-orb strong {
        font-size: 1.5rem !important;
    }
    
    /* Fair visual section */
    .fair-visual {
        min-height: 280px !important;
        padding: 16px !important;
        border-radius: 20px !important;
    }
    
    /* Stat grid responsive */
    .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .stat-chip {
        padding: 12px !important;
    }
    
    /* Position pill */
    .position-pill-label {
        padding: 12px 20px !important;
        min-width: 200px !important;
        font-size: 0.9rem !important;
    }
    
    /* Info section in popover */
    .info-section p {
        font-size: 0.85rem !important;
    }
    
    /* Legend items */
    .info-legend {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .legend-item {
        font-size: 0.75rem !important;
    }
}

/* 11.2 Input Form Page */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.8rem !important;
    }
    
    .page-header p {
        font-size: 1rem !important;
    }
    
    .autocomplete-items {
        max-height: 200px !important;
    }
    
    .autocomplete-items div {
        padding: 12px !important;
    }
    
    .mileage-ticks .tick {
        font-size: 0.65rem !important;
    }
}

/* 11.3 Modal improvements for mobile */
@media (max-width: 768px) {
    .modal {
        padding: 16px !important;
        align-items: center !important;
        justify-content: center !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
    }
    
    .modal-content {
        width: calc(100% - 32px) !important;
        max-width: 520px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    .modal-two-column {
        max-width: 520px !important;
        width: calc(100% - 32px) !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }
    
    .modal-header {
        padding: 1rem 1.25rem !important;
        box-sizing: border-box !important;
    }
    
    .modal-body {
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    
    .modal-body-split {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .modal-divider {
        display: none !important;
    }
    
    .modal-info-column,
    .modal-form-column {
        padding: 1rem 1.25rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    .modal-info-content {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .modal-info-content h3 {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .feature-list {
        width: 100% !important;
        padding-right: 0 !important;
        margin-bottom: 1rem !important;
    }
    
    .feature-list li {
        font-size: 0.9rem !important;
    }
    
    .btn-pricing {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .modal-description {
        font-size: 0.9rem !important;
        margin-bottom: 1rem !important;
    }
    
    .form-group {
        margin-bottom: 1rem !important;
    }
    
    .form-group input {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .modal-actions {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .modal-actions .btn {
        width: 100% !important;
    }
    
    .modal-overlay {
        padding: 16px !important;
    }
    
    .modal-card {
        width: 100% !important;
        max-width: none !important;
        padding: 20px !important;
        border-radius: 20px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
    
    .modal-header h3 {
        font-size: 1.25rem !important;
    }
    
    .rating-list {
        gap: 12px !important;
    }
    
    .rating-item {
        padding: 12px !important;
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .rating-score {
        align-self: center !important;
    }
}

/* 11.4 Prices Page */
@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .pricing-card {
        padding: 24px !important;
    }
}

/* 11.5 Contact Page */
@media (max-width: 768px) {
    .contact-container {
        width: 95% !important;
        padding: 20px !important;
    }
    
    .contact-form {
        padding: 20px !important;
    }
}

/* ============================================
   12. iOS-SPECIFIC FIXES
============================================ */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS elastic scrolling on body */
    body.menu-open {
        position: fixed;
        width: 100%;
    }
    
    /* Fix for iOS input zoom */
    @media (max-width: 768px) {
        input[type="text"],
        input[type="email"],
        input[type="number"],
        input[type="tel"],
        input[type="password"],
        select,
        textarea {
            font-size: 16px !important;
        }
    }
    
    /* Fix for iOS safe area (notch) */
    .top-bar {
        padding-top: env(safe-area-inset-top);
    }
    
    .mobile-nav-menu {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .site-footer {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* ============================================
   13. DARK MODE COMPATIBILITY (if added later)
============================================ */
@media (prefers-color-scheme: dark) {
    /* Placeholder for future dark mode mobile styles */
}

