/**
 * Search + Woodmart header compatibility
 * Keep CPC search usable in WHB / Elementor header without breaking theme search.
 */

/* Clearfix for CPC search results containers only */
.cpc-search-results::after {
    content: "";
    display: table;
    clear: both;
}

/*
 * Woodmart Header Builder (WHB) / theme header:
 * Never apply CPC layout pull-hacks (negative margins / expanded width) inside header.
 */
.whb-header .cpc-search-form-wrapper,
.whb-main-header .cpc-search-form-wrapper,
.whb-general-header .cpc-search-form-wrapper,
.wd-header .cpc-search-form-wrapper,
.woodmart-header .cpc-search-form-wrapper,
header.whb-header .cpc-search-form-wrapper,
.site-header .cpc-search-form-wrapper,
.wd-header-main .cpc-search-form-wrapper,
.whb-row .cpc-search-form-wrapper,
.whb-column .cpc-search-form-wrapper {
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.whb-header .cpc-search-form,
.whb-main-header .cpc-search-form,
.wd-header .cpc-search-form,
.woodmart-header .cpc-search-form,
.site-header .cpc-search-form,
.whb-row .cpc-search-form {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Do not style Woodmart native search — selectors listed only as documentation boundary.
 * CPC rules must always start with .cpc-search-* and never target .wd-search-* / .searchform.
 */

/* Suggestions dropdown must not escape under sticky WHB incorrectly */
.whb-header .cpc-search-suggestions,
.wd-header .cpc-search-suggestions,
.site-header .cpc-search-suggestions {
    z-index: 10050 !important;
}

/* Mobile: cancel CPC content-area pull inside header only */
@media (max-width: 768px) {
    .whb-header .cpc-search-form-wrapper[dir="rtl"],
    .whb-header .cpc-search-form-wrapper[dir="ltr"],
    .whb-main-header .cpc-search-form-wrapper[dir="rtl"],
    .whb-main-header .cpc-search-form-wrapper[dir="ltr"],
    .wd-header .cpc-search-form-wrapper[dir="rtl"],
    .wd-header .cpc-search-form-wrapper[dir="ltr"],
    .site-header .cpc-search-form-wrapper[dir="rtl"],
    .site-header .cpc-search-form-wrapper[dir="ltr"],
    .whb-row .cpc-search-form-wrapper[dir="rtl"],
    .whb-row .cpc-search-form-wrapper[dir="ltr"] {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}
