/* Mobile Header Styles */

/* Media query for tablets and small desktops */
@media (max-width: 1399px) {
    header.site-header {
        width: 100%;
        max-width: 100vw;
        left: 0;
        transform: none;
        padding: 0 48px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f4f4f4;
        box-sizing: border-box;
    }

    .menu-container {
        max-width: 768px;
        flex: 1;
    }

    .desktop-menu {
        border-radius: 0;
        padding: 0;
    }

    /* Ensure menu items keep their border-radius in full-width mode */
    .main-nav .menu-item a,
    .main-nav .menu-item a:hover,
    .main-nav .menu-item:last-child a,
    .main-nav .menu-item:last-child a:hover {
        border-radius: 12px !important;
    }

    /* Show header logo in full-width mode */
    .header-logo {
        display: flex !important;
        align-items: center;
        height: 32px;
        padding-right: 0;
        padding-left: 32px;
        flex-shrink: 0;
        opacity: 1;
    }

    /* Show large logo for screens >= 960px */
    .header-logo-large {
        display: block;
    }

    .header-logo-small {
        display: none !important;
    }

    /* Hide logo-section-right when header logo is showing */
    .logo-section-right {
        display: none !important;
    }

    /* Hide white-logo-overlay when header logo is showing */
    .white-logo-overlay {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Add side padding to submenu when header is full width */
    .submenu-container {
        padding-left: 48px;
        padding-right: 48px;
    }
}

/* Media query for mobile devices */
@media (max-width: 768px) {
    header.site-header {
        height: 40px;
        padding: 0 16px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        /* Show header but hide desktop menu */
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f4f4f4;
    }

    /* Hide desktop menu on mobile */
    .desktop-menu {
        display: none !important;
    }

    /* Show hamburger menu on mobile */
    .hamburger-menu {
        display: flex !important;
        position: relative;
        top: auto;
        right: auto;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
    }

    /* Show header logo on mobile */
    .header-logo {
        height: 28px;
        padding-left: 8px;
        display: flex !important;
        opacity: 1;
    }

    /* When hamburger menu is active, show large logo again */
    .header-logo-large {
        display: block !important;
    }

    .header-logo-small {
        display: none !important;
    }

    /* Adjust submenu padding for mobile */
    .submenu-container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Media query for very small mobile devices */
@media (max-width: 480px) {
    header.site-header {
        height: 36px;
        padding: 0 12px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .desktop-menu {
        padding: 0;
        min-height: 29.6px;
    }

    .header-logo {
        height: 24px;
        padding-left: 4px;
        opacity: 1;
    }

    /* Adjust submenu padding for very small mobile */
    .submenu-container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Logo size switching for screens between 769px and 959px (before hamburger menu) */
@media (min-width: 769px) and (max-width: 959px) {
    /* Hide large logo and show small logo */
    .header-logo-large {
        display: none !important;
    }

    .header-logo-small {
        display: block !important;
    }
}
