/* =========================================
   Mobile & Touch Enhancements
   Optimized for mobile devices - Compact Layout
   Version: 3.1.0
   ========================================= */


/* ===== CRITICAL MOBILE FIXES - MUST LOAD FIRST ===== */
@media (max-width: 768px) {
    html {
        overflow-x: hidden !important;
        height: 100% !important;
        height: -webkit-fill-available !important;
        width: 100% !important;
    }

    body {
        margin: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
        padding-top: 0 !important;
        overflow-x: hidden !important;
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Prevent horizontal overflow on all elements */
    img, video, iframe, table {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* ===== TOUCH-FRIENDLY SIZES ===== */
@media (max-width: 768px) {
    /* Ensure all interactive elements are at least 44x44px */
    a, button, .btn, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Larger tap targets for navigation */
    .nav-link {
        min-height: 56px;
        padding: 16px 20px;
    }

    /* Better spacing for form elements */
    .form-input-enhanced,
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 48px;
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 14px 16px;
    }

    /* Card spacing */
    .card-elevated,
    .dashboard-card,
    .profile-card {
        margin-bottom: var(--spacing-lg);
        padding: var(--spacing-lg);
    }

    /* Stats grid optimization */
    .quick-stats,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Tab navigation */
    .tabs-enhanced {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs-enhanced::-webkit-scrollbar {
        display: none;
    }

    .tab-enhanced {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ===== EXTRA SMALL SCREENS ===== */
@media (max-width: 480px) {
    .quick-stats,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2rem !important;
    }

    .section-title {
        font-size: 1.75rem !important;
    }

    .stat-value {
        font-size: 28px !important;
    }
}

/* ===== PULL-TO-REFRESH PREVENTION ===== */
body {
    overscroll-behavior-y: contain;
}

/* ===== SMOOTH SCROLLING ===== */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ===== SAFE AREA INSETS (iOS) ===== */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .navbar {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .dashboard-container,
    .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* ===== TOUCH RIPPLE EFFECT ===== */
.btn-enhanced {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== SWIPE GESTURES HINTS ===== */
.swipeable {
    position: relative;
}

.swipeable::after {
    content: '← Swipe →';
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 11px;
    color: var(--gray-400);
    opacity: 0;
    transition: opacity 0.3s;
}

.swipeable:hover::after {
    opacity: 1;
}

@media (max-width: 768px) {
    .swipeable::after {
        opacity: 0.5;
    }
}

/* ===== MOBILE MENU IMPROVEMENTS ===== */
@media (max-width: 768px) {
    .nav-menu.active {
        animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateX(-100%);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

/* ===== IMPROVED TAP FEEDBACK ===== */
@media (hover: none) {
    /* Mobile devices without hover capability */
    .btn:active,
    .nav-link:active,
    .tab-enhanced:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .card-elevated:active,
    .stat-card:active {
        transform: scale(0.99);
    }
}

/* ===== TOUCH CALLOUT & SELECTION ===== */
.btn, .nav-link, .tab-enhanced {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
    -webkit-touch-callout: none;
    user-select: none;
}

/* Allow text selection in content areas */
.dashboard-card,
.profile-card,
.form-group label,
p, span {
    -webkit-touch-callout: default;
    user-select: text;
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 3rem 0;
    }

    .dashboard {
        padding: 60px 0 20px 0;
    }

    .modal,
    .toast-container {
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* ===== BOTTOM NAVIGATION SAFE AREA ===== */
.bottom-nav {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* ===== STICKY ELEMENTS OPTIMIZATION ===== */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--bg-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ===== MODAL IMPROVEMENTS FOR MOBILE ===== */
@media (max-width: 768px) {
    .modal,
    #addDeviceModal > div {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header {
        position: sticky;
        top: 0;
        background: white;
        z-index: 1;
        border-bottom: 1px solid var(--gray-200);
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
}

/* ===== ACCESSIBILITY - FOCUS INDICATORS ===== */
.focus-visible:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-purple);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Remove focus for mouse users */
.using-mouse *:focus {
    outline: none;
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --border-light: rgba(255, 255, 255, 0.4);
        --border-medium: rgba(255, 255, 255, 0.6);
    }

    .btn,
    .card-elevated,
    .form-input-enhanced,
    .nav-link {
        border: 2px solid currentColor;
    }

    .badge {
        border: 2px solid currentColor;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    /* Already using dark theme, but ensure consistency */
    :root {
        color-scheme: dark;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .nav-menu,
    .nav-toggle,
    .btn,
    .toast-container,
    .modal {
        display: none !important;
    }

    .dashboard-card,
    .profile-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
        color: black;
    }
}

/* ===== SKELETON LOADER - MOBILE ===== */
@media (max-width: 768px) {
    .skeleton-card {
        height: 150px;
    }

    .skeleton-text {
        height: 0.9em;
    }
}

/* ===== LOADING SPINNERS ===== */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinner-rotation 0.6s linear infinite;
}

@keyframes spinner-rotation {
    to {
        transform: rotate(360deg);
    }
}

.spinner-large {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* ===== PULL TO REFRESH INDICATOR (Custom) ===== */
.ptr-element {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-100%);
    transition: transform 0.2s;
    color: var(--gray-500);
}

.ptr-element.ptr-pulling {
    transform: translateY(0);
}

.ptr-element.ptr-refreshing {
    transform: translateY(0);
}

/* ===== MOBILE-RESPONSIVE TABLES ===== */
@media (max-width: 768px) {
    /* Horizontal scroll wrapper for tables */
    .flights-table-container,
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -20px;
        padding: 0 20px;
        width: calc(100% + 40px);
    }

    .flights-table,
    .data-table {
        min-width: 600px;
        font-size: 13px;
    }

    .flights-table th,
    .flights-table td,
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* Alternative: Card view for tables on very small screens */
    @media (max-width: 480px) {
        .flights-table-mobile-cards .flights-table {
            display: none;
        }

        .flight-card-mobile {
            background: var(--bg-card, #1a1d29);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 16px;
            margin-bottom: 12px;
        }

        .flight-card-mobile-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            padding-bottom: 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .flight-card-mobile-date {
            font-size: 16px;
            font-weight: 600;
            color: white;
        }

        .flight-card-mobile-badge {
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 600;
        }

        .flight-card-mobile-details {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }

        .flight-card-mobile-item {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .flight-card-mobile-label {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.6);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .flight-card-mobile-value {
            font-size: 14px;
            color: white;
            font-weight: 500;
        }
    }
}

/* ===== DASHBOARD LAYOUT IMPROVEMENTS ===== */
@media (max-width: 768px) {
    /* Compact dashboard header */
    .dashboard-header {
        padding: 12px 16px !important;
        margin-bottom: 12px !important;
    }

    .welcome-section h1 {
        font-size: 18px !important;
    }

    .quick-stats {
        gap: 12px !important;
    }

    .stat-value {
        font-size: 20px !important;
    }

    .stat-label {
        font-size: 10px !important;
    }

    /* Tab navigation - better mobile */
    .tab-navigation {
        gap: 2px !important;
        padding: 3px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tab-navigation::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        padding: 10px 12px !important;
        font-size: 12px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Dashboard cards */
    .dashboard-card {
        padding: 16px !important;
        margin-bottom: 12px !important;
    }

    .card-title {
        font-size: 15px !important;
    }

    /* Info grid - single column on mobile */
    .info-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .info-item {
        padding: 12px !important;
    }

    /* Profile table on mobile */
    .profile-table {
        font-size: 13px;
    }

    .profile-table th,
    .profile-table td {
        padding: 10px 8px !important;
    }

    .profile-table th {
        width: 35% !important;
    }
}

/* ===== EXTRA SMALL SCREENS (PHONES) ===== */
@media (max-width: 480px) {
    .dashboard {
        padding: 60px 0 20px 0 !important;
    }

    .dashboard-container {
        padding: 8px !important;
    }

    .dashboard-header {
        padding: 10px 12px !important;
    }

    .welcome-section h1 {
        font-size: 16px !important;
    }

    .quick-stats {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .stat {
        flex: 0 0 calc(50% - 6px);
    }

    .tab-btn {
        padding: 8px 10px !important;
        font-size: 11px !important;
    }

    .dashboard-card {
        padding: 12px !important;
        margin-bottom: 10px !important;
    }

    .card-title {
        font-size: 14px !important;
    }

    /* Stack form rows on very small screens */
    .form-row {
        grid-template-columns: 1fr !important;
    }

    /* Smaller buttons */
    .btn,
    .btn-primary,
    .btn-secondary {
        font-size: 13px !important;
        padding: 10px 16px !important;
    }

    .btn-large {
        font-size: 14px !important;
        padding: 12px 20px !important;
    }
}

/* ===== FORM IMPROVEMENTS FOR MOBILE ===== */
@media (max-width: 768px) {
    /* Better form spacing and sizing */
    .form-group {
        margin-bottom: 16px !important;
    }

    .form-group label,
    .form-label {
        font-size: 13px !important;
        margin-bottom: 6px !important;
        display: block;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-input {
        width: 100% !important;
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 12px 14px !important;
        border-radius: 6px;
        border: 1px solid #d1d5db;
        background: #ffffff;
        color: #1f2937;
        transition: all 0.2s ease;
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus,
    .form-input:focus {
        border-color: var(--primary-green, #10b981);
        background: rgba(255, 255, 255, 0.08);
        outline: none;
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    }

    /* Textarea specific */
    .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }

    /* Select dropdowns */
    .form-group select {
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231f2937' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        color: #1f2937 !important;
        background-color: #ffffff !important;
        background-size: 12px;
        padding-right: 36px !important;
    }

    /* Ensure dropdown options are visible */
    .form-group select option,
    select option {
        background-color: #ffffff !important;
        color: #1f2937 !important;
        padding: 8px !important;
    }

    /* Checkbox and radio buttons */
    .form-group input[type="checkbox"],
    .form-group input[type="radio"] {
        width: auto !important;
        min-width: 20px;
        min-height: 20px;
        margin-right: 8px;
        accent-color: var(--primary-green, #10b981);
    }

    .checkbox-wrapper {
        padding: 12px !important;
        margin: 12px 0 !important;
    }

    .checkbox-wrapper label {
        font-size: 14px !important;
    }

    /* Form errors */
    .error-message,
    .form-error {
        font-size: 12px !important;
        margin-top: 4px !important;
        color: #ef4444;
    }

    /* Form sections */
    .form-section {
        margin-bottom: 20px !important;
    }

    .section-title {
        font-size: 14px !important;
        margin-bottom: 12px !important;
    }

    /* Form actions */
    .form-actions {
        margin-top: 20px !important;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== HERO SECTION MOBILE IMPROVEMENTS - ULTRA AGGRESSIVE ===== */
@media screen and (max-width: 768px) {

    /* STEP 1: Reset and simplify the hero section completely */
    section.hero-fullwidth,
    .hero-section.hero-fullwidth,
    #home.hero-fullwidth {
        position: relative !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;

        /* Background image directly on section */
        background: url('../images/hero/paragliding-alps-hero.jpg') no-repeat center center !important;
        background-size: cover !important;
        background-attachment: scroll !important;
    }

    /* STEP 2: Hide the nested background div and img completely */
    .hero-fullwidth .hero-background,
    .hero-fullwidth .hero-bg-image,
    section.hero-fullwidth > div.hero-background,
    section.hero-fullwidth > div.hero-background > img {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        position: absolute !important;
        left: -9999px !important;
    }

    /* STEP 3: No overlay - image fully visible */
    .hero-fullwidth .hero-overlay,
    section.hero-fullwidth > div.hero-overlay {
        display: none !important;
    }

    /* STEP 4: Content container - Compact */
    .hero-fullwidth .hero-container,
    section.hero-fullwidth > div.hero-container {
        position: relative !important;
        z-index: 10 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        height: 100vh !important;
        min-height: 100vh !important;
        padding: 70px 16px 16px !important;
        margin: 0 !important;
    }

    /* STEP 5: Content */
    .hero-fullwidth .hero-content-centered,
    .hero-container .hero-content-centered {
        position: relative !important;
        z-index: 11 !important;
        text-align: center !important;
        max-width: 95% !important;
        width: 100% !important;
        color: white !important;
    }

    /* STEP 6: Typography - Compact with stronger shadows */
    .hero-fullwidth .hero-title-large,
    .hero-content-centered .hero-title-large {
        font-size: 1.75rem !important;
        line-height: 1.15 !important;
        margin-bottom: 0.75rem !important;
        color: #ffffff !important;
        text-shadow:
            0 2px 20px rgba(0, 0, 0, 0.95),
            0 4px 40px rgba(0, 0, 0, 0.8),
            2px 2px 4px rgba(0, 0, 0, 0.9) !important;
        font-weight: 700 !important;
    }

    .hero-title-large .highlight,
    .hero-title-large span.highlight {
        color: #fbbf24 !important;
        text-shadow:
            0 2px 20px rgba(0, 0, 0, 0.95),
            0 4px 40px rgba(0, 0, 0, 0.8),
            2px 2px 4px rgba(0, 0, 0, 0.9) !important;
    }

    .hero-fullwidth .hero-subtitle-large,
    .hero-content-centered .hero-subtitle-large {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        margin-bottom: 1rem !important;
        color: #ffffff !important;
        text-shadow:
            0 2px 15px rgba(0, 0, 0, 0.95),
            0 4px 30px rgba(0, 0, 0, 0.7),
            2px 2px 4px rgba(0, 0, 0, 0.9) !important;
        opacity: 1 !important;
    }

    /* STEP 7: Buttons - Compact */
    .hero-fullwidth .hero-cta,
    .hero-content-centered .hero-cta {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        align-items: center !important;
    }

    .hero-cta .btn,
    .hero-cta a.btn {
        width: 90% !important;
        max-width: 280px !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 12px 24px !important;
        font-size: 0.95rem !important;
    }
}

/* Smaller phones - Even more compact */
@media screen and (max-width: 480px) {
    .hero-fullwidth .hero-title-large {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .hero-fullwidth .hero-subtitle-large {
        font-size: 0.85rem !important;
        margin-bottom: 0.75rem !important;
        line-height: 1.35 !important;
    }

    .hero-cta .btn,
    .hero-cta a.btn {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
    }

    section.hero-fullwidth,
    .hero-fullwidth {
        background-position: 45% center !important;
    }
}

/* iOS Safari specific */
@supports (-webkit-touch-callout: none) {
    @media screen and (max-width: 768px) {
        section.hero-fullwidth,
        .hero-fullwidth {
            height: 100vh !important;
            height: -webkit-fill-available !important;
            min-height: -webkit-fill-available !important;
        }

        .hero-fullwidth .hero-container {
            height: 100vh !important;
            height: -webkit-fill-available !important;
            min-height: -webkit-fill-available !important;
        }
    }
}

/* ===== SECTION SPACING MOBILE - COMPACT ===== */
@media (max-width: 768px) {
    .product-section,
    .contact-section,
    .problem-section {
        padding: 1.5rem 0 !important;
    }

    .section-header {
        margin-bottom: 1rem !important;
    }

    .section-title {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.5rem !important;
    }

    .section-subtitle {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.75rem !important;
    }

    .features-grid {
        gap: 0.75rem !important;
    }

    .feature-card {
        padding: 1rem !important;
    }

    .feature-content h3 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }

    .feature-content p {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0 !important;
    }

    /* Override inline styles for card grids */
    .problem-section > .container > div[style],
    .product-section > .container > div[style] {
        gap: 0.75rem !important;
        margin-top: 1rem !important;
    }

    /* Compact problem cards */
    .problem-section > .container > div > div[style] {
        padding: 1rem !important;
        margin-bottom: 0 !important;
    }

    .problem-section h3,
    .product-section h3 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }

    .problem-section p,
    .product-section p {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }

    /* Compact photo placeholders */
    .photo-placeholder {
        min-height: 160px !important;
        margin-bottom: 0.75rem !important;
    }

    /* Container padding */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* ===== RESPONSIVE IMAGES ===== */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }

    .hero-bg-image {
        object-fit: cover;
        object-position: center 30%;
    }

    .photo-placeholder {
        min-height: 200px !important;
    }

    /* Device info cards */
    .device-info-card {
        padding: 16px !important;
        margin: 12px 0 !important;
    }

    .device-info-card h2 {
        font-size: 16px !important;
    }

    .device-name-display {
        font-size: 24px !important;
        padding: 12px 20px !important;
        letter-spacing: 1px !important;
    }

    /* Profile cards */
    .profile-card {
        padding: 16px !important;
        margin: 12px 0 !important;
    }

    .profile-card h2 {
        font-size: 16px !important;
    }
}

/* ===== FOOTER MOBILE - COMPACT ===== */
@media (max-width: 768px) {
    .footer {
        padding: 1.25rem 0 0.75rem !important;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .footer-brand {
        max-width: 100%;
        margin-bottom: 0.5rem !important;
    }

    .footer-links {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.75rem !important;
    }

    .link-group {
        flex: 1;
    }

    .link-group h4 {
        font-size: 13px !important;
        margin-bottom: 0.5rem !important;
    }

    .link-group ul li {
        margin-bottom: 0.35rem !important;
    }

    .link-group ul li a {
        font-size: 12px !important;
    }
}

/* ===== UTILITY CLASSES FOR MOBILE ===== */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-center {
        text-align: center !important;
    }

    .mobile-full-width {
        width: 100% !important;
    }

    .mobile-no-padding {
        padding: 0 !important;
    }

    .mobile-small-padding {
        padding: 12px !important;
    }

    .mobile-no-margin {
        margin: 0 !important;
    }

    .mobile-stack {
        flex-direction: column !important;
    }
}

/* Hide by default on desktop */
@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* ===== BOTTOM SHEET (Mobile Modal Alternative) ===== */
@media (max-width: 768px) {
    .bottom-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 20px 20px 0 0;
        padding: 20px;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: var(--z-modal);
        max-height: 90vh;
        overflow-y: auto;
    }

    .bottom-sheet.active {
        transform: translateY(0);
    }

    .bottom-sheet-handle {
        width: 40px;
        height: 4px;
        background: var(--gray-300);
        border-radius: 2px;
        margin: 0 auto 16px;
    }

    .bottom-sheet-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: opacity 0.3s;
        z-index: calc(var(--z-modal) - 1);
        pointer-events: none;
    }

    .bottom-sheet-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }
}
