/*
 * ===================================================================
 * DT Mobile Menu Styles
 * * This file contains all styles for the mobile header, toggle,
 * slide-down panel, and accordion menu list.
 * ===================================================================
 */

/*
 * ===================================================================
 * PART 1: HEADER, TOGGLE & PANEL CONTAINER
 * (These styles control the mobile header layout)
 * ===================================================================
 */

/* --- 1. Hide mobile nav elements on desktop --- */
.mobile-nav {
    display: none;
}
@media (min-width: 1024px) {
    .mobile-nav {
        display: none !important;
    }
}

/* --- 2. Show/Hide elements on Mobile (< 1023px) --- */
@media (max-width: 1023px) {
    /* These styles adapt the theme's header for mobile */
    .site-header {
        background: #fff !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
        padding: 0 15px !important;
    }

    .site-content {
        padding-top: 80px !important; /* 60px bar + 20px space */
    }

    .header-inner {
        height: 60px;
        padding: 0;
        gap: 15px;
    }

    .site-logo {
        padding: 0;
        top: 0;
        left: 0;
    }
    
    .site-logo .custom-logo {
        max-height: 40px; 
        width: auto;
    }

    /* Hide desktop elements */
    .desktop-nav,
    .desktop-auth {
        display: none !important;
    }

    /* Show mobile nav container */
    .mobile-nav {
        display: flex;
        align-items: center;
        margin-left: auto;
        gap: 15px;
    }
}

/* --- 3. Hamburger Toggle Button --- */
.mobile-menu-toggle {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 1001;
    order: 2; /* This puts it after the auth icons */
}
.hamburger-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    position: relative;
    transition: background 0.2s ease 0.2s;
}
.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    position: absolute;
    left: 0;
    transition: transform 0.2s ease, top 0.2s ease 0.2s;
}
.hamburger-icon::before { top: -7px; }
.hamburger-icon::after { top: 7px; }

/* Active "X" state */
.mobile-menu-toggle.is-active .hamburger-icon {
    background: transparent;
}
.mobile-menu-toggle.is-active .hamburger-icon::before {
    top: 0;
    transform: rotate(45deg);
    transition: top 0.2s ease, transform 0.2s ease 0.2s;
}
.mobile-menu-toggle.is-active .hamburger-icon::after {
    top: 0;
    transform: rotate(-45deg);
    transition: top 0.2s ease, transform 0.2s ease 0.2s;
}

/* --- 4. Mobile Auth Icons --- */
.mobile-auth {
    order: 1; /* This puts it before the hamburger */
}
.mobile-auth .dtmm-top-bar-account {
    flex-direction: row;
    align-items: center;
    gap: 15px;
    padding-right: 0;
}
.mobile-auth .dt-social-icons {
    display: none;
}
.mobile-auth .dt-auth-links {
    gap: 12px;
}
.mobile-auth .dt-auth-link {
    color: #333;
}
.mobile-auth .dt-auth-link:hover {
    color: #f0f0f0;
}
.mobile-auth .dt-auth-link .auth-link-text {
    display: none;
}


/* --- 5. Slide-Down Panel Container --- */
.mobile-nav-panel {
    background: #fff;
    border-top: 1px solid #eee;
    position: fixed;
    top: 60px; /* This assumes your mobile header is 60px tall */
    left: 0;
    width: 100%;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}
.mobile-nav-panel.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}
body.mobile-menu-is-open {
    overflow: hidden;
}


/*
 * ===================================================================
 * PART 2: PANEL LIST & ACCORDION STYLES
 * (These styles control the menu content inside the panel)
 * ===================================================================
 */

/* --- 6. ACF Menu List Styling --- */
.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 1rem 0;
}
.mobile-menu-list li {
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}
.mobile-menu-list li:last-child {
    border-bottom: none;
}
.mobile-menu-list li a {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
}
.mobile-menu-list li a:hover {
    background: #f9f9f9;
    color: #a987c2;
}

/* Style for parent link when it has a sub-menu */
.mobile-menu-list li.has-submenu > a {
    padding-right: 60px; /* Make space for the button */
}

/* Sub-menu styling */
.mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f7f7f7;
    display: none; /* Hidden by default, JS will .slideDown() */
}
.mobile-submenu li {
    border-color: #e9e9e9;
}
.mobile-submenu li:first-child {
    border-top: 1px solid #e9e9e9;
}
.mobile-submenu li a {
    font-weight: 500;
    font-size: 1rem;
    padding-left: 2.5rem;
    color: #555;
}

/* Sub-menu Toggle Button */
.mobile-submenu-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 60px;
    background: transparent;
    border: none;
    border-left: 1px solid #f0f0f0;
    cursor: pointer;
    color: #a987c2;
    padding: 0;
}
.mobile-submenu-toggle:hover {
    background: #f9f9f9;
}

.mobile-submenu-toggle .icon-caret {
    display: block;
    width: 10px; /* Caret size */
    height: 10px; /* Caret size */
    
    /* Create the caret shape using borders */
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    
    /* Center it inside the button */
    position: absolute;
    top: 50%;
    left: 50%;
    
    /* Start by pointing RIGHT */
    transform: translate(-50%, -50%) rotate(-45deg);
    
    /* Add a smooth animation */
    transition: transform 0.3s ease;
}

/* When the menu is open, rotate the caret to point DOWN */
.has-submenu.submenu-is-open > .mobile-submenu-toggle .icon-caret {
    transform: translate(-50%, -50%) rotate(45deg);
}