/**
 * Mobile & Tablet Header Optimizations
 * Specific improvements for touch devices and smaller screens
 * COMPILED FROM SCSS - Proper CSS selectors
 */

/* Force mobile menu toggle visibility on tablets and mobile */
@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 1001;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
        user-select: none;
        -webkit-user-select: none;
    }

    .mobile-menu-toggle .hamburger {
        display: block !important;
        pointer-events: none;
    }

    /* Hide desktop navigation on mobile */
    .main-navigation.platform-nav {
        display: none !important;
    }
}

/* Mobile portrait - streamlined header */
@media (max-width: 767px) {
    .site-header .header-main-content {
        padding: 0 0.5rem;
        gap: 0.25rem;
    }

    /* Compact header actions on mobile */
    .header-actions {
        gap: 0.25rem;
        flex-shrink: 0;
    }

    /* Hide secondary items to make room for hamburger */
    .header-actions .search-toggle,
    .header-actions .header-account-link {
        display: none !important;
    }

    /* Compact CTA button - icon only */
    .header-actions .header-cta {
        padding: 0.4rem;
        font-size: 0.9rem;
        min-width: 40px;
    }

    /* Hide CTA text, show only icon */
    .header-actions .header-cta span:not(.cta-icon),
    .header-actions .header-cta .cta-text {
        display: none !important;
    }

    /* Smaller cart icon */
    .header-actions .header-cart-link {
        padding: 0.25rem;
        font-size: 1rem;
    }

    /* Smaller logo */
    .site-branding .logo-image {
        width: 120px !important;
        max-height: 32px !important;
    }

    /* Hide tagline */
    .site-branding .site-tagline {
        display: none !important;
    }

    /* Ensure hamburger is always visible */
    .header-actions .mobile-menu-toggle {
        display: flex !important;
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
    }
}

/* iPad Portrait and Landscape Optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .site-header .header-main {
        padding: 1.25rem 0;
    }

    .site-header .header-main-content {
        padding: 0 1.5rem;
        gap: 1.5rem;
    }

    .site-header .site-branding .logo-image {
        width: 200px;
        max-height: 52px;
    }

    .site-header .site-branding .site-tagline {
        font-size: 0.72rem;
        display: block;
    }

    .site-header .adventure-cta {
        padding: 0.65rem 1.1rem;
        font-size: 0.9rem;
    }

    .site-header .adventure-cta .cta-text {
        display: inline;
    }

    .site-header .search-toggle {
        padding: 0.6rem;
    }

    .site-header .search-toggle-icon {
        font-size: 1.3rem;
    }
}

/* Mobile Portrait Optimizations */
@media (max-width: 767px) {
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    .site-header .header-main {
        padding: 0.6rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .site-header + .site-content {
        padding-top: 80px;
    }

    /* Logo adjustments for mobile */
    .site-branding .logo-image {
        width: 150px;
        max-height: 38px;
    }

    .site-branding .site-tagline {
        display: none;
    }

    /* Mobile-specific touch improvements */
    .header-actions .search-toggle,
    .header-actions .mobile-menu-toggle {
        -webkit-tap-highlight-color: transparent;
        tap-highlight-color: transparent;
    }

    /* Mobile navigation improvements */
    .mobile-nav-overlay {
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .mobile-nav-overlay .mobile-nav-content {
        max-height: 100vh;
        padding-bottom: 2rem;
        padding-top: max(2rem, env(safe-area-inset-top) + 1rem);
        padding-left: max(2rem, env(safe-area-inset-left) + 1rem);
        padding-right: max(2rem, env(safe-area-inset-right) + 1rem);
    }

    /* Mobile search reveal adjustments */
    .header-search-reveal.active {
        max-height: 140px;
    }

    .header-search-reveal .search-reveal-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .header-search-reveal .search-form {
        width: 100%;
    }

    .header-search-reveal .search-field {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* iPhone SE and smaller screens */
@media (max-width: 375px) {
    .site-header .header-main-content {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .site-header .site-branding .logo-image {
        width: 130px;
        max-height: 34px;
    }

    .site-header .adventure-cta {
        padding: 0.4rem;
        min-width: 40px;
    }

    .site-header .adventure-cta .cta-text {
        display: none;
    }

    .site-header .adventure-cta .cta-icon {
        font-size: 0.95rem;
    }

    .mobile-nav-overlay .mobile-nav-content {
        padding: 1rem 0.75rem;
    }

    .mobile-nav-overlay .mobile-nav-content .mobile-nav-header {
        margin-bottom: 1.5rem;
    }

    .mobile-nav-overlay .mobile-nav-content .mobile-nav-title {
        font-size: 1.1rem;
    }

    .mobile-nav-overlay .mobile-nav-content .mobile-nav-item {
        padding: 0.6rem;
        min-height: 50px;
    }
}

/* Landscape mobile optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .site-header .header-main {
        padding: 0.5rem 0;
    }

    .site-header .site-branding .logo-image {
        max-height: 32px;
    }

    .mobile-nav-overlay .mobile-nav-content {
        padding: 1rem;
    }

    .mobile-nav-overlay .mobile-nav-content .mobile-nav-header {
        margin-bottom: 1rem;
    }

    .mobile-nav-overlay .mobile-nav-content .mobile-nav-item {
        padding: 0.5rem 0;
        min-height: 48px;
    }

    .mobile-nav-overlay .mobile-nav-content .mobile-nav-footer {
        margin-top: 1rem;
        padding-top: 1rem;
    }
}

/* Touch interaction improvements */
@media (hover: none) and (pointer: coarse) {
    .header-actions button:hover,
    .mobile-nav-item:hover,
    .adventure-cta:hover {
        transform: none;
    }

    .header-actions button:active,
    .mobile-nav-item:active,
    .adventure-cta:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }

    .mobile-nav-item:active {
        background-color: rgba(201, 204, 104, 0.1);
    }

    .search-toggle:active,
    .mobile-menu-toggle:active {
        background-color: rgba(201, 204, 104, 0.15);
    }
}

/* High DPI screen optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .site-branding .logo-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }

    .hamburger,
    .hamburger::before,
    .hamburger::after {
        transform: translateZ(0);
    }
}

/* Accessibility improvements for mobile */
@media (prefers-reduced-motion: reduce) {
    .header-main-content *,
    .mobile-nav-overlay *,
    .header-search-reveal * {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    .mobile-nav-content {
        transform: translateX(0) !important;
    }

    .mobile-nav-overlay.active .mobile-nav-content {
        transform: translateX(0) !important;
    }
}

/* Force light mode for entire site - disable dark mode */
:root {
    color-scheme: light only;
}

html, body {
    color-scheme: light only;
}

.site-header,
.mobile-nav-overlay,
.mobile-nav-content {
    color-scheme: light only;
}

/* Override any dark mode preferences */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: light only;
    }

    .site-header {
        background-color: #ffffff !important;
        border-bottom-color: rgba(0, 0, 0, 0.05) !important;
    }

    .site-header .header-main-content {
        color: #333333 !important;
    }

    .site-header .site-branding .site-tagline {
        color: #666666 !important;
    }

    .mobile-nav-overlay {
        background-color: rgba(0, 0, 0, 0.5) !important;
    }

    .mobile-nav-overlay .mobile-nav-content {
        background-color: #ffffff !important;
        color: #333333 !important;
    }

    .hamburger,
    .hamburger::before,
    .hamburger::after {
        background-color: #333333 !important;
    }

    .mobile-nav-item {
        color: #333333 !important;
    }

    .mobile-nav-item .nav-label {
        color: #333333 !important;
    }

    .mobile-nav-item .nav-description {
        color: #666666 !important;
    }

    .mobile-nav-title {
        color: #333333 !important;
    }

    .mobile-nav-close {
        color: #333333 !important;
    }

    .mobile-nav-header {
        border-bottom-color: rgba(0, 0, 0, 0.1) !important;
    }

    .mobile-nav-footer a {
        color: #333333 !important;
    }
}
