/* General body styles to prevent scroll when menu is open */
body.your-cbcm-menu-open {
    overflow: hidden; /* Prevents scrolling of main content */
}

/* Overlay to dim content when menu is open */
.your-cbcm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Dim effect */
    z-index: 9998; /* Below menu, above page content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

body.your-cbcm-menu-open .your-cbcm-overlay {
    opacity: 1;
    visibility: hidden;
}

/* Pop-out menu container */
#your-cbcm-popout-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 350px; /* Adjust as needed */
    height: 100%;
    background-color: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%); /* Start completely off-screen */
    transition: transform 0.3s ease-in-out; /* Smooth slide-in */
    z-index: 9999; /* Ensure it's on top of other content */
    overflow-y: visible; /* Allow vertical scrolling for the main menu content */
    overflow-x: visible; /* <-- CRITICAL: Allow submenus to expand horizontally */
    padding: 5px;
    box-sizing: border-box;
    border-right: 1px solid #eee;
}

#your-cbcm-popout-menu.active {
    transform: translateX(0); /* Slides into view */
}

/* Close button */
.your-cbcm-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #555;
    z-index: 10000;
    line-height: 1;
    padding: 5px;
}
.your-cbcm-close-button:hover {
    color: #000;
}

/* Menu inner content */
.your-cbcm-menu-inner {
    padding-top: 15px;
    overflow: visible; /* Ensure this area doesn't clip children either */
}

.your-cbcm-section {
    margin-bottom: 5px;
}

.your-cbcm-section h3 {
    font-size: 1.1em;
    margin-bottom: 3px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Brands section (removed actual content, keep the class if needed elsewhere but not active) */
.your-cbcm-brands {
    display: none; /* Hide the brand section completely */
}

/* Categories menu */
.your-cbcm-category-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    /* No position: relative; on this UL if the LI is handling it */
}

.your-cbcm-category-menu li {
    margin-bottom: 3px;
    position: relative; /* IMPORTANT: This makes the submenu positioned relative to its parent LI */
    /* Ensure no overflow: hidden on the LI itself */
}

.your-cbcm-category-menu li a {
    display: flex;
    align-items: flex-start; /* Changed to align items to the top for multi-line text */
    padding: 5px 5px; /* Adjust vertical padding for tighter spacing */
    color: #444;
    text-decoration: none;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
    font-size: 0.95em;
    line-height: 1.2; /* TIGHTER LINE HEIGHT for multi-line text */
    position: relative;
    padding-right: 25px; /* Space for arrow */

    /* Allow text to wrap for full category names */
    white-space: normal; /* Allow text to wrap to new lines */
    overflow-wrap: break-word; /* Break long words if necessary */
    word-break: break-word; /* Fallback for older browsers */
}

.your-cbcm-category-menu li.your-cbcm-has-children > a::after {
    content: '\203A'; /* Unicode right-pointing angle bracket */
    font-size: 1.2em;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease-in-out;
}

.your-cbcm-category-menu li a:hover {
    color: #0073aa;
    background-color: #f9f9f9;
}

.your-cbcm-category-menu li .category-menu-image {
    width: 35px;
    height: 35px;
    object-fit: contain;
    margin-right: 10px;
    border-radius: 3px;
    background-color: #f0f0f0;
    flex-shrink: 0; /* Prevent image from shrinking */
}

/* Submenu styling for "open to the right" */
.your-cbcm-category-menu ul.sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    position: absolute; /* Position sub-menu relative to parent LI */
    top: 0; /* Align top of submenu with top of parent LI */
    left: 100%; /* Position off to the right of the parent */
    /* width: 100%; /* Removing this to let min-width/content define width, or set a fixed value */
    background-color: #f9f9f9;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    visibility: visible;
    opacity: 0;
    transform: translateX(10px);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out, visibility 0.3s ease-out;
    z-index: 10002; /* Ensure submenus are on top */
    min-width: 350px; /* Adjust this to a suitable width for your submenus. Can be same as main menu or wider. */
    border-left: 1px solid #ddd;
    box-sizing: border-box;
}

/* For multi-level submenus, increase Z-index for each level to ensure proper stacking */
.your-cbcm-category-menu ul.sub-menu ul.sub-menu {
    z-index: 10003;
}
.your-cbcm-category-menu ul.sub-menu ul.sub-menu ul.sub-menu {
    z-index: 10004;
}
/* Add more as needed for deeper levels */


.your-cbcm-category-menu li.your-cbcm-has-children.open-submenu > ul.sub-menu {
    visibility: visible;
    opacity: 1;
    transform: translateX(0); /* Slide in from right */
}

/* Adjust padding for sub-menus */
.your-cbcm-category-menu ul.sub-menu li a {
    padding-left: 15px;
}
.your-cbcm-category-menu ul.sub-menu ul.sub-menu li a {
    padding-left: 30px;
}
.your-cbcm-category-menu ul.sub-menu ul.sub-menu ul.sub-menu li a {
    padding-left: 45px;
}

/* Shortcode button styling */
.your-cbcm-trigger-button {
    background-color: #0073aa;
    color: #fff;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.your-cbcm-trigger-button:hover {
    background-color: #005177;
}

/* Specific overrides for multi-line category names */
.your-cbcm-category-menu li a {
    white-space: normal; /* Allow wrapping */
    overflow: visible;   /* Ensure content is not hidden */
    text-overflow: clip; /* Ensure no ellipsis */
    overflow-wrap: break-word; /* For long words */
    word-break: break-word; /* Fallback for long words */
}