/**
 * Ellaroza Shop Flow - compact catalog controls and filtered empty state.
 */

/* The replacement is assembled by the tiny deferred catalog script. Keep the
   original Elementor sentence out of the first paint so it cannot flash. */
#srch-rslts-ella .elementor-products-nothing-found {
    visibility: hidden;
}

/* Reserve the catalog result area before the deferred empty-state script runs.
   Normal product grids are already taller than this, while empty archives no
   longer let the footer paint halfway up the page and then jump downward. */
#srch-rslts-ella {
    box-sizing: border-box;
    min-height: 280px;
}

/* Hide controls that cannot help before the script adds its convenience body
   class. :has() lets modern storefront browsers apply this during first paint. */
body:has(#srch-rslts-ella .elementor-products-nothing-found) #actv-fltrs-ella,
body:has(#srch-rslts-ella .elementor-products-nothing-found) #fltrs-ella-icn,
body:has(#srch-rslts-ella .elementor-products-nothing-found) .elementor-element-82a77ea,
body:has(#srch-rslts-ella .elementor-products-nothing-found) #srch-rslts-ella .woocommerce-ordering {
    display: none !important;
}

/* Keep the normal filter and sort controls aligned above the product grid. */
@media (min-width: 769px) {
    .elementor-1440 .elementor-element.elementor-element-82a77ea {
        z-index: 3;
        min-height: 35px;
        margin: 18px 0 -39px !important;
    }

    .elementor-1440 .elementor-element.elementor-element-82a77ea .elementor-button {
        display: inline-flex;
        align-items: center;
        min-height: 35px;
        padding: 6px 12px;
        border: 1px solid #E3E3E3;
        border-radius: 8px;
        background: #FFFFFF;
        color: #1A1A1A;
        line-height: 1;
        box-shadow: none;
    }

    .elementor-1440 .elementor-element.elementor-element-82a77ea .elementor-button-icon,
    .elementor-1440 .elementor-element.elementor-element-82a77ea .elementor-button-icon svg {
        display: block;
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 768px) {
    .elementor-1440 .elementor-element.elementor-element-82a77ea {
        z-index: 3;
        min-height: 44px;
        margin: 8px 0 -52px !important;
    }

    .elementor-1440 .elementor-element.elementor-element-82a77ea .elementor-button {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 8px 13px;
        border: 1px solid #E3E3E3;
        border-radius: 8px;
        background: #FFFFFF;
        color: #1A1A1A;
        line-height: 1;
        box-shadow: none;
    }

    .elementor-1440 .elementor-element.elementor-element-82a77ea .elementor-button-icon,
    .elementor-1440 .elementor-element.elementor-element-82a77ea .elementor-button-icon svg {
        display: block;
        width: 15px;
        height: 15px;
    }

    #srch-rslts-ella .woocommerce-ordering {
        position: relative;
        float: left;
        width: 44px;
        height: 44px;
        margin: 8px 0 14px !important;
        border: 1px solid #E3E3E3;
        border-radius: 8px;
        background: #FFFFFF;
        line-height: 1;
    }

    #srch-rslts-ella .woocommerce-ordering select {
        position: absolute;
        inset: 0;
        z-index: 2;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        opacity: 0;
        cursor: pointer;
    }

    #srch-rslts-ella .woocommerce-ordering::after {
        inset: 0;
        font-size: 22px;
        line-height: 44px;
        color: #6B728E;
    }

    #srch-rslts-ella ul.products {
        clear: both;
    }
}

/* A reset is more useful than opening filters when no product can be shown. */
body.ellaroza-catalog-empty #actv-fltrs-ella,
body.ellaroza-catalog-empty #fltrs-ella-icn,
body.ellaroza-catalog-empty .elementor-element-82a77ea,
body.ellaroza-catalog-empty #srch-rslts-ella .woocommerce-ordering {
    display: none !important;
}

body.ellaroza-catalog-empty #srch-rslts-ella {
    min-height: 280px;
    padding: 18px 0 44px;
}

body.ellaroza-catalog-empty #srch-rslts-ella .elementor-products-nothing-found {
    box-sizing: border-box;
    width: calc(100% - 40px);
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 22px;
    border: 1px solid #E3E3E3;
    border-left: 5px solid #8ACCD5;
    border-radius: 10px;
    background: #FFFFFF;
    color: #1A1A1A;
    line-height: 1.8;
    text-align: center;
    visibility: visible;
    box-shadow: 0 10px 28px rgba(26, 26, 26, 0.06);
}

.ellaroza-catalog-empty-title,
.ellaroza-catalog-empty-copy {
    margin: 0;
}

.ellaroza-catalog-empty-title {
    font-size: 16px;
    font-weight: 600;
}

.ellaroza-catalog-empty-copy {
    margin-top: 4px;
    color: #6B728E;
    font-size: 13px;
}

.ellaroza-reset-filters,
.ellaroza-reset-filters:link,
.ellaroza-reset-filters:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-top: 16px;
    padding: 7px 18px;
    border: 1px solid #F198B3;
    border-radius: 6px;
    background: #F198B3;
    color: #FFFFFF;
    -webkit-text-fill-color: #FFFFFF;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    box-shadow: none;
}

.ellaroza-reset-filters:hover,
.ellaroza-reset-filters:focus,
.ellaroza-reset-filters:active {
    border-color: #FF90BB;
    background: #FF90BB;
    color: #FFFFFF;
    -webkit-text-fill-color: #FFFFFF;
    text-decoration: none;
}

.ellaroza-reset-filters:focus-visible {
    outline: 2px solid #8ACCD5;
    outline-offset: 3px;
}

@media (max-width: 600px) {
    body.ellaroza-catalog-empty #srch-rslts-ella {
        min-height: 280px;
        padding-top: 12px;
    }

    body.ellaroza-catalog-empty #srch-rslts-ella .elementor-products-nothing-found {
        padding: 22px 16px;
    }
}
