/* ==========================================================
   BEAUTIFUL MOBILE NAVIGATION FOR GUTENBERG
   Works with custom JS:
   - .mobile-nav-wrapper
   - .mobile-nav-toggle
   - .mobile-nav-close
   - .is-open
========================================================== */

/* Wrapper */
.mobile-nav-wrapper {
    position: relative;
}

/* ==========================================================
   HAMBURGER BUTTON
========================================================== */
.mobile-nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
    border-radius: 12px;
    transition: background 0.3s ease;
    flex-direction: column;
}

.mobile-nav-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-nav-toggle span {
    display: block;
    width: 18px;
    height: 1px;
    margin: 2px auto;
    border-radius: 999px;
    background: #FFF;
    transition: all 0.3s ease;
}

/* ==========================================================
   CLOSE BUTTON
========================================================== */
.mobile-nav-close {
    display: none;
    position: absolute;
    top: 0px;
    right: 0px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #FFF;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000001;
    transition: all 0.3s ease;
}

.mobile-nav-close:hover {
    background: rgba(15, 23, 42, 0.12);
    transform: rotate(90deg);
}
.wp-block-navigation__responsive-container-close {
    
    right: 10px;
    top: 10px;
    
}
/* ==========================================================
   MOBILE ONLY
========================================================== */
@media (max-width: 781px) {

    /* Show hamburger */
    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
  
    /* Hide desktop navigation by default */
    .mobile-nav-wrapper > .wp-block-navigation {
        position: fixed;
        top: 0;
        right: 0;
        left:0;
        width: min(88vw, 360px);
        height: 100dvh;
        margin: 0;
        padding: 50px 0 32px;
        background: #1a0e04;
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        align-items: start;
        /* Hidden state */
       
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition:
            transform 0.35s ease,
            opacity 0.35s ease,
            visibility 0.35s ease;

       z-index: 1000000;
    }

    /* Dark backdrop */
    .mobile-nav-wrapper::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(3px);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all 0.35s ease;
        z-index: 999999;
    }

    /* Open state */
    .mobile-nav-wrapper.is-open::before {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-nav-wrapper.is-open > .wp-block-navigation {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        
        
    }

    /* Show close button when open */
    .mobile-nav-wrapper.is-open .mobile-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

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

    /* Navigation list */
    .mobile-nav-wrapper .wp-block-navigation ul {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 0;
        list-style: none;
        padding-top:40px;
    }

    /* Items */
    .mobile-nav-wrapper .wp-block-navigation li {
        width: 100%;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    }

    /* Links */
    .mobile-nav-wrapper .wp-block-navigation-item__content {
        display: block;
        width: 100%;
        padding: 16px 24px;
        color: #ea580c;
        font-size: 16px; /* Prevent iOS zoom */
        line-height: 1.5;
        font-weight: 600;
        text-decoration: none;
        transition: background 0.25s ease, color 0.25s ease;
    }
.current-menu-item .wp-block-navigation-item__content,
    .mobile-nav-wrapper .wp-block-navigation-item__content:hover {
        background: rgba(155,155,155,.1);
        color: #ea580c !important;
    }
    

    /* Submenus shown inline */
    .mobile-nav-wrapper .wp-block-navigation__submenu-container {
        position: static !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        background: #1a0e04;
        margin: 0;
        padding: 0;
        min-width: 100%;
    }

    /* Indent submenu links */
    .mobile-nav-wrapper
    .wp-block-navigation__submenu-container
    .wp-block-navigation-item__content {
        padding-left: 44px;
        font-weight: 500;
        font-size: 14px;
    }

    /* Submenu toggle buttons */
    .mobile-nav-wrapper .wp-block-navigation-submenu__toggle {
        min-width: 48px;
        min-height: 48px;
        margin-right: 8px;
    }
}

/* Desktop: hide custom close button */
@media (min-width: 782px) {
    .mobile-nav-close {
        display: none !important;
    }
}