/* Responsive Design Enhancements */

/* Enhanced Mobile Navigation with Feature Queries */
@supports (--css: variables) {
    :root {
        --vh: 1vh; /* Fallback for dynamic viewport height */
        /* Ensure critical color variables have fallbacks */
        --white: #FFFFFF;
        --grey-light: #f5f5f7;
        --red: #D52B1E;
        --navy: #0A2240;
        --color-primary: #0A2240;
        --color-primary-dark: #071830;
        --color-accent: #D52B1E;
        --icon-size: 1.5rem;
        
        /* Enhanced mobile header variables */
        --header-mobile-shadow: 0 2px 12px rgba(10, 34, 64, 0.15);
        --header-mobile-border: 1px solid rgba(255, 255, 255, 0.1);
        --icon-touch-size: 48px;
        --cart-badge-glow: 0 0 8px rgba(213, 43, 30, 0.6);
        --ripple-color: rgba(255, 255, 255, 0.3);
        --menu-backdrop-blur: blur(8px);
    }
}

/* Progressive Enhancement for Modern Browsers */
@supports (backdrop-filter: blur(10px)) {
    .mobile-menu-overlay.active {
        backdrop-filter: blur(10px);
        background-color: rgba(0, 0, 0, 0.3);
    }
}

@supports (-webkit-backdrop-filter: blur(10px)) {
    .mobile-menu-overlay.active {
        -webkit-backdrop-filter: blur(10px);
        background-color: rgba(0, 0, 0, 0.3);
    }
}

/* Mobile Navigation Styles */
@media screen and (max-width: 1199px) {
    /* Enhanced header with depth and visual separation */
    .header {
        background-color: var(--navy, #0A2240) !important;
        box-shadow: var(--header-mobile-shadow);
        border-bottom: var(--header-mobile-border);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        position: relative;
    }
    
    .header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(255, 255, 255, 0.2) 20%, 
            rgba(255, 255, 255, 0.4) 50%, 
            rgba(255, 255, 255, 0.2) 80%, 
            transparent 100%);
        pointer-events: none;
    }
    
    .header-container {
        padding: 18px 24px;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
            -ms-flex-align: center;
                align-items: center;
        -webkit-box-pack: justify;
            -ms-flex-pack: justify;
                justify-content: space-between;
        -ms-flex-wrap: wrap;
            flex-wrap: wrap;
        width: 100%;
        -webkit-box-sizing: border-box;
                box-sizing: border-box;
        position: relative;
        min-height: 70px;
    }
    
    .logo {
        z-index: var(--z-index-header);
        position: relative;
        transition: transform 0.2s ease;
    }
    
    .logo::after {
        content: '';
        position: absolute;
        top: -4px;
        left: -4px;
        right: -4px;
        bottom: -4px;
        border-radius: 8px;
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.1) 0%, 
            rgba(255, 255, 255, 0.05) 50%, 
            transparent 100%);
        opacity: 0;
        transition: opacity 0.2s ease;
        pointer-events: none;
    }
    
    .logo:hover::after {
        opacity: 1;
    }
    
    /* Ensure logo doesn't overlap mobile menu when open */
    .mobile-menu-open .logo {
        z-index: var(--z-index-dropdown) !important;
    }
    
    .logo img {
        max-width: 190px;
        width: 100%;
        height: auto;
        object-fit: contain;
        display: block;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
        transition: filter 0.2s ease;
    }
    
    .logo:hover img {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: var(--icon-touch-size);
        height: var(--icon-touch-size);
        min-width: var(--icon-touch-size);
        min-height: var(--icon-touch-size);
        background: transparent;
        border: 2px solid transparent;
        border-radius: 12px;
        cursor: pointer;
        z-index: var(--z-index-header);
        position: relative;
        overflow: hidden;
        transition: all 0.2s ease;
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.1) 0%, 
            rgba(255, 255, 255, 0.05) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .mobile-menu-toggle:hover,
    .mobile-menu-toggle:focus {
        border-color: rgba(255, 255, 255, 0.2);
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.15) 0%, 
            rgba(255, 255, 255, 0.08) 100%);
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }
    
    .mobile-menu-toggle i {
        font-size: 1.4rem;
        color: var(--white);
        transition: all 0.2s ease;
        position: relative;
        z-index: 2;
    }
    
    .mobile-menu-toggle:hover i,
    .mobile-menu-toggle:focus i {
        color: var(--white);
        transform: scale(1.1);
    }
    
    /* Ripple effect for touch feedback */
    .mobile-menu-toggle::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: var(--ripple-color);
        transform: translate(-50%, -50%);
        transition: width 0.3s ease, height 0.3s ease;
        pointer-events: none;
        z-index: 1;
    }
    
    .mobile-menu-toggle.ripple-active::before {
        width: 60px;
        height: 60px;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100); /* Dynamic viewport height for iOS */
        background: linear-gradient(180deg, 
            var(--color-primary-dark) 0%, 
            #051220 100%);
        z-index: var(--z-index-modal);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
        overflow-y: auto;
        padding: 90px 0 30px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2), 
                    inset -1px 0 0 rgba(255, 255, 255, 0.1);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
    }
    
    .main-nav::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 90px;
        background: linear-gradient(180deg, 
            rgba(255, 255, 255, 0.1) 0%, 
            transparent 100%);
        pointer-events: none;
    }
    
    .main-nav.active {
        transform: translateX(0);
    }
    
    .main-nav ul {
        display: block;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .main-nav > ul > li {
        margin: 0;
        display: block;
        width: 100%;
        position: relative;
    }
    
    /* Submenu styles */
    .main-nav ul ul {
        display: none;
        padding-left: var(--space-md);
    }
    
    .main-nav li:hover > ul,
    .main-nav li:focus-within > ul {
        display: block;
    }
    
    .main-nav ul li a {
        display: block;
        padding: 18px 30px;
        color: #fff;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        outline: 2px solid transparent;
        outline-offset: -2px;
        position: relative;
        font-weight: 500;
        font-size: 1.05rem;
        overflow: hidden;
    }
    
    .main-nav ul li a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: linear-gradient(180deg, 
            var(--color-accent) 0%, 
            #ff4444 100%);
        transform: scaleY(0);
        transition: transform 0.3s ease;
        transform-origin: bottom;
    }
    
    .main-nav ul li a::after {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, 
            rgba(255, 255, 255, 0.1) 0%, 
            transparent 50%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .main-nav ul li a:hover,
    .main-nav ul li a:focus,
    .main-nav ul li a.active {
        background: linear-gradient(90deg, 
            rgba(213, 43, 30, 0.15) 0%, 
            rgba(255, 255, 255, 0.05) 100%);
        color: #fff;
        outline-color: var(--color-accent);
        transform: translateX(8px);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    
    .main-nav ul li a:hover::before,
    .main-nav ul li a:focus::before,
    .main-nav ul li a.active::before {
        transform: scaleY(1);
    }
    
    .main-nav ul li a:hover::after,
    .main-nav ul li a:focus::after {
        opacity: 1;
    }
    
    .main-nav ul li a:focus:not(:focus-visible) {
        outline: none;
    }
    
    .main-nav ul li a:focus-visible {
        outline: 2px solid var(--color-accent);
        outline-offset: -2px;
    }
    
    @media screen and (max-width: 1199px) {
        .secondary-nav {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .secondary-nav a {
            color: var(--white) !important;
            font-size: 18px;
            line-height: 1.5;
            padding: 12px;
            white-space: nowrap;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border-radius: 12px;
            position: relative;
            overflow: hidden;
            min-width: var(--icon-touch-size);
            min-height: var(--icon-touch-size);
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.1) 0%, 
                rgba(255, 255, 255, 0.05) 100%);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
        
        .secondary-nav a::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: var(--ripple-color);
            transform: translate(-50%, -50%);
            transition: width 0.3s ease, height 0.3s ease;
            pointer-events: none;
        }
        
        /* Ensure icons are visible and have proper contrast */
        .secondary-nav a i {
            color: var(--white) !important;
            font-size: 1.2rem;
            transition: transform 0.2s ease;
            position: relative;
            z-index: 2;
        }
        
        /* Enhanced hover and active states for better touch feedback */
        .secondary-nav a:hover,
        .secondary-nav a:focus {
            color: var(--white) !important;
            background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.2) 0%, 
                rgba(255, 255, 255, 0.1) 100%);
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }
        
        .secondary-nav a:hover i,
        .secondary-nav a:focus i {
            transform: scale(1.1);
        }
        
        .secondary-nav a:active {
            transform: scale(0.95);
        }
        
        .secondary-nav a.ripple-active::before {
            width: 50px;
            height: 50px;
        }
        
        .secondary-nav .btn {
            display: none;
        }
    }
    
    /* Enhanced overlay when menu is open */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(circle at center, 
            rgba(0, 0, 0, 0.4) 0%, 
            rgba(0, 0, 0, 0.6) 100%);
        z-index: var(--z-index-navigation);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: var(--menu-backdrop-blur);
        -webkit-backdrop-filter: var(--menu-backdrop-blur);
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* Responsive Grid System */
@media screen and (max-width: 1200px) {
    .container {
        width: 95%;
        max-width: 1140px;
    }
}

@media screen and (max-width: 991px) {
    .row {
        flex-wrap: wrap;
    }
    
    .col-1-2,
    .col-1-3,
    .col-2-3,
    .col-1-4 {
        width: 100%;
        margin-bottom: 30px;
    }
    
    .col-1-2:last-child,
    .col-1-3:last-child,
    .col-2-3:last-child,
    .col-1-4:last-child {
        margin-bottom: 0;
    }
    
    /* Tablet-specific adjustments */
    .col-tablet-1-2 {
        width: 48%;
    }
    
    .col-tablet-1-2:nth-child(2n) {
        margin-left: 4%;
    }
    
    .col-tablet-1-2:nth-child(2n+1) {
        clear: left;
    }
}

@media screen and (min-width: 768px) and (max-width: 991px) {
    .service-card,
    .resource-card,
    .course-card,
    .team-card,
    .testimonial-card {
        height: 100%;
    }
    
    .col-1-3,
    .col-1-4 {
        width: 48%;
        margin-right: 4%;
    }
    
    .col-1-3:nth-child(2n),
    .col-1-4:nth-child(2n) {
        margin-right: 0;
    }
    
    .col-1-3:nth-child(3n),
    .col-1-4:nth-child(4n) {
        margin-right: 4%;
    }
    
    .col-1-3:nth-child(2n),
    .col-1-4:nth-child(2n) {
        margin-right: 0;
    }
}

/* Mobile Styles */
@media screen and (max-width: 767px) {
    /* Critical fix for cart/account icon visibility on mobile */
    .secondary-nav {
        z-index: var(--z-index-header, 1000);
    }
    
    /* Explicit z-index hierarchy for mobile menu */
    .header {
        z-index: var(--z-index-overlay, 998);
    }
    
    .logo {
        z-index: var(--z-index-header, 1000);
    }
    
    .mobile-menu-toggle {
        z-index: var(--z-index-header, 1000);
    }
    
    .mobile-menu-overlay {
        z-index: var(--z-index-navigation, 999);
    }
    
    .main-nav {
        z-index: var(--z-index-modal, 10000) !important;
    }
    
    /* When mobile menu is open, lower logo z-index */
    .mobile-menu-open .logo {
        z-index: var(--z-index-dropdown, 100) !important;
    }
    
    /* Ensure mobile menu content is above everything */
    .main-nav.active ul,
    .main-nav.active li,
    .main-nav.active a {
        position: relative;
        z-index: 1;
    }
    
    .secondary-nav a,
    .secondary-nav a i,
    .cart-icon,
    .cart-icon i {
        color: var(--white, #FFFFFF) !important;
        opacity: 1 !important;
    }
    
    /* Ensure proper contrast for touch states */
    .secondary-nav a:active,
    .cart-icon:active {
        opacity: 0.7 !important;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        margin-bottom: 30px;
    }
    
    .btn {
        padding: 10px 20px;
    }
    
    /* Hero Section */
    .hero {
        height: auto;
        min-height: 400px;
    }
    
    .hero-content {
        padding: 40px 0;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    /* Cards and Grids */
    .service-card,
    .resource-card,
    .course-card,
    .team-card,
    .testimonial-card,
    .contact-card,
    .package-card,
    .membership-card {
        margin-bottom: 20px;
    }
    
    /* Form Elements */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-row .form-group {
        width: 100%;
        margin-right: 0;
    }
    
    /* Cart and Checkout */
    .cart-header {
        display: none;
    }
    
    .cart-item {
        flex-direction: column;
        padding: 15px;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 5px;
    }
    
    .cart-item-product,
    .cart-item-price,
    .cart-item-quantity,
    .cart-item-subtotal,
    .cart-item-action {
        width: 100%;
        padding: 5px 0;
        text-align: left;
    }
    
    .cart-item-price::before,
    .cart-item-quantity::before,
    .cart-item-subtotal::before {
        content: attr(data-title);
        font-weight: 600;
        margin-right: 5px;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .coupon-section {
        width: 100%;
        margin-bottom: 15px;
    }
    
    /* Footer */
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-bottom {
        margin-top: 20px;
        padding-top: 20px;
    }
}

/* Touch Target Enhancements for Mobile */
@media screen and (max-width: 767px) {
    /* Ensure all interactive elements meet minimum touch target size */
    button,
    a,
    input[type="button"],
    input[type="submit"],
    input[type="reset"],
    .btn,
    .icon-button,
    .social-icon,
    .cart-icon,
    .mobile-menu-toggle,
    [role="button"],
    [onclick] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Small icons that need larger touch targets */
    .fa-user,
    .fa-shopping-cart,
    .fa-bars,
    .fa-times {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
        margin: -8px;
    }
    
    /* Ensure cart and account icons are visible on mobile */
    .cart-icon,
    .secondary-nav a[aria-label="User Account"] {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Cart badge visibility on mobile */
    .cart-badge {
        position: absolute;
        top: -8px;
        right: -8px;
        background: var(--red, #D52B1E) !important;
        color: var(--white) !important;
        border-radius: 50%;
        min-width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        font-weight: 600;
        pointer-events: none;
        line-height: 1;
        padding: 0 4px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    /* Form elements */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    select,
    textarea {
        min-height: 44px;
        padding: 10px 12px;
    }
    
    /* Dropdown and select elements */
    .dropdown-toggle,
    .language-selector,
    select {
        min-height: 44px;
        padding-right: 40px; /* Space for dropdown arrow */
    }
}

/* Cart Icon and Badge Specific Styles */
@media screen and (max-width: 1199px) {
    /* Enhanced cart icon container */
    .cart-container {
        position: relative;
        display: inline-block;
    }
    
    /* Enhanced cart icon link */
    .cart-icon {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: relative;
        color: var(--white, #FFFFFF) !important;
        min-width: var(--icon-touch-size);
        min-height: var(--icon-touch-size);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 12px;
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.1) 0%, 
            rgba(255, 255, 255, 0.05) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        overflow: hidden;
    }
    
    .cart-icon::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: var(--ripple-color);
        transform: translate(-50%, -50%);
        transition: width 0.3s ease, height 0.3s ease;
        pointer-events: none;
    }
    
    .cart-icon:hover,
    .cart-icon:focus {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.2) 0%, 
            rgba(255, 255, 255, 0.1) 100%);
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .cart-icon:active {
        transform: scale(0.95);
    }
    
    .cart-icon.ripple-active::before {
        width: 50px;
        height: 50px;
    }
    
    .cart-icon i {
        font-size: 1.2rem;
        color: inherit !important;
        transition: transform 0.2s ease;
        position: relative;
        z-index: 2;
    }
    
    .cart-icon:hover i,
    .cart-icon:focus i {
        transform: scale(1.1);
    }
    
    /* Enhanced cart badge styling */
    .cart-badge {
        position: absolute !important;
        top: 2px !important;
        right: 2px !important;
        transform: translate(50%, -50%);
        background: linear-gradient(135deg, 
            var(--red, #D52B1E) 0%, 
            #ff4444 100%) !important;
        color: var(--white, #FFFFFF) !important;
        border-radius: 50% !important;
        min-width: 20px !important;
        height: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        padding: 0 4px !important;
        box-shadow: var(--cart-badge-glow), 
                    0 2px 8px rgba(0, 0, 0, 0.3) !important;
        z-index: 10;
        border: 2px solid var(--white) !important;
        animation: cartBadgePulse 2s ease-in-out infinite;
    }
    
    @keyframes cartBadgePulse {
        0%, 100% {
            transform: translate(50%, -50%) scale(1);
        }
        50% {
            transform: translate(50%, -50%) scale(1.1);
            box-shadow: var(--cart-badge-glow), 
                        0 4px 12px rgba(213, 43, 30, 0.4), 
                        0 2px 8px rgba(0, 0, 0, 0.3);
        }
    }
    
    /* Ensure badge text is always readable */
    .cart-badge:not(:empty) {
        display: flex !important;
    }
    
    /* Stop animation when cart is empty */
    .cart-badge:empty {
        animation: none;
    }
    
    /* Enhanced cart dropdown positioning on mobile */
    .cart-dropdown {
        position: fixed !important;
        top: 70px !important;
        right: 10px !important;
        left: auto !important;
        width: calc(100vw - 20px) !important;
        max-width: 380px !important;
        z-index: 1001 !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 
                    0 0 0 1px rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        background: linear-gradient(145deg, 
            rgba(255, 255, 255, 0.95) 0%, 
            rgba(255, 255, 255, 0.9) 100%) !important;
    }
}

/* Enhanced accessibility and color contrast improvements */
@media screen and (max-width: 1199px) {
    /* High contrast mode support */
    @media (prefers-contrast: high) {
        .header {
            border-bottom: 2px solid var(--white);
        }
        
        .mobile-menu-toggle,
        .secondary-nav a,
        .cart-icon {
            border: 2px solid rgba(255, 255, 255, 0.6);
        }
        
        .cart-badge {
            border: 3px solid var(--white) !important;
            font-weight: 800 !important;
        }
    }
    
    /* Reduced motion preferences */
    @media (prefers-reduced-motion: reduce) {
        .mobile-menu-toggle,
        .secondary-nav a,
        .cart-icon,
        .main-nav,
        .mobile-menu-overlay {
            transition: none !important;
            animation: none !important;
        }
        
        .cart-badge {
            animation: none !important;
        }
        
        .main-nav ul li a::before,
        .main-nav ul li a::after {
            transition: none !important;
        }
    }
}

/* Small Mobile Styles - iPhone SE and similar */
@media screen and (max-width: 480px) {
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .container {
        width: 100%;
        padding: 0 16px;
    }
    
    /* Optimized header for very small screens */
    .header-container {
        padding: 16px 18px;
        min-height: 64px;
    }
    
    .logo img {
        max-width: 160px;
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15));
    }
    
    .mobile-menu-toggle,
    .secondary-nav a,
    .cart-icon {
        min-width: 44px;
        min-height: 44px;
    }
    
    .mobile-menu-toggle i,
    .secondary-nav a i,
    .cart-icon i {
        font-size: 1.1rem;
    }
    
    /* Adjust main nav for small screens */
    .main-nav {
        width: 90%;
        max-width: 280px;
        padding: 80px 0 25px;
    }
    
    .main-nav ul li a {
        padding: 16px 24px;
        font-size: 1rem;
    }
    
    /* Enhanced cart badge for small screens */
    .cart-badge {
        min-width: 18px !important;
        height: 18px !important;
        font-size: 0.7rem !important;
        top: 0px !important;
        right: 0px !important;
    }
    
    /* Override any fixed min-widths that might cause overflow */
    * {
        max-width: 100vw !important;
    }
    
    /* Fix elements with minimum widths */
    .dropdown-menu,
    .modal,
    .tooltip,
    [style*="min-width"] {
        min-width: auto !important;
        max-width: calc(100vw - 30px) !important;
    }
    
    /* Ensure tables are scrollable */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Typography adjustments */
    h1 {
        font-size: 1.8rem;
        word-wrap: break-word;
    }
    
    h2 {
        font-size: 1.5rem;
        word-wrap: break-word;
    }
    
    h3 {
        font-size: 1.3rem;
        word-wrap: break-word;
    }
    
    .btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .cta-buttons .btn {
        margin-right: 0;
    }
    
    /* Hero Section */
    .hero {
        min-height: 350px;
    }
    
    .hero-content {
        padding: 30px 0;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    /* Calendar */
    .calendar-table th,
    .calendar-table td {
        padding: 5px;
        font-size: 0.8rem;
    }
    
    .calendar-event {
        padding: 2px;
        font-size: 0.7rem;
    }
    
    /* Testimonials */
    .testimonial-content {
        padding: 15px;
    }
    
    .testimonial-author {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .testimonial-author-image {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Responsive Utility Classes */
@media screen and (max-width: 767px) {
    .hide-on-mobile {
        display: none !important;
    }
    
    .text-center-mobile {
        text-align: center !important;
    }
    
    .mt-mobile-3 {
        margin-top: 15px !important;
    }
    
    .mb-mobile-3 {
        margin-bottom: 15px !important;
    }
}

@media screen and (min-width: 768px) and (max-width: 991px) {
    .hide-on-tablet {
        display: none !important;
    }
}

@media screen and (min-width: 992px) {
    .hide-on-desktop {
        display: none !important;
    }
}

/* iOS-Specific Fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari fixes */
    button,
    a,
    input,
    select,
    textarea,
    .btn,
    .mobile-menu-toggle {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Smooth scrolling for iOS */
    .main-nav,
    .mobile-menu-overlay,
    .modal-content,
    .dropdown-menu {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Safe area insets for iPhone notch */
    .header,
    .main-nav,
    .mobile-menu-overlay {
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* Prevent double-tap zoom on buttons */
    button,
    .btn,
    .mobile-menu-toggle,
    input[type="button"],
    input[type="submit"] {
        touch-action: manipulation;
    }
    
    /* Fix for iOS input zoom */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on focus */
    }
}

/* Print Styles */
@media print {
    header, footer, .cta-section, .secondary-nav, .mobile-menu-toggle {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
    }
    
    .section {
        padding: 20px 0;
        page-break-inside: avoid;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    .col-1-2, .col-1-3, .col-2-3, .col-1-4 {
        width: 100%;
        margin-bottom: 20px;
    }
}

/* ==========================================================================
   Touch Interaction Enhancements
   ========================================================================== */

/* Enhanced touch feedback for all interactive elements */
.touch-active {
    opacity: 0.85 !important;
    transform: scale(0.96) !important;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.15s ease !important;
}

/* Specific touch feedback for header elements */
.header .touch-active {
    filter: saturate(120%) brightness(1.1);
}

/* Haptic-style feedback for primary actions */
.cart-icon.touch-active,
.mobile-menu-toggle.touch-active {
    transform: scale(0.92) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Enhanced mobile menu touch styles */
.mobile-menu-toggle {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    cursor: pointer;
    position: relative;
}

/* Enhanced ripple effects already handled in main mobile-menu-toggle styles above */

/* Secondary nav items touch optimization */
.secondary-nav a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

/* Cart icon specific touch enhancements */
.cart-icon {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

/* Visual feedback for successful touch */
@keyframes touchSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); filter: brightness(1.2); }
    100% { transform: scale(1); }
}

.touch-success {
    animation: touchSuccess 0.2s ease;
}

/* Navigation menu touch optimizations */
.main-nav.active {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.main-nav a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.main-nav a.touch-active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* iOS rubber band scrolling fix when menu is open */
body.menu-open {
    position: fixed;
    overflow: hidden;
    width: 100%;
    height: 100%;
    -webkit-overflow-scrolling: auto;
}

/* Ensure overlay is touch-friendly */
.mobile-menu-overlay {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Touch-optimized buttons and links */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets on touch devices */
    .mobile-menu-toggle,
    .main-nav a,
    .btn,
    button,
    [role="button"],
    [onclick] {
        min-height: 48px;
        min-width: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Add hover states only for non-touch devices */
    .mobile-menu-toggle:hover,
    .main-nav a:hover,
    .btn:hover {
        opacity: 1;
    }
}

/* Swipe gesture indicator */
.main-nav.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    animation: swipeHint 2s ease-in-out infinite;
}

@keyframes swipeHint {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(-50%) translateX(0);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-50%) translateX(-10px);
    }
}

/* Accessibility: Visible focus states for keyboard navigation */
.mobile-menu-toggle:focus-visible,
.main-nav a:focus-visible {
    outline: 2px solid var(--color-primary-red, #D52B1E);
    outline-offset: 2px;
}

/* Performance: Use GPU acceleration for transforms */
.main-nav,
.mobile-menu-overlay,
.mobile-menu-toggle {
    will-change: transform, opacity;
}

/* Prevent text selection during swipe */
.touch-optimized * {
    -webkit-touch-callout: none;
}

.touch-optimized input,
.touch-optimized textarea {
    -webkit-touch-callout: auto;
    -webkit-user-select: auto;
}
