/**
 * Reset all dropdown positioning to fix alignment issues
 * This must load LAST to override all previous rules
 */

/* Complete reset of all dropdowns */
#sp-header .sp-dropdown,
#sp-menu .sp-dropdown,
.sp-megamenu-wrapper .sp-dropdown,
.sp-dropdown.sp-dropdown-main,
.sp-dropdown.sp-menu-right,
.sp-dropdown {
    /* Critical positioning reset */
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: none !important;
    float: none !important;
    
    /* Display reset */
    display: none;
    opacity: 0;
    visibility: hidden;
    
    /* Width reset */
    width: auto !important;
    min-width: 220px !important;
    max-width: 400px !important;
    
    /* Style reset */
    background: #ffffff !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    border-radius: 4px !important;
    padding: 0 !important;
    overflow: visible !important;
    z-index: 99999 !important;
}

/* Menu items must be relative positioned */
#sp-menu .sp-megamenu-parent > li,
.sp-megamenu-parent > li {
    position: relative !important;
    display: inline-block !important;
}

/* Show dropdowns on hover */
#sp-menu .sp-megamenu-parent > li:hover > .sp-dropdown,
.sp-megamenu-parent > li:hover > .sp-dropdown {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Remove all table/flex displays that break positioning */
.sp-dropdown,
.sp-dropdown .sp-dropdown-inner,
.sp-dropdown ul {
    display: block !important;
}

/* Ensure consistent link styling */
.sp-dropdown a {
    display: block !important;
    padding: 12px 20px !important;
    white-space: nowrap !important;
    color: #333 !important;
    background: #fff !important;
    text-decoration: none !important;
    border-bottom: 1px solid #eee !important;
}

.sp-dropdown li:last-child a {
    border-bottom: none !important;
}

/* Width based on content */
.sp-dropdown {
    width: max-content !important;
}

/* Override ANY inline styles */
.sp-dropdown[style*="left"],
.sp-dropdown[style*="right"] {
    left: 0 !important;
    right: auto !important;
}