/* ========================================
   MOBILE RESPONSIVENESS - MEDIA QUERIES
   ======================================== */

/* ========================================
   UNIVERSAL MOBILE FIXES - APPLY TO ALL BREAKPOINTS
   ======================================== */

/* Prevent horizontal scroll on mobile */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

/* Remove blue tap highlight on all touch devices */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

a,
button,
input,
textarea,
select {
    -webkit-tap-highlight-color: transparent;
}

/* Ensure all containers respect viewport */
.container,
.hero,
.search-results-container,
.publish-container,
.settings-container,
.my-rides-container,
.auth-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent text overflow */
p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Standardize all dropdowns and extracts for touch */
select,
.unified-input,
.floating-input,
#suggestions,
#bike-suggestions {
    min-height: 48px !important;
    font-size: 16px !important;
}

.floating-label {
    font-size: 14px;
}

/* Ensure autocomplete dropdowns don't overflow */
#suggestions,
#bike-suggestions,
#time-suggestions,
.pac-container,
.suggestion-item {
    max-width: 100vw !important;
    box-sizing: border-box;
}

/* Table overflow handling */
table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

/* Long URLs or emails */
a,
.email,
.url {
    word-break: break-all;
}

/* Fix for sticky elements on mobile - moved to media query below */

/* ========================================
   END UNIVERSAL FIXES
   ======================================== */

/* Hamburger Menu Button (Hidden on Desktop) */
/* Hamburger Menu Button (Hidden on Desktop) */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 24px;
    min-width: 32px;
    /* Prevent flexing/squashing */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10002;
    position: relative;
    flex-shrink: 0;
    /* Double check shrink prevention */
}

.hamburger-btn span {
    display: block !important;
    width: 32px !important;
    /* Fixed width instead of 100% */
    height: 3px !important;
    transition: all 0.3s ease;
    background-color: var(--text-primary) !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Ensure Search Icon is visible in Light Mode */
.mobile-action-btn svg {
    fill: currentColor;
    color: var(--text-primary);
}

/* Logic for Tab Content Toggling on Mobile */
.rides-section-wrapper {
    display: block;
    /* Default for Desktop */
}

@media (max-width: 1024px) {

    /* Hide wrappers by default on mobile, show only active */
    .rides-section-wrapper {
        display: none;
    }

    .rides-section-wrapper.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    /* Fix horizontal tabs vertical movement & styling strictly for mobile */
    .tabs-container {
        display: flex !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        /* Prevent vertical jiggle */
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 5px 20px !important;
        margin-bottom: 0px !important;
        /* Gap Gone */
        border-bottom: 1px solid var(--border-color) !important;
        touch-action: pan-x !important;
        /* Force horizontal pan only */
        background: var(--bg-secondary) !important;
        min-height: 50px !important;
        /* Fixed height to prevent collapse */
    }

    .tabs-container::-webkit-scrollbar {
        display: none !important;
    }

    .tab-btn {
        flex: 0 0 auto !important;
        padding: 10px 16px !important;
        font-size: 15px !important;
        white-space: nowrap !important;
    }

    .tab-btn.active::after {
        bottom: -2px !important;
        /* Better alignment on mobile */
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(5px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu Overlay - Transformed to Popup Container */
.mobile-menu-overlay {
    position: fixed;
    top: 80px;
    /* Below navbar */
    right: 10px;
    width: 300px;
    height: auto;
    max-height: 80vh;
    background: var(--bg-secondary);
    z-index: 10002;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    overflow-y: auto;

    /* Animation State: Hidden */
    display: none;
    /* Bulletproof hiding */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    /* KEY FIX: Prevent blocking clicks when hidden */
}

/* Ensure menu is visible when active */
.mobile-menu-overlay.active {
    display: block !important;
    /* Bulletproof showing */
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    /* Enable clicks when visible */
}

.mobile-menu-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    font-size: 36px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 10001;
}

.mobile-menu-close:hover {
    background: var(--hover-bg);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-links a {
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    transition: background 0.2s;
}

.mobile-nav-links a:hover {
    background: var(--hover-bg);
}

.mobile-auth-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.mobile-auth-btn {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
    color: var(--text-primary);
    background: var(--hover-bg);
}

.mobile-auth-btn.primary {
    background: var(--accent-teal);
    color: white;
}

.mobile-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-user-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-user-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.mobile-user-info span {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-user-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}

.mobile-user-links a {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
    background: rgba(15, 118, 110, 0.03);
}

.mobile-user-links a:hover {
    background: rgba(15, 118, 110, 0.08);
    color: var(--accent-teal);
    padding-left: 25px;
}

.mobile-logout-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    background: #fee;
    color: #c00;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-logout-btn:hover {
    background: #fdd;
}

/* ========================================
   TABLET & MOBILE BREAKPOINTS
   ======================================== */

/* Mobile Nav Actions Container */
.mobile-nav-actions {
    display: none;
}

.mobile-action-btn {
    display: none;
}

@media (max-width: 1024px) {

    /* Mobile Header Layout - Consistent across all pages */
    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 10px;
        /* Reduced side padding to push items further out */
        gap: 10px;
        width: 100vw;
        left: 0;
    }

    /* Logo stays on left */
    .logo {
        order: 1;
        flex-shrink: 0;
    }

    /* Hide the loose mobile action buttons */
    .mobile-nav-actions {
        display: none !important;
    }

    .mobile-action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px 10px;
        background: var(--accent-teal);
        color: white !important;
        border: 1px solid rgba(255, 255, 255, 0.2);
        /* Add border for visibility in light mode */
        border-radius: 8px;
        font-size: 11px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
        white-space: nowrap;
    }

    .mobile-action-btn:hover {
        background: #0d6b63;
        transform: translateY(-1px);
    }

    .mobile-action-btn.publish-btn {
        background: var(--accent-lime);
        color: #064E44 !important;
    }

    .mobile-action-btn.publish-btn:hover {
        background: var(--accent-lime-dark);
    }

    .navbar {
        padding: 0 20px;
        position: sticky;
        top: 0;
        z-index: 999;
    }

    /* Hamburger button on right - ALWAYS VISIBLE */
    .hamburger-btn {
        display: flex !important;
        order: 3;
        flex-shrink: 0;
        /* Extreme right shift */
        margin-right: -5px;
        width: auto !important;
        height: auto !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0;
        justify-content: center;
        align-items: center;
    }

    /* Activate and style the centered capsule for mobile */
    .nav-center-group {
        display: flex !important;
        order: 2;
        flex: 1;
        justify-content: center;
        position: relative !important;
        /* Override absolute desktop positioning */
        left: auto !important;
        top: auto !important;
        transform: none !important;
        margin: 0 auto;
        pointer-events: none;
        /* Prevent blocking clicks on hamburger/logo */
    }

    .nav-capsule {
        pointer-events: auto;
        /* Enable clicks on the capsule itself */
        padding: 3px !important;
        /* Slimmer for mobile height */
        background: rgba(15, 118, 110, 0.05) !important;
        border: 1px solid rgba(15, 118, 110, 0.2) !important;
        gap: 4px !important;
        scale: 0.9;
        /* Slightly smaller overall */
    }

    .dark-theme .nav-capsule {
        background: rgba(255, 255, 255, 0.05) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .nav-capsule a {
        padding: 6px 12px !important;
        font-size: 13px !important;
        border-radius: 20px !important;
        color: #64748B !important;
    }

    .dark-theme .nav-capsule a {
        color: #94A3B8 !important;
    }

    .nav-capsule a.active {
        background: var(--accent-teal) !important;
        color: white !important;
    }

    .nav-auth-container {
        display: none;
    }

    /* Mobile Text-Style Tabs for My Rides */
    .mobile-my-rides-tabs {
        display: flex;
        gap: 20px;
        margin-bottom: 0px;
        /* Gap Gone - User request */
        background: transparent;
        padding: 0;
        border-radius: 0;
    }

    .mobile-tab-btn {
        flex: 0 0 auto;
        padding: 8px 0;
        border: none;
        background: transparent;
        border-radius: 0;
        font-weight: 600;
        font-size: 18px;
        /* Look like Header */
        color: #94A3B8;
        cursor: pointer;
        transition: all 0.2s;
        border-bottom: 2px solid transparent;
        box-shadow: none !important;
    }

    .mobile-tab-btn.active {
        background: transparent;
        color: #0F172A;
        /* Dark Text */
        box-shadow: none;
        border-bottom: 2px solid #0F766E;
        /* Teal Underline */
    }

    /* Hide the redundant H2 headers inside tabs on mobile */
    .rides-section-wrapper .section-header {
        display: none !important;
    }

    /* Forced High Contrast for Search Icon */
    .mobile-action-btn svg {
        fill: #0F172A !important;
        /* Dark Slate to appear on white/light/dark */
        color: #0F172A !important;
    }


}

@media (max-width: 768px) {

    /* ===== HERO SECTION ===== */
    .hero {
        padding: 40px 20px;
        min-height: auto;
    }

    .hero h1 {
        font-size: 28px !important;
        margin-bottom: 24px;
    }

    /* ===== SEARCH BAR - VERTICAL STACK ===== */
    .search-bar {
        flex-direction: column;
        gap: 8px;
        padding: 16px;
        max-width: 100%;
    }

    .search-input-wrapper,
    .date-field,
    .time-field {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .search-input-wrapper input,
    .search-input-wrapper select,
    #rideDate,
    #publish-date,
    #publish-time {
        height: 44px !important;
        font-size: 15px !important;
        padding: 10px 14px !important;
    }

    /* Search Button */
    .search-bar button {
        width: 100%;
        height: 52px;
        font-size: 18px;
        border-radius: 12px;
        /* Unified border-radius for consistency */
    }

    /* FIX: Prevent location detect buttons from becoming full-width on mobile search */
    .search-bar .location-detect-btn {
        width: 40px !important;
        height: 40px !important;
        position: absolute !important;
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        background: transparent !important;
    }

    /* FIX: Date and Parcel segments same height as input fields */
    .date-segment-trigger {
        height: 44px !important;
        padding: 10px 14px !important;
        box-sizing: border-box;
    }

    .parcel-filter-segment {
        height: 44px !important;
        padding: 10px 14px !important;
        box-sizing: border-box;
        display: flex;
        align-items: center;
    }

    .parcel-segment-content {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Parcel Checkbox - Mobile Optimized */
    .parcel-filter-minimal {
        margin: 12px 0 !important;
        justify-content: flex-start;
        padding: 12px 16px !important;
        background: rgba(15, 118, 110, 0.05);
        border-radius: 12px;
        /* Unified border-radius to match search button */
        -webkit-tap-highlight-color: transparent !important;
    }

    .parcel-filter-minimal input[type="checkbox"] {
        width: 20px !important;
        height: 20px !important;
        margin: 0 !important;
        -webkit-tap-highlight-color: transparent !important;
        outline: none !important;
    }

    .parcel-filter-minimal span {
        font-size: 14px !important;
        user-select: none;
    }

    /* Offer Badges - HIDDEN on Mobile */
    .offer-badge {
        display: none !important;
    }

    /* ===== SEARCH RESULTS ===== */
    .search-results-container {
        padding: 0 16px;
    }

    .search-result-card {
        padding: 16px !important;
        margin-bottom: 20px !important;
        border-radius: 16px !important;
    }

    .card-main-content {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    .card-header-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .card-rider-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
        padding-top: 16px !important;
        border-top: 1px solid var(--border-color) !important;
    }

    .route-timeline {
        border-right: none !important;
        padding-right: 0 !important;
        width: 100% !important;
    }

    .timeline-visual {
        flex-direction: row !important;
        height: auto !important;
        width: auto !important;
        gap: 8px !important;
        justify-content: flex-start !important;
    }

    .timeline-line {
        width: 40px !important;
        height: 2px !important;
        background: var(--border-color) !important;
    }

    .card-price {
        grid-area: price !important;
        justify-self: flex-start !important;
        font-size: 28px !important;
        font-weight: 700 !important;
        color: var(--accent-teal) !important;
        margin-top: 8px !important;
    }

    .action-book-btn {
        grid-area: button !important;
        justify-self: stretch !important;
        width: 100% !important;
        padding: 14px !important;
        font-size: 18px !important;
        border-radius: 12px !important;
    }

    /* My Rides - Detailed Card Mobile Fix */
    .my-rides-container {
        padding-top: 15px !important;
        /* Reduced from 74px to fix whitespace */
    }

    .ride-card-detailed {
        padding: 16px !important;
        margin-bottom: 8px !important;
        /* Halved from 16px */
    }

    /* Remove grid margin on mobile to close the gap */
    .rides-grid {
        margin-top: 0px !important;
        gap: 12px !important;
        /* Halved from 24px */
    }

    /* DARK MODE EMPTY STATES - MOBILE ONLY */
    .no-rides {
        background: #0F172A !important;
        /* Dark Navy/Slate */
        color: #94A3B8 !important;
        border: 1px solid #1E293B !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    }

    .no-rides h2,
    .no-rides h3 {
        color: white !important;
    }

    .no-rides p {
        color: #94A3B8 !important;
    }

    .ride-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .ride-price-badge {
        font-size: 16px !important;
        padding: 6px 12px !important;
    }

    .ride-details {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px !important;
        padding-top: 12px !important;
        /* Slightly reduced padding */
    }

    .detail-item {
        font-size: 13px !important;
        /* Slightly smaller for mobile line fit */
    }

    /* Request Cards Mobile Fix */
    .request-card {
        padding: 16px !important;
    }

    /* FIX: Ensure "Leaving From" doesn't overlap with GPS icon on mobile */
    .form-group-full .floating-group .floating-input {
        padding-right: 36px !important;
        /* Adjusted for tighter icon */
        text-overflow: ellipsis;
    }

    /* Move GPS icon further right as requested (almost touching edge) */
    .form-group-full .location-detect-btn {
        right: 1px !important;
        padding: 4px !important;
        width: 32px !important;
        height: 32px !important;
    }

    .form-group-full .location-detect-btn svg {
        width: 16px !important;
        height: 16px !important;
        opacity: 0.8;
    }

    /* Fix Arrow Alignment - It was too low */
    .form-group-full .location-arrow {
        padding-top: 0 !important;
        margin-top: -3px !important;
        /* Pull it up slightly to true center */
        font-size: 18px !important;
    }

    .request-card {
        padding: 16px !important;
        gap: 16px !important;
    }

    .pillion-profile {
        flex-direction: column !important;
        text-align: center !important;
        gap: 10px !important;
    }

    .request-actions {
        flex-direction: column !important;
    }

    /* Force stacking for Profile Settings specifically to override main stylesheet row-layout */
    .page-profile-settings .settings-container {
        flex-direction: column !important;
        margin-top: 0 !important;
        /* Remove huge top margin from style.css */
        padding-top: 5px !important;
        /* Minimized to connect with navbar */
        gap: 0 !important;
    }

    .settings-container {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .settings-sidebar,
    .settings-content {
        width: 100% !important;
        margin: 0 !important;
        display: block !important;
    }

    .settings-sidebar {
        padding: 15px 20px !important;
        /* Slightly tighter sidebar */
        border-radius: 16px 16px 0 0 !important;
        /* Top rounded only to connect with content */
        border-bottom: none !important;
    }

    .settings-sidebar h2 {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }

    .settings-tabs {
        display: flex !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding: 4px 0 !important;
        gap: 8px !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch;
    }

    .settings-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .tab-item {
        flex: 0 0 auto !important;
        padding: 8px 14px !important;
        font-size: 13px !important;
        margin-bottom: 0 !important;
    }

    .settings-content {
        padding: 20px !important;
        border-radius: 0 0 16px 16px !important;
        /* Bottom rounded ONLY */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
        margin-top: -1px !important;
        /* Overlap border to look connected */
        display: block !important;
        /* Force visibility */
        min-height: auto !important;
    }

    /* Ensure form fields are visible on dark theme mobile */
    .dark-theme .settings-content {
        background: #111827 !important;
        /* Clear dark gray instead of pure black */
        border-color: #374151 !important;
    }

    .profile-header-edit {
        flex-direction: column !important;
        text-align: center !important;
        gap: 16px !important;
    }

    .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .form-group {
        width: 100% !important;
        margin-bottom: 20px !important;
    }

    .form-group label {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }

    .unified-input,
    .bio-display-box,
    textarea#prof-bio {
        font-size: 15px !important;
        padding: 14px !important;
    }

    /* ===== REDESIGNED MODAL RESPONSIVENESS ===== */
    .modal-content {
        max-width: 90%;
        border-radius: 20px;
    }

    .modal-content-inner {
        padding: 20px;
    }

    .modal-details-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .modal-header {
        align-items: flex-start;
        gap: 15px;
    }

    .modal-price {
        font-size: 20px;
        text-align: left;
    }

    /* ===== FEATURES SECTION ===== */
    .features {
        grid-template-columns: 1fr;
        padding: 40px 20px;
        gap: 16px;
    }

    .feature-card {
        padding: 24px;
    }

    /* ===== WHY CHOOSE SECTION ===== */
    .why-choose-section {
        padding: 60px 20px;
    }

    .why-choose-section h2 {
        font-size: 32px;
    }

    .why-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* ===== FOOTER REDESIGN ===== */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 32px 20px;
        text-align: left;
    }

    .footer-brand {
        grid-column: span 2;
        text-align: center;
        margin-bottom: 24px;
        padding-bottom: 24px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .footer-brand .footer-tagline {
        margin: 0 auto;
        max-width: 100%;
    }

    .footer-column {
        text-align: left;
    }

    .footer-column h3 {
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 16px;
        color: var(--accent-lime);
    }

    .footer-links a {
        font-size: 14px;
        padding: 4px 0;
    }

    .footer-bottom {
        margin-top: 40px;
    }

    /* ===== PRICE CONTROL ===== */
    .price-control {
        width: 100%;
    }

    .price-control input {
        font-size: 20px !important;
        font-weight: 700 !important;
    }

    .price-btn {
        width: 42px;
        /* Optimize space on small screens */
        font-size: 22px;
    }

    /* ===== PARCEL TOGGLES ===== */
    .parcel-toggle-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    /* Production-level Picker Optimizations for Mobile */
    @media (max-width: 768px) {

        .custom-calendar-popup,
        .custom-frequency-popup,
        .custom-time-popup,
        .filter-dropdown-popup {
            width: 90% !important;
            max-width: 350px !important;
            position: fixed !important;
            top: 50% !important;
            left: 50% !important;
            transform: translate(-50%, -50%) scale(0.95) !important;
            margin: 0 !important;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1) !important;
            z-index: 10001 !important;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
            max-height: 80vh !important;
            overflow-y: auto !important;
            opacity: 0;
            visibility: hidden;
        }

        .custom-calendar-popup.show,
        .custom-frequency-popup.show,
        .custom-time-popup.show,
        .filter-dropdown-popup.show {
            transform: translate(-50%, -50%) scale(1) !important;
            opacity: 1 !important;
            visibility: visible !important;
        }
    }

    /* Backdrop for pickers on mobile */
    @media (max-width: 768px) {
        .mobile-picker-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(15, 23, 42, 0.5);
            backdrop-filter: blur(4px);
            z-index: 10000;
            display: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .mobile-picker-backdrop.show {
            display: block;
            opacity: 1;
        }
    }

    /* Touch targets and standard elements */
    button,
    .btn,
    .auth-btn,
    .btn-save,
    .submit-ride-btn,
    input[type="submit"] {
        padding: 12px 16px !important;
    }

    /* Stack price and button vertically on very small screens */
    .card-right {
        flex-direction: column !important;
        gap: 12px;
        align-items: stretch !important;
    }
}

/* FIX: Desktop Calendar Width Override */
@media (min-width: 769px) {

    /* Exclude profile calendar from fixed width if it causes issues, or ensure it fits */
    .custom-calendar-popup:not(#calendar-prof-dob) {
        width: 340px !important;
        max-width: 340px !important;
    }
}

/* FIX: Ensure content sits below the updated fixed navbar */
/* This is now handled more specifically in media queries for mobile */
@media (min-width: 1025px) {
    .settings-container:not(.page-profile-settings .settings-container) {
        padding-top: 85px;
    }
}

/* FIX: Profile Calendar - use same 340px width as search/publish but ensure days fit */
@media (min-width: 769px) {
    #calendar-prof-dob {
        width: 340px !important;
        max-width: 340px !important;
        padding: 20px !important;
    }

    #calendar-prof-dob .calendar-day {
        width: 36px !important;
        height: 36px !important;
        line-height: 36px !important;
        font-size: 14px !important;
    }

    #calendar-prof-dob .calendar-grid {
        column-gap: 6px !important;
        row-gap: 8px !important;
    }
}

/* Enhanced Responsiveness for Publish Page Sections */
@media (max-width: 768px) {

    /* Value Props */
    .value-props {
        padding: 50px 15px;
    }

    .value-props h2 {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .props-grid {
        gap: 16px;
    }

    .prop-item {
        min-width: 100%;
        max-width: 100%;
        padding: 25px 20px;
    }

    .icon-box {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    /* Stats Banner */
    .stats-banner {
        padding: 40px 15px;
        gap: 30px;
    }

    .stat h3 {
        font-size: 26px;
    }

    .stat p {
        font-size: 12px;
    }

    /* Testimonials */
    .testimonial-section {
        padding: 40px 15px;
    }

    .testimonial-content {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }

    .testimonial-content::before {
        display: none;
    }

    .testimonial-content blockquote {
        font-size: 16px;
    }

    /* How It Works */
    .how-it-works {
        padding: 40px 15px;
    }

    .how-it-works h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .steps-container {
        flex-direction: column;
        gap: 30px;
    }

    .how-it-works-visual {
        order: -1;
        margin-bottom: 20px;
        padding: 0;
    }

    .visual-img {
        max-width: 260px;
    }

    .visual-blob {
        width: 220px;
        height: 220px;
    }

    .steps-list::before {
        left: 32px;
        top: 30px;
        bottom: 30px;
    }

    .step {
        padding: 12px;
        align-items: center;
        gap: 16px;
    }

    .step:hover {
        transform: none;
        background: rgba(15, 118, 110, 0.05);
    }

    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* FAQ Improved Responsiveness */
    .help-centre-faq {
        padding: 40px 16px;
        margin: 20px 10px;
        border-radius: 24px;
    }

    .help-centre-faq h2 {
        font-size: 26px;
        margin-bottom: 30px;
    }

    .faq-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .faq-item {
        padding: 24px;
        border-radius: 20px;
    }

    .faq-item h3 {
        font-size: 16px;
    }

    .faq-icon {
        font-size: 20px;
    }

    .faq-answer p {
        font-size: 14px;
    }

    .faq-extra p {
        padding: 12px;
        font-size: 13px;
    }
}


@media (max-width: 768px) {
    .mobile-only-block {
        display: block !important;
    }

    /* FIX: Ensure popular rides are 2x2 on mobile */
    .routes-list {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }

    .route-card {
        flex: 1 1 calc(50% - 12px);
        min-width: 140px;
        padding: 16px;
        font-size: 14px;
    }

    .route-card .arrow {
        font-size: 20px;
    }

    /* Mobile Dropdown Fixes */
    .user-dropdown {
        width: 200px !important;
        right: 10px !important;
        top: 72px !important;
        border-radius: 12px !important;
    }

    .notification-dropdown {
        width: 280px !important;
        right: 10px !important;
        top: 72px !important;
        border-radius: 12px !important;
        max-height: 70vh !important;
        overflow-y: auto !important;
    }
}