/* Khair Al Watan catalog commerce UI — v2.7.1 visual refinement */

/* --- Country badge in Bevesi product cards --- */
.product .product-thumbnail-wrapper .product-buttons .product-button.kaw-origin-flag .kaw-origin-flag-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:1.82rem;
    height:1.82rem;
    border-radius:999px;
    overflow:hidden;
    background:#fff;
    border:1px solid rgba(15,39,73,.12);
    box-shadow:0 2px 8px rgba(15,39,73,.10);
    cursor:default;
}
.product .product-thumbnail-wrapper .product-buttons .product-button.kaw-origin-flag .kaw-flag-emoji{
    display:flex;
    align-items:center;
    justify-content:center;
    width:1.25rem;
    height:1.25rem;
    font-size:.98rem;
    line-height:1;
    overflow:hidden;
    border-radius:999px;
}
@media screen and (min-width:576.1px){
    .product .product-thumbnail-wrapper .product-buttons .product-button.kaw-origin-flag .kaw-origin-flag-button{
        width:1.95rem;
        height:1.95rem;
    }
    /* Bevesi originally animates three tools. Keep a fourth tool smooth as well. */
    .products .product .product-thumbnail-wrapper .product-buttons > .product-button:not(:first-child){
        transform:translateX(6px);
        opacity:0;
        visibility:hidden;
    }
    .products .product:hover .product-thumbnail-wrapper .product-buttons > .product-button{
        transform:translateX(0)!important;
        opacity:1!important;
        visibility:visible!important;
    }
}

/* --- Country of manufacture beside wishlist / compare --- */
.single-product-wrapper .single-product-buttons .kaw-origin-single{
    display:inline-flex;
    align-items:center;
    gap:.38rem;
    min-height:2rem;
    padding:.18rem .55rem .18rem .24rem;
    border:1px solid #e5e9ee;
    border-radius:999px;
    background:#f8fafb;
    color:#334155;
    font-size:.79rem;
    font-weight:600;
    line-height:1;
    white-space:nowrap;
}
.kaw-origin-single-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:1.52rem;
    height:1.52rem;
    border-radius:999px;
    overflow:hidden;
    border:1px solid #e2e8f0;
    background:#fff;
    flex:0 0 1.52rem;
}
.kaw-origin-single-badge .kaw-flag-emoji{
    display:flex;
    align-items:center;
    justify-content:center;
    width:1.02rem;
    height:1.02rem;
    overflow:hidden;
    border-radius:999px;
    font-size:.82rem;
    line-height:1;
}
.kaw-origin-single-text{
    max-width:8.5rem;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* --- Piece / carton selector: compact full-width row --- */
.single-product-wrapper form.cart .kaw-unit-selector{
    flex:1 0 100%!important;
    width:100%!important;
    max-width:none!important;
    box-sizing:border-box!important;
    margin:3px 0 7px!important;
    padding:10px!important;
    border:1px solid #e0e7ec!important;
    border-radius:10px!important;
    background:#fbfcfd!important;
}
.kaw-unit-selector-title{
    margin:0 0 7px;
    font-size:.78rem;
    font-weight:750;
    color:#0f2749;
    line-height:1.35;
}
.kaw-unit-options{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
}
.kaw-unit-options .kaw-unit-option{
    appearance:none;
    -webkit-appearance:none;
    min-width:0;
    min-height:48px;
    margin:0;
    padding:8px 10px;
    border:1px solid #d5dee5;
    border-radius:8px;
    background:#fff;
    color:#0f2749;
    display:flex;
    flex-direction:row;
    justify-content:space-between;
    align-items:center;
    gap:8px;
    cursor:pointer;
    text-align:start;
    box-shadow:none;
    transition:border-color .15s ease,box-shadow .15s ease,background .15s ease,transform .15s ease;
}
.kaw-unit-options .kaw-unit-option:hover:not(:disabled):not(.is-disabled){
    border-color:#00aba7;
    background:#fff;
}
.kaw-unit-options .kaw-unit-option.is-active{
    border-color:#00aba7;
    background:#f2fbfa;
    box-shadow:0 0 0 2px rgba(0,171,167,.08);
}
.kaw-unit-options .kaw-unit-option.is-disabled,
.kaw-unit-options .kaw-unit-option:disabled{
    opacity:1;
    cursor:not-allowed;
    border-color:#e5e9ed;
    background:#f6f8f9;
    color:#9aa5af;
}
.kaw-unit-option-name{
    min-width:0;
    font-size:.83rem;
    font-weight:750;
    line-height:1.25;
    color:inherit;
}
.kaw-unit-option-name small{
    font-size:.67rem;
    font-weight:550;
    color:#788692;
}
.kaw-unit-option-price{
    flex:0 0 auto;
    font-size:.82rem;
    font-weight:800;
    line-height:1.15;
    color:#0aa34f;
    white-space:nowrap;
}
.kaw-unit-option-status{
    flex:0 0 auto;
    font-size:.68rem;
    font-weight:700;
    color:#9aa5af;
    white-space:nowrap;
}
/* The chosen unit and price already appear in the active option. Avoid duplicate rows. */
.kaw-unit-selection-info,
.kaw-unit-stock-note{
    display:none!important;
}

/* --- Quantity + CTA row --- */
.single-product-wrapper form.cart.kaw-unit-cart-form{
    align-items:flex-end!important;
    gap:8px!important;
}
.kaw-quantity-group{
    flex:0 0 auto;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:5px;
    min-width:112px;
}
.kaw-qty-ui-label{
    display:block;
    font-size:.7rem;
    font-weight:600;
    line-height:1.2;
    color:#6b7785;
    text-align:start;
    white-space:nowrap;
}
.single-product-wrapper form.cart.kaw-unit-cart-form .kaw-quantity-group .quantity{
    margin:0!important;
    min-width:112px;
    height:44px!important;
    border-color:#cfd8df!important;
    border-radius:8px!important;
    background:#fff!important;
}
.single-product-wrapper form.cart.kaw-unit-cart-form .kaw-quantity-group .quantity .quantity-button{
    min-height:42px!important;
}
.single-product-wrapper form.cart.kaw-unit-cart-form .kaw-quantity-group .quantity .qty{
    height:42px!important;
}
.single-product-wrapper form.cart.kaw-unit-cart-form .single_add_to_cart_button,
.single-product-wrapper form.cart.kaw-unit-cart-form .single_buy_now_button,
.single-product-wrapper form.cart.kaw-unit-cart-form .buy_now_button{
    min-height:44px!important;
    height:44px!important;
    margin-top:0!important;
    border-radius:8px!important;
}
.single-product-wrapper form.cart.kaw-unit-cart-form .single_add_to_cart_button{
    flex:1 1 180px!important;
}
.single-product-wrapper form.cart.kaw-unit-cart-form .single_buy_now_button,
.single-product-wrapper form.cart.kaw-unit-cart-form .buy_now_button{
    flex:1 1 150px!important;
    width:auto!important;
}

@media (max-width:700px){
    .single-product-wrapper form.cart .kaw-unit-selector{
        padding:9px!important;
    }
    .kaw-unit-options{
        grid-template-columns:1fr 1fr;
        gap:6px;
    }
    .kaw-unit-options .kaw-unit-option{
        min-height:52px;
        padding:7px 8px;
        flex-direction:column;
        align-items:flex-start;
        justify-content:center;
        gap:3px;
    }
    .kaw-unit-option-status{white-space:normal;}
    .kaw-origin-single-text{max-width:6.5rem;}
}

@media (max-width:480px){
    .single-product-wrapper form.cart.kaw-unit-cart-form{
        gap:7px!important;
    }
    .kaw-quantity-group{
        flex:0 0 108px;
        min-width:108px;
    }
    .single-product-wrapper form.cart.kaw-unit-cart-form .kaw-quantity-group .quantity{
        min-width:108px;
    }
    .single-product-wrapper form.cart.kaw-unit-cart-form .single_add_to_cart_button{
        flex:1 1 calc(100% - 116px)!important;
    }
    .single-product-wrapper form.cart.kaw-unit-cart-form .single_buy_now_button,
    .single-product-wrapper form.cart.kaw-unit-cart-form .buy_now_button{
        flex:1 0 100%!important;
        width:100%!important;
    }
}
