/* ============================================
   CATWALK MOBILE MENU
   Breakpoint: 1280px (matches reference theme)
   ============================================ */

/* Hide mobile menu elements on desktop */
@media (min-width: 1280px) {

    .mobile-menu-toggle,
    .mobile-menu-overlay,
    .mobile-menu {
        display: none !important;
    }
}

/* Mobile/Tablet Breakpoint */
@media (max-width: 1279px) {

    /* Hide desktop navigation */
    .catwalk-nav .nav-left,
    .catwalk-nav .nav-menu {
        display: none !important;
    }

    /* Reduce nav padding on mobile/tablet */
    .catwalk-nav .nav-wrapper {
        padding: 15px 20px;
    }

    /* Make nav-right flexbox to align icons + hamburger horizontally */
    .catwalk-nav .nav-right {
        display: flex !important;
        align-items: center !important;
        gap: 25px !important;
    }

    /* Position hamburger inline with icons */
    .mobile-menu-toggle {
        display: inline-block !important;
        background: none;
        border: none;
        padding: 10px;
        cursor: pointer;
        vertical-align: middle;
        margin-left: 0 !important;
    }

    /* Hamburger icon (3 lines) */
    .mobile-menu-toggle .hamburger-icon {
        display: block;
        width: 25px;
        height: 2px;
        background-color: currentColor;
        position: relative;
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle .hamburger-icon::before,
    .mobile-menu-toggle .hamburger-icon::after {
        content: '';
        display: block;
        width: 25px;
        height: 2px;
        background-color: currentColor;
        position: absolute;
        left: 0;
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle .hamburger-icon::before {
        top: -8px;
    }

    .mobile-menu-toggle .hamburger-icon::after {
        top: 8px;
    }

    /* Hamburger animation when menu is open */
    .mobile-menu-toggle.active .hamburger-icon {
        background-color: transparent;
    }

    .mobile-menu-toggle.active .hamburger-icon::before {
        transform: rotate(45deg);
        top: 0;
    }

    .mobile-menu-toggle.active .hamburger-icon::after {
        transform: rotate(-45deg);
        top: 0;
    }

    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 9998;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Mobile Menu Panel */
    .mobile-menu {
        position: fixed;
        top: 0;
        right: -500px;
        /* Start off-screen */
        width: 500px;
        max-width: 85vw;
        /* Don't exceed 85% of viewport on small screens */
        height: 100vh;
        background-color: #ffffff;
        overflow-y: auto;
        transition: right 0.3s ease;
        z-index: 9999;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-menu.active {
        right: 0;
    }

    /* Mobile Menu Header */
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border-bottom: 1px solid #eee;
    }

    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        padding: 5px;
        line-height: 1;
        color: #000;
    }

    /* Mobile Menu Items */
    .mobile-menu-items {
        padding: 20px 0;
    }

    .mobile-menu-items ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-menu-items>ul>li {
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-menu-items a {
        display: block;
        padding: 15px 20px;
        color: #000;
        text-decoration: none;
        font-size: 16px;
        font-weight: 400;
        transition: background-color 0.2s ease;
    }

    .mobile-menu-items a:hover {
        background-color: #f5f5f5;
    }

    /* Mobile Sub-menu Toggle */
    .mobile-menu-items .has-dropdown>a {
        position: relative;
        padding-right: 50px;
    }

    .mobile-menu-items .has-dropdown>a::after {
        content: '';
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid currentColor;
        transition: transform 0.3s ease;
    }

    .mobile-menu-items .has-dropdown.expanded>a::after {
        transform: translateY(-50%) rotate(180deg);
    }

    /* Mobile Sub-menu (Accordion) */
    .mobile-submenu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background-color: #f9f9f9;
    }

    .mobile-menu-items .has-dropdown.expanded>.mobile-submenu {
        max-height: 1000px;
        /* Large enough for content */
    }

    .mobile-submenu li a {
        padding-left: 40px;
        font-size: 15px;
    }

    /* Nested sub-menu (3rd level) */
    .mobile-submenu .mobile-submenu li a {
        padding-left: 60px;
        font-size: 14px;
    }

    /* Prevent body scroll when menu is open */
    body.mobile-menu-open {
        overflow: hidden;
    }

    /* Reduce nav padding on mobile */
    .catwalk-nav .nav-wrapper {
        padding: 15px 20px;
    }
}

/* Mobile/Tablet: Hide profile icon */
@media (max-width: 1279px) {

    /* Hide user/profile icon on mobile */
    .nav-icons li:last-child {
        display: none !important;
    }
}

/* Extra small screens - Also hide search */
@media (max-width: 480px) {
    .mobile-menu {
        width: 100%;
        max-width: 100%;
    }

    /* Hide search icon on very small screens */
    .nav-icons li:first-child {
        display: none !important;
    }

    /* Compact spacing */
    .nav-icons {
        gap: 10px;
    }
}