/* ======================================
   Mobile & Tablet Optimization - v2.2
   Complete responsive navbar enhancements
   - AGGRESSIVE VISIBILITY FIXES
   - Fixed mobile menu visibility issues
   - Optimized mobile menu slide-in
   - Enhanced touch targets (44px min)
   - Smooth animations and transitions
   - Landscape orientation support
   - Accessibility improvements
====================================== */

/* Critical: Hide desktop navbar styles on mobile */
@media (max-width: 992px) {
    .navbar-toggler-modern {
        display: flex !important;
    }
    
    /* Removed: Redundant force-visibility block for mobile menu elements (now handled by inline style block in base.html) */
}

/* ==========================================
   MOBILE FIRST - BASE IMPROVEMENTS
========================================== */

/* Touch-friendly tap targets */
@media (max-width: 768px) {
    /* Minimum 44x44px tap targets */
    button,
    a,
    input,
    select,
    textarea,
    .btn,
    .nav-link-modern,
    .action-btn-modern {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Increase padding for better touch targets */
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        padding: 0.625rem 1rem;
        min-height: 40px;
    }
    
    /* Improve form inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem;
        min-height: 48px;
    }
    
    /* Better spacing for mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Improve text readability */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.125rem; }
    h6 { font-size: 1rem; }
}

/* ==========================================
   HEADER & NAVIGATION - MOBILE OPTIMIZED
========================================== */

@media (max-width: 992px) {
    /* Announcement bar mobile */
    .announcement-bar {
        font-size: 0.875rem;
        padding: 0.5rem 0;
        position: relative;
        z-index: 900;
    }
    
    .announcement-slide {
        padding: 0.25rem 0;
    }
    
    .announcement-slide i {
        font-size: 0.875rem;
        margin-right: 0.375rem;
    }
    
    /* Navbar container optimizations */
    .navbar-modern {
        padding: 0.75rem 0 !important;
        position: sticky !important;
        top: 0 !important;
        background: white !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        z-index: 1000 !important;
    }
    
    .navbar-container {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        gap: 0.75rem !important;
        align-items: center !important;
        padding: 0 1rem !important;
        max-width: 100% !important;
    }
    
    /* Logo section - compact for mobile */
    .navbar-brand-modern {
        grid-column: 2;
        justify-self: center;
    }
    
    .navbar-logo-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .navbar-logo-modern {
        max-width: 40px;
        max-height: 40px;
        border-radius: 8px;
    }
    
    .brand-text {
        display: flex;
        flex-direction: column;
    }
    
    .brand-name {
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.2;
    }
    
    .brand-tagline {
        font-size: 0.7rem;
        opacity: 0.7;
    }
    
    /* Hamburger menu - positioned left */
    .navbar-toggler-modern {
        grid-column: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        gap: 5px !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
        padding: 0.5rem !important;
        z-index: 10001 !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 8px !important;
        transition: background 0.3s ease !important;
        position: relative !important;
    }
    
    .navbar-toggler-modern:hover,
    .navbar-toggler-modern:focus {
        background: rgba(30, 58, 138, 0.1);
    }
    
    .hamburger-line {
        width: 24px;
        height: 2.5px;
        background: #1e3a8a;
        border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .navbar-toggler-modern[aria-expanded="true"] .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .navbar-toggler-modern[aria-expanded="true"] .hamburger-line:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }
    
    .navbar-toggler-modern[aria-expanded="true"] .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Mobile menu slide-in panel */
    .navbar-collapse-modern {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 85% !important;
        max-width: 360px !important;
        height: 100vh !important;
        height: calc(var(--vh, 1vh) * 100) !important; /* Fix for mobile browsers */
        background: #ffffff !important; /* Solid white background */
        z-index: 10000 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15) !important;
        display: block !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .navbar-collapse-modern.show {
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Mobile menu header with brand info */
    .navbar-collapse-modern::before {
        content: '' !important;
        display: block !important;
        height: 70px !important;
        background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%) !important;
        margin-bottom: 1rem !important;
        width: 100% !important;
        flex-shrink: 0 !important;
    }
    
    /* Mobile navigation list */
    .navbar-nav-modern {
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
        display: flex !important;
        gap: 0 !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }
    
    .nav-item-modern {
        width: 100% !important;
        border-bottom: 1px solid rgba(30, 58, 138, 0.08) !important;
        position: relative !important;
        display: block !important;
    }
    
    .nav-item-modern:last-child {
        border-bottom: none;
    }
    
    /* Mobile nav links - enhanced touch targets */
    .nav-link-modern {
        padding: 1rem 1.25rem !important;
        font-size: 1.0625rem !important;
        font-weight: 500 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.875rem !important;
        color: #1e293b !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
        min-height: 54px !important;
        position: relative !important;
        background: transparent !important;
        width: 100% !important;
        box-sizing: border-box !important;
        visibility: visible !important;
        opacity: 1 !important;
        /* Force text to show */
        line-height: 1.5 !important;
    }
    
    .nav-link-modern span,
    .nav-link-modern i {
        visibility: visible !important;
        opacity: 1 !important;
        color: inherit !important;
        display: inline-flex !important;
    }
    
    .nav-link-modern:hover,
    .nav-link-modern:active {
        background: rgba(59, 130, 246, 0.08) !important;
        color: #1e3a8a !important;
        padding-left: 1.5rem !important;
    }
    
    .nav-link-modern.active {
        background: rgba(59, 130, 246, 0.12);
        color: #1e3a8a;
        font-weight: 600;
    }
    
    .nav-link-modern.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: #3b82f6;
    }
    
    .nav-icon-inline {
        font-size: 1.125rem;
        width: 24px;
        text-align: center;
        flex-shrink: 0;
    }
    
    .dropdown-arrow {
        margin-left: auto;
        font-size: 0.875rem;
        transition: transform 0.3s ease;
    }
    
    .nav-link-modern[aria-expanded="true"] .dropdown-arrow {
        transform: rotate(180deg);
    }
    
    /* Mobile dropdown menu */
    .dropdown-menu-modern {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background: #f1f5f9;
        padding: 0.5rem 0;
        margin: 0;
        border-radius: 0;
    }
    
    .dropdown-menu-modern.show {
        display: block;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Mega menu mobile layout */
    .mega-menu-content {
        padding: 0;
    }
    
    .mega-menu-section {
        padding: 0.5rem 0;
    }
    
    .mega-menu-title {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        font-weight: 600;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin: 0;
    }
    
    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .mega-menu-item {
        padding: 0.875rem 1.5rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        color: #1e293b;
        text-decoration: none;
        transition: all 0.2s ease;
        min-height: 48px;
    }
    
    .mega-menu-item:hover,
    .mega-menu-item:active {
        background: rgba(59, 130, 246, 0.08);
        padding-left: 1.75rem;
    }
    
    .mega-item-icon {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(59, 130, 246, 0.1);
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    .mega-item-icon i {
        color: #3b82f6;
        font-size: 1rem;
    }
    
    .mega-item-text {
        display: flex;
        flex-direction: column;
        gap: 0.125rem;
    }
    
    .mega-item-name {
        font-weight: 500;
        font-size: 0.9375rem;
        color: #1e293b;
    }
    
    .mega-item-desc {
        font-size: 0.8125rem;
        color: #64748b;
    }
    
    /* Action buttons - positioned right */
    .navbar-actions-modern {
        grid-column: 3;
        display: flex;
        gap: 0.375rem;
        align-items: center;
    }
    
    .action-btn-modern {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.125rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        background: transparent;
        border: none;
        color: #1e3a8a;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
        padding: 0;
    }
    
    .action-btn-modern:hover,
    .action-btn-modern:focus {
        background: rgba(30, 58, 138, 0.1);
        transform: scale(1.05);
    }
    
    .action-btn-modern:active {
        transform: scale(0.95);
    }
    
    /* Cart badge mobile */
    .badge-modern {
        font-size: 0.6875rem;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        line-height: 18px;
        top: -4px;
        right: -4px;
        font-weight: 700;
    }
    
    /* Search button mobile */
    .search-toggle {
        display: flex;
    }
    
    /* User dropdown mobile */
    .user-dropdown-wrapper {
        position: relative;
    }
    
    .user-dropdown-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        min-width: 200px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        padding: 0.5rem;
        z-index: 1100;
        display: none;
    }
    
    .user-dropdown-menu.show {
        display: block;
        animation: fadeInUp 0.3s ease;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .dropdown-item-modern {
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        color: #1e293b;
        text-decoration: none;
        border-radius: 8px;
        transition: all 0.2s ease;
        font-size: 0.9375rem;
        min-height: 44px;
    }
    
    .dropdown-item-modern:hover,
    .dropdown-item-modern:active {
        background: rgba(59, 130, 246, 0.08);
        color: #1e3a8a;
    }
    
    .dropdown-item-modern i {
        width: 20px;
        text-align: center;
    }
    
    /* Mobile menu overlay */
    .navbar-collapse-modern.show::after {
        content: '';
        position: fixed;
        top: 0;
        left: 85%;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
}

/* ==========================================
   SMALLER MOBILE DEVICES (< 640px)
========================================== */

@media (max-width: 640px) {
    /* Further compact navbar */
    .navbar-container {
        padding: 0 0.75rem;
    }
    
    .navbar-logo-modern {
        max-width: 36px;
        max-height: 36px;
    }
    
    .brand-name {
        font-size: 0.9375rem;
    }
    
    .brand-tagline {
        font-size: 0.65rem;
    }
    
    /* Tighter action buttons */
    .navbar-actions-modern {
        gap: 0.25rem;
    }
    
    .action-btn-modern {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 1rem;
    }
    
    /* Wider mobile menu on small screens */
    .navbar-collapse-modern {
        width: 90%;
        max-width: 320px;
    }
    
    .navbar-collapse-modern.show::after {
        left: 90%;
    }
}

/* ==========================================
   VERY SMALL MOBILE (< 480px)
========================================== */

@media (max-width: 480px) {
    /* Ultra-compact announcement bar */
    .announcement-bar {
        font-size: 0.8125rem;
        padding: 0.375rem 0;
    }
    
    .announcement-slide {
        padding: 0.2rem 0;
    }
    
    .announcement-slide i {
        font-size: 0.8125rem;
        margin-right: 0.25rem;
    }
    
    /* Compact logo area */
    .navbar-logo-modern {
        max-width: 32px;
        max-height: 32px;
    }
    
    .brand-name {
        font-size: 0.875rem;
    }
    
    .brand-tagline {
        font-size: 0.625rem;
    }
    
    /* Smallest action buttons */
    .action-btn-modern {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        font-size: 0.9375rem;
    }
    
    /* Full-width mobile menu on very small screens */
    .navbar-collapse-modern {
        width: 95%;
        max-width: 300px;
    }
    
    .navbar-collapse-modern.show::after {
        left: 95%;
    }
    
    /* Compact nav links */
    .nav-link-modern {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .nav-icon-inline {
        font-size: 1rem;
        width: 20px;
    }
    
    /* Compact mega menu items */
    .mega-menu-item {
        padding: 0.75rem 1.25rem;
        min-height: 44px;
    }
    
    .mega-item-icon {
        width: 28px;
        height: 28px;
    }
    
    .mega-item-icon i {
        font-size: 0.9375rem;
    }
    
    .mega-item-name {
        font-size: 0.875rem;
    }
    
    .mega-item-desc {
        font-size: 0.75rem;
    }
    
    /* Smaller badge */
    .badge-modern {
        font-size: 0.625rem;
        min-width: 16px;
        height: 16px;
        line-height: 16px;
        padding: 0 4px;
    }
}

/* ==========================================
   TABLET LANDSCAPE (768px - 992px)
========================================== */

@media (min-width: 768px) and (max-width: 992px) {
    /* Show some desktop features on tablet */
    .navbar-collapse-modern {
        width: 65%;
        max-width: 400px;
    }
    
    .navbar-collapse-modern.show::after {
        left: 65%;
    }
    
    /* Slightly larger touch targets for tablets */
    .nav-link-modern {
        padding: 1.125rem 1.5rem;
        font-size: 1.125rem;
    }
    
    .mega-menu-item {
        padding: 1rem 1.75rem;
    }
    
    /* Better spacing for tablet */
    .navbar-container {
        padding: 0 1.5rem;
    }
}

/* ==========================================
   LANDSCAPE ORIENTATION OPTIMIZATIONS
========================================== */

@media (max-width: 992px) and (orientation: landscape) {
    /* Reduce header height in landscape */
    .navbar-modern {
        padding: 0.5rem 0;
    }
    
    .navbar-logo-modern {
        max-width: 36px;
        max-height: 36px;
    }
    
    .brand-tagline {
        display: none; /* Hide tagline in landscape to save space */
    }
    
    /* More compact mobile menu in landscape */
    .navbar-collapse-modern {
        width: 50%;
        max-width: 320px;
    }
    
    .navbar-collapse-modern.show::after {
        left: 50%;
    }
    
    .nav-link-modern {
        padding: 0.75rem 1rem;
        min-height: 44px;
    }
    
    /* Hide menu header gradient in landscape */
    .navbar-collapse-modern::before {
        height: 50px;
    }
}

/* ==========================================
   SEARCH OVERLAY - MOBILE OPTIMIZED
========================================== */

@media (max-width: 768px) {
    .search-overlay {
        padding: 1rem;
    }
    
    .search-overlay-content {
        padding: 2rem 1rem;
    }
    
    .search-input-large {
        font-size: 1rem;
        padding: 1rem 3rem 1rem 3.5rem;
        height: 54px;
    }
    
    .search-icon {
        left: 1.25rem;
        font-size: 1.125rem;
    }
    
    .search-submit-btn {
        width: 44px;
        height: 44px;
        right: 5px;
    }
    
    .search-close {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }
    
    .suggestion-tag {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* ==========================================
   ACCESSIBILITY & TOUCH ENHANCEMENTS
========================================== */

@media (max-width: 992px) {
    /* Increase tap target sizes for better accessibility */
    .touch-device .nav-link-modern,
    .touch-device .action-btn-modern,
    .touch-device .mega-menu-item,
    .touch-device .dropdown-item-modern {
        min-height: 48px;
    }
    
    /* Add visual feedback for touch */
    .nav-link-modern:active,
    .action-btn-modern:active,
    .mega-menu-item:active,
    .dropdown-item-modern:active {
        background: rgba(59, 130, 246, 0.15);
        transform: scale(0.98);
    }
    
    /* Prevent text selection on mobile nav */
    .navbar-nav-modern,
    .navbar-actions-modern,
    .mega-menu-grid {
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
    }
    
    /* Smooth scrolling for mobile menu */
    .navbar-collapse-modern {
        scroll-behavior: smooth;
    }
    
    /* Focus styles for keyboard navigation */
    .nav-link-modern:focus-visible,
    .action-btn-modern:focus-visible,
    .navbar-toggler-modern:focus-visible {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
    }
}

/* ==========================================
   HERO SECTIONS - MOBILE/TABLET
========================================== */

@media (max-width: 1200px) {
    .hero-epic {
        min-height: auto;
        padding: 5rem 0 3rem;
    }
    
    .hero-epic-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .hero-epic-content {
        text-align: center;
        align-items: center;
    }
    
    .hero-epic-showcase {
        display: none;
    }
    
    .hero-epic-title {
        font-size: 2.5rem;
    }
    
    .hero-epic-description {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .hero-epic {
        padding: 3rem 0 2rem;
    }
    
    .hero-epic-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-epic-description {
        font-size: 1rem;
    }
    
    .hero-epic-badge {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .hero-epic-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hero-stat {
        padding: 1rem;
    }
    
    .hero-stat-value {
        font-size: 1.75rem;
    }
    
    .hero-stat-label {
        font-size: 0.875rem;
    }
    
    .hero-epic-cta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .hero-epic-cta .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-epic-features {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-epic-title {
        font-size: 1.75rem;
    }
    
    .hero-epic-description {
        font-size: 0.9375rem;
    }
}

/* ==========================================
   PRODUCT CARDS - MOBILE/TABLET
========================================== */

@media (max-width: 1024px) {
    .products-grid-modern,
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .products-grid-modern,
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .product-card-modern {
        max-width: 100%;
    }
    
    .product-card-header {
        height: 250px;
    }
    
    .product-card-body {
        padding: 1.25rem;
    }
    
    .product-card-title {
        font-size: 1.125rem;
    }
    
    .product-card-price {
        font-size: 1.5rem;
    }
    
    .product-card-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .product-card-footer .btn {
        width: 100%;
    }
    
    .quick-view-btn {
        padding: 0.75rem;
        font-size: 1rem;
    }
}

/* ==========================================
   FILTERS - MOBILE/TABLET
========================================== */

@media (max-width: 992px) {
    .filter-panel-modern {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        z-index: 9998;
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
    }
    
    .filter-panel-modern.show {
        left: 0;
    }
    
    .filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9997;
    }
    
    .filter-overlay.show {
        display: block;
    }
    
    .filter-header-modern {
        padding: 1.5rem;
        border-bottom: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .filter-close-btn {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: #6b7280;
    }
    
    .filter-toggle-btn {
        display: flex;
        width: 100%;
        margin-bottom: 1rem;
        justify-content: center;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .filter-group-modern {
        margin-bottom: 1.25rem;
    }
    
    .filter-options {
        max-height: 200px;
        overflow-y: auto;
    }
}

/* ==========================================
   GOOGLE REVIEWS - MOBILE/TABLET
========================================== */

@media (max-width: 1024px) {
    .reviews-grid-modern {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .google-reviews-section {
        padding: 4rem 0;
    }
    
    .section-header-modern {
        margin-bottom: 2.5rem;
    }
    
    .section-title-modern {
        font-size: 1.875rem;
    }
    
    .section-subtitle-modern {
        font-size: 1rem;
    }
    
    .review-card-modern {
        padding: 1.5rem;
    }
    
    .reviewer-name-modern {
        font-size: 1rem;
    }
    
    .review-text-modern {
        font-size: 0.9375rem;
    }
    
    .btn-reviews-all {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .google-reviews-section {
        padding: 3rem 0;
    }
    
    .section-badge-modern {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .section-title-modern {
        font-size: 1.5rem;
    }
    
    .review-card-modern {
        padding: 1.25rem;
    }
}

/* ==========================================
   CART & CHECKOUT - MOBILE/TABLET
========================================== */

@media (max-width: 768px) {
    .cart-container,
    .checkout-container {
        padding: 1rem;
    }
    
    .cart-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cart-item-image {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .cart-item-details {
        width: 100%;
        text-align: center;
    }
    
    .cart-item-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .quantity-controls {
        justify-content: center;
    }
    
    .cart-summary {
        position: static;
        width: 100%;
        margin-top: 2rem;
    }
    
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    
    .checkout-form,
    .order-summary {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ==========================================
   ADMIN DASHBOARD - MOBILE/TABLET
========================================== */

@media (max-width: 1024px) {
    .admin-dashboard {
        padding: 1rem 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .action-card {
        padding: 1.25rem;
    }
    
    .dashboard-title {
        font-size: 1.75rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
    }
    
    /* Tables - make scrollable */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modern-table {
        min-width: 600px;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .stat-card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* ==========================================
   FOOTER - MOBILE/TABLET
========================================== */

@media (max-width: 992px) {
    .footer {
        padding: 3rem 0 2rem;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }
    
    .footer-section {
        align-items: center;
    }
    
    .footer-brand {
        justify-content: center;
    }
    
    .footer-links {
        align-items: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input {
        width: 100%;
    }
    
    .newsletter-form button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 2rem 0 1.5rem;
    }
    
    .footer-logo {
        max-width: 80px;
    }
}

/* ==========================================
   MODAL & POPUPS - MOBILE
========================================== */

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* ==========================================
   UTILITY CLASSES - MOBILE
========================================== */

@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .mobile-flex {
        display: flex !important;
    }
    
    .mobile-grid {
        display: grid !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-p-0 {
        padding: 0 !important;
    }
    
    .mobile-m-0 {
        margin: 0 !important;
    }
}

/* ==========================================
   PERFORMANCE - MOBILE
========================================== */

@media (max-width: 768px) {
    /* Disable heavy animations on mobile */
    .reduce-motion,
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
    
    /* Optimize images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
}

/* ==========================================
   LANDSCAPE MODE - TABLETS
========================================== */

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .hero-epic {
        min-height: 60vh;
    }
    
    .hero-epic-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .products-grid-modern {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .reviews-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   ACCESSIBILITY - MOBILE
========================================== */

@media (max-width: 768px) {
    /* Focus visible improvements */
    *:focus-visible {
        outline: 3px solid #3b82f6;
        outline-offset: 2px;
    }
    
    /* Skip to content link */
    .skip-to-content {
        position: absolute;
        top: -40px;
        left: 0;
        background: #1e3a8a;
        color: white;
        padding: 0.5rem 1rem;
        z-index: 100;
    }
    
    .skip-to-content:focus {
        top: 0;
    }
}

/* ==========================================
   CRITICAL MOBILE MENU FIX - FINAL OVERRIDE
   This section MUST be last to override everything
========================================== */

@media (max-width: 992px) {
    /* Absolutely force mobile menu visibility */
    body .navbar-collapse-modern {
        position: fixed !important;
        display: block !important;
        background: #ffffff !important;
        z-index: 10000 !important;
    }
    
    body .navbar-collapse-modern.show {
        transform: translateX(0) !important;
    }
    
    body .navbar-nav-modern {
        display: flex !important;
        flex-direction: column !important;
        padding-top: 80px !important;
        background: white !important;
    }
    
    body .nav-item-modern {
        display: block !important;
        width: 100% !important;
    }
    
    body .nav-link-modern {
        display: flex !important;
        padding: 16px 20px !important;
        color: #000000 !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        background: white !important;
        text-decoration: none !important;
    }
    
    body .nav-link-modern span {
        display: inline-block !important;
        color: #000000 !important;
    }
    
    body .nav-link-modern i {
        display: inline-block !important;
        color: #3b82f6 !important;
        margin-right: 12px !important;
    }
}
