/**
 * AKM Submenu Position Fix
 * Forces ALL submenus to open to the right side
 * Overrides all conflicting styles with maximum specificity
 */

/* FIRST LEVEL DROPDOWN - Should open below (this is OK) */
.akm-nav-item > .akm-simple-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    /* This level is OK to open downward */
}

/* SECOND LEVEL (inside mega menu dropdowns) - Must open to the RIGHT */
.akm-dropdown-item > .akm-simple-dropdown,
.akm-mega-menu .akm-dropdown-item > .akm-simple-dropdown,
.akm-mega-categories .akm-dropdown-item > .akm-simple-dropdown {
    position: absolute !important;
    top: -5px !important; /* Align with parent item */
    left: 100% !important; /* Open to the RIGHT */
    margin-left: 5px !important;
    transform: translateX(-10px) !important;
    transition: all 0.3s ease !important;
}

/* THIRD LEVEL - Must open to the RIGHT */
.akm-sub-dropdown,
.akm-dropdown-item .akm-sub-dropdown,
.akm-simple-dropdown .akm-sub-dropdown {
    position: absolute !important;
    top: -5px !important;
    left: 100% !important;
    margin-left: 5px !important;
    transform: translateX(-10px) !important;
    transition: all 0.3s ease !important;
}

/* FOURTH LEVEL - Must open to the RIGHT */
.akm-sub-sub-dropdown,
.akm-sub-dropdown-item .akm-sub-sub-dropdown {
    position: absolute !important;
    top: -5px !important;
    left: 100% !important;
    margin-left: 5px !important;
    transform: translateX(-10px) !important;
    transition: all 0.3s ease !important;
}

/* Hover states - slide in from left */
.akm-dropdown-item:hover > .akm-simple-dropdown,
.akm-dropdown-item:hover > .akm-sub-dropdown,
.akm-sub-dropdown-item:hover > .akm-sub-sub-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
}

/* Make sure nested dropdowns within mega menu open sideways */
.akm-mega-menu .has-children > .akm-simple-dropdown,
.akm-mega-menu .akm-dropdown-item.has-children > .akm-simple-dropdown {
    position: absolute !important;
    top: -5px !important;
    left: 100% !important;
    margin-left: 5px !important;
}

/* Override any transform that makes it go down */
.akm-mega-menu .akm-simple-dropdown,
.akm-mega-menu .akm-sub-dropdown,
.akm-mega-menu .akm-sub-sub-dropdown {
    transform-origin: left center !important;
}

/* Remove any translateY that pushes menus down */
.has-children:hover .akm-simple-dropdown:not(.akm-nav-item > .akm-simple-dropdown) {
    transform: translateX(0) !important; /* Only X axis animation */
}

/* Ensure proper z-index stacking */
.akm-simple-dropdown {
    z-index: 1000000 !important;
}
.akm-sub-dropdown {
    z-index: 1000001 !important;
}
.akm-sub-sub-dropdown {
    z-index: 1000002 !important;
}

/* Visual indicator for nested items */
.akm-dropdown-item.has-children::after,
.akm-sub-dropdown-item.has-children::after {
    content: '▶' !important;
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 10px !important;
    opacity: 0.6 !important;
}

/* Hover bridge for smooth navigation */
.akm-dropdown-item.has-children::before,
.akm-sub-dropdown-item.has-children::before {
    content: '' !important;
    position: absolute !important;
    right: -10px !important;
    top: 0 !important;
    width: 10px !important;
    height: 100% !important;
    z-index: 999999 !important;
}