/* NewU Sorting Companion 1.1 — storefront presentation only.
   Scoped to WooCommerce sorting forms enhanced by frontend.js. */
form.woocommerce-ordering.newu-sort-form {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    float: none !important;
}

form.woocommerce-ordering.newu-sort-form .newu-sort-label {
    display: inline-block;
    flex: 0 0 auto;
    margin: 0;
    color: #a66d46;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    text-align: left;
    cursor: pointer;
}

/* Long labels never collide with the chevron or inherit Botiga's centring. */
form.woocommerce-ordering.newu-sort-form select.orderby {
    box-sizing: border-box !important;
    display: block !important;
    flex: 0 1 290px;
    min-width: 0;
    width: 290px !important;
    max-width: 100% !important;
    min-height: 48px;
    height: 48px;
    margin: 0 !important;
    padding: 9px 43px 9px 15px !important;
    border: 1px solid #ead5c7 !important;
    border-radius: 5px !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A66D46' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: 16px 16px !important;
    background-position: right 15px center !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    color: #a66d46 !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    text-align: left !important;
    text-align-last: left !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none !important;
}

form.woocommerce-ordering.newu-sort-form select.orderby:focus-visible {
    outline: 2px solid #a66d46 !important;
    outline-offset: 3px;
}

/* Botiga sometimes aligns the inner sorting wrapper or constrains its width. */
.newu-sorting-wrapper .botiga-sorting-right-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    max-width: 100%;
}

/* Tablet: leave more space for the longer sort label and selected option. */
@media (min-width: 768px) and (max-width: 1024px) {
    .newu-sorting-wrapper .botiga-sorting-left {
        flex: 0 0 35%;
        width: 35%;
        max-width: 35%;
    }
    .newu-sorting-wrapper .botiga-sorting-right {
        flex: 0 0 65%;
        width: 65%;
        max-width: 65%;
    }
    form.woocommerce-ordering.newu-sort-form select.orderby {
        flex-basis: 260px;
        width: 260px !important;
    }
}

/* Mobile: the sort label and full-width select occupy a clean second row. */
@media (max-width: 767px) {
    .newu-sorting-wrapper > .row {
        row-gap: 14px;
    }
    .newu-sorting-wrapper .botiga-sorting-left,
    .newu-sorting-wrapper .botiga-sorting-right {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }
    .newu-sorting-wrapper .botiga-sorting-right-inner {
        justify-content: stretch;
    }
    form.woocommerce-ordering.newu-sort-form {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 6px;
    }
    form.woocommerce-ordering.newu-sort-form .newu-sort-label {
        display: block;
        font-size: 14px;
    }
    form.woocommerce-ordering.newu-sort-form select.orderby {
        flex: 0 0 auto;
        width: 100% !important;
        min-width: 0;
        max-width: 100% !important;
        height: 48px;
        font-size: 16px !important;
    }
}
