/**
 * WooBrand Widget Fixes
 * Prevents sidebar from disappearing and ensures proper widget positioning
 */

/* Widget container fixes */
.widget.woocommerce.woocommerce_brand_nav,
.widget.woocommerce_brand_nav,
.widget_woocommerce_brand_nav {
    position: relative !important;
    width: 100% !important;
    display: block !important;
    clear: both !important;
    margin-bottom: 20px !important;
    float: none !important;
    overflow: visible !important;
}

/* Wrapper fixes */
.woo-brand-widget-wrapper {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    clear: both !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* Select element fixes */
.widget.woocommerce_brand_nav select,
.woo-brand-widget-wrapper select {
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* msDropdown fixes */
.widget .dd,
.widget .ddcommon,
.woo-brand-widget-wrapper .dd,
.woo-brand-widget-wrapper .ddcommon {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    float: none !important;
    clear: both !important;
    box-sizing: border-box !important;
}

.widget .dd .ddTitle,
.woo-brand-widget-wrapper .dd .ddTitle {
    width: 100% !important;
    box-sizing: border-box !important;
}

.widget .dd .ddChild,
.woo-brand-widget-wrapper .dd .ddChild {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    left: 0 !important;
    right: auto !important;
}

/* Prevent absolute positioning conflicts */
.widget .dd,
.woo-brand-widget-wrapper .dd {
    position: relative !important;
    z-index: 1 !important;
}

/* Ensure dropdown list stays within widget */
.widget .dd .ddChild {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    max-height: 300px !important;
    overflow-y: auto !important;
}

/* Sidebar specific fixes */
.sidebar .widget.woocommerce_brand_nav,
aside .widget.woocommerce_brand_nav,
.widget-area .widget.woocommerce_brand_nav {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    position: relative !important;
}

/* Clear floats after widget */
.widget.woocommerce_brand_nav::after,
.woo-brand-widget-wrapper::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
}

/* Responsive fixes */
@media (max-width: 768px) {
    .widget.woocommerce_brand_nav,
    .woo-brand-widget-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .widget .dd,
    .widget .ddcommon {
        width: 100% !important;
        max-width: 100% !important;
    }
}
