/* --- Menu Shortcode Styles (v3.9 - Final Layout Fix) --- */

.ydm-nav ul, .ydm-nav li { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.ydm-nav { background: #23282d; position: relative; width: 100%; }
.ydm-nav .ydm-menu { display: flex; flex-wrap: wrap; }
.ydm-nav .menu-item a { display: block; padding: 15px 20px; color: #fff; text-decoration: none; white-space: nowrap; }
.ydm-nav .menu-item a:hover { background: #32373c; }
.ydm-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; background: #32373c; min-width: 200px; z-index: 100; }
.ydm-nav .menu-item-has-children:hover > .sub-menu { display: block; }

/* --- New Mobile Toggle Bar Styles --- */
.ydm-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    padding: 10px 15px;
    display: none; /* Hidden on desktop */
    align-items: center;
    color: #fff;
    box-sizing: border-box;
}

.ydm-toggle-text {
    font-size: 18px;
    font-weight: bold;
    margin-right: auto; /* THE FIX: This pushes the icon all the way to the right */
}

.ydm-toggle-icon-wrap {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ydm-toggle-icon {
    position: relative;
    width: 24px;
    height: 2px;
    background-color: transparent; /* The middle bar is now invisible */
}

/* The top and bottom bars of the hamburger */
.ydm-toggle-icon::before,
.ydm-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #fff; /* Will be overridden by inline style */
    transition: all 0.3s ease;
}

.ydm-toggle-icon::before { transform: translateY(-8px); }
.ydm-toggle-icon::after { transform: translateY(8px); }

/* Animate to 'X' when open */
.ydm-toggle[aria-expanded="true"] .ydm-toggle-icon::before {
    transform: translateY(0) rotate(45deg);
}
.ydm-toggle[aria-expanded="true"] .ydm-toggle-icon::after {
    transform: translateY(0) rotate(-45deg);
}


/* --- Responsive and Z-Index Fixes --- */
@media (max-width: 768px) {
    /* Hide the desktop menu items */
    .ydm-nav > .ydm-menu {
        display: none;
    }
    /* Show the mobile toggle bar */
    .ydm-toggle {
        display: flex;
    }
    /* Style the dropdown menu that appears */
    .ydm-nav .ydm-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: inherit; /* Inherit the main menu background color */
        z-index: 99998; /* THE FIX: High z-index to appear on top */
    }
    .ydm-nav .ydm-menu.ydm-show {
        display: block;
    }
    .ydm-nav .sub-menu {
        position: static;
        background: rgba(0,0,0,0.15); /* Slightly darker for sub-items */
        padding-left: 15px;
    }
}