/* ============================================
   CUSTOM MOBILE MENU WITH DRILL DOWN - MOBILE ONLY
   ============================================ */

@media only screen and (max-width: 1024px) {
    
    /* Hide default WoodMart mobile menu */
    .mobile-nav .mobile-pages-menu {
        display: none !important;
    }
    
    /* Force mobile nav to be full screen */
    .mobile-nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100% !important;
        z-index: 9999 !important;
        overflow: hidden !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-nav.wd-opened {
        transform: translateX(0);
    }
    
    /* Custom Mobile Nav Container */
    .custom-mobile-nav {
        background-color: #ffffff;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        position: relative;
        display: flex;
        flex-direction: column;
    }
    
    /* Header with back and close buttons */
    .custom-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        border-bottom: 1px solid #e0e0e0;
        flex-shrink: 0;
        background: #ffffff;
        position: relative;
        z-index: 10;
    }
    
    /* Back Button */
    .custom-back-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        background: none;
        border: none;
        font-size: 14px;
        color: #000000;
        cursor: pointer;
        padding: 5px 10px 5px 0;
        transition: opacity 0.3s ease;
        opacity: 0;
        pointer-events: none;
    }
    
    .custom-back-btn.active {
        opacity: 1;
        pointer-events: all;
    }
    
    .custom-back-btn:hover {
        opacity: 0.6;
    }
    
    .custom-back-btn svg {
        flex-shrink: 0;
    }
    
    /* Close Button */
    .custom-close-btn {
        background: none;
        border: none;
        font-size: 32px;
        color: #000000;
        cursor: pointer;
        padding: 5px;
        width: 40px;
        height: 40px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: opacity 0.3s ease;
        margin-left: auto;
    }
    
    .custom-close-btn:hover {
        opacity: 0.6;
    }
    
    /* Menu Container with smooth transitions */
    .custom-menu-container {
        flex: 1;
        overflow: hidden;
        position: relative;
    }
    
    .custom-menu-level {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 20px;
        background: #ffffff;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0;
    }
    
    .custom-menu-level.active {
        transform: translateX(0);
        opacity: 1;
    }
    
    .custom-menu-level.slide-out-left {
        transform: translateX(-30%);
        opacity: 0;
    }
    
    .custom-menu-level.slide-in-right {
        transform: translateX(100%);
        opacity: 0;
    }
    
    /* Main Menu List */
    .custom-mobile-menu {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .custom-mobile-menu li {
        margin: 0;
        padding: 0;
        border: none;
        opacity: 0;
        animation: fadeInUp 0.4s ease forwards;
    }
    
    .custom-mobile-menu li:nth-child(1) { animation-delay: 0.05s; }
    .custom-mobile-menu li:nth-child(2) { animation-delay: 0.1s; }
    .custom-mobile-menu li:nth-child(3) { animation-delay: 0.15s; }
    .custom-mobile-menu li:nth-child(4) { animation-delay: 0.2s; }
    .custom-mobile-menu li:nth-child(5) { animation-delay: 0.25s; }
    .custom-mobile-menu li:nth-child(6) { animation-delay: 0.3s; }
    .custom-mobile-menu li:nth-child(7) { animation-delay: 0.35s; }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .custom-mobile-menu li a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 0;
        text-decoration: none;
        color: #000000;
        font-size: 13px;
        font-weight: 400;
        letter-spacing: 1px;
        text-transform: uppercase;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        transition: all 0.3s ease;
        position: relative;
    }
    
    .custom-mobile-menu li a:hover {
        opacity: 0.7;
        padding-left: 5px;
    }
    
    .custom-mobile-menu li a.has-submenu {
        cursor: pointer;
    }
    
    .menu-item-text {
        flex: 1;
    }
    
    .menu-arrow {
        font-size: 18px;
        font-weight: 300;
        margin-left: auto;
        transition: transform 0.3s ease;
    }
    
    .custom-mobile-menu li a:hover .menu-arrow {
        transform: translateX(3px);
    }
    
    /* Hide submenu data */
    .submenu-data {
        display: none !important;
    }
    
    /* Divider */
    .custom-menu-divider {
        height: 1px;
        background-color: #e0e0e0;
        margin: 25px 0;
        opacity: 0;
        animation: fadeIn 0.4s ease forwards 0.4s;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
    
    /* Social Menu */
    .custom-social-menu {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .custom-social-menu li {
        margin: 0;
        padding: 0;
        border: none;
    }
    
    .custom-social-menu li a {
        display: flex;
        align-items: center;
        padding: 14px 0;
        text-decoration: none;
        color: #000000;
        font-size: 13px;
        font-weight: 400;
        letter-spacing: 0.5px;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        transition: all 0.3s ease;
        text-transform: none;
    }
    
    .custom-social-menu li a:hover {
        opacity: 0.7;
        padding-left: 5px;
    }
    
    .custom-social-menu li a svg {
        margin-right: 12px;
        flex-shrink: 0;
        transition: transform 0.3s ease;
    }
    
    .custom-social-menu li a:hover svg {
        transform: scale(1.1);
    }
    
    /* Ensure body doesn't scroll when menu is open */
    body.wd-mobile-nav-opened {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }
    
    /* Style the overlay/backdrop */
    .wd-backdrop {
        background-color: rgba(0, 0, 0, 0.5) !important;
        z-index: 9998 !important;
        transition: opacity 0.3s ease;
    }
}

/* Desktop - Hide custom mobile menu */
@media only screen and (min-width: 1025px) {
    .custom-mobile-nav {
        display: none !important;
    }
    
    .custom-mobile-menu-wrapper {
        display: none !important;
    }
}