.custom-howden-wrapper {
    position: relative;
    width: 300px; /* Adjust width as needed */
    font-family: inherit;
}

/* Force Elementor popup containers to allow overflow so the side-by-side menu isn't clipped */
.dialog-widget-content,
.dialog-message {
    overflow: visible !important;
}

.custom-howden-menu,
.custom-howden-menu ul.sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 300px;
    background: #fff;
}

/* Absolute submenus will position relative to the main menu wrapper (or parent absolute submenu) */
.custom-howden-menu li.menu-item {
    position: static;
}

.custom-howden-menu a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    background: #fff;
    transition: background 0.2s ease;
}

.custom-howden-menu a:hover,
.custom-howden-menu a:focus,
.custom-howden-menu li.menu-item-has-children.active > a {
    background: #f5f5f5;
}

/* Add a right-pointing arrow for items with children */
.custom-howden-menu li.menu-item-has-children > a::after {
    content: "→"; /* Rightwards arrow */
    font-size: 18px;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

/* Submenu positioning - flies out to the RIGHT */
.custom-howden-menu ul.sub-menu {
    position: absolute;
    top: 0;
    left: 100%; /* Pushes the submenu directly to the right of its parent */
    height: 100%;
    min-height: 100vh; /* Assumes full-height right-aligned popup */
    box-shadow: 5px 0 15px rgba(0,0,0,0.05); /* Shadow shifted to the right */
    z-index: 10;
    
    /* Hidden by default with slide animation */
    visibility: hidden;
    opacity: 0;
    transform: translateX(-20px); /* Start slightly to the left */
    transition: all 0.3s ease;
}

/* Active state toggled via JS */
.custom-howden-menu li.menu-item-has-children.active > ul.sub-menu {
    visibility: visible;
    opacity: 1;
    transform: translateX(0); /* Slide into place */
}
