/* PLP and search page */

/* pagination Arabic */
html[lang="ar"]{
    commerce_search-paging-control button.nav-direction{
        transform: rotate(180deg) !important;
    }
}

/* filters */
commerce_builder-search-results-layout section.left-container{
    margin-top: 8px !important;
}
commerce-search-filters{
    .filters-header{
        color: var(--dxp-g-brand) !important;
        font-size: var(--c-b2bFontSize14) !important;
        font-weight: var(--c-b2bModalWeightBold) !important;
    }
    .clear-button{
        display: none;
    }
    .categories-section{
        display: none !important;
    }
    .search-filters-selected-section{
        display: none !important;
    }
}
commerce_builder-search-results-layout .category-header{
    padding: 0 !important;
}
html[lang="ar"] commerce_builder-search-results-layout .header-container{
    margin-left: 0 !important;
}
commerce-search-filters-panel-section{
    .section-header h3 {
        color: var(--c-b2bColorAlmostBlack) !important;
        font-size: var(--c-b2bDefaultFontSize) !important;
        font-weight: var(--c-b2bModalWeightBold) !important;
    }
    .section-style{
        border-bottom: 1px dashed #bcc3c3 !important;
        padding-bottom: 27px !important;
        padding-top: 27px !important;
    }
} 
/* results count */
.search-header h4{
    color: #3e3e3e !important;
    font-size: var(--c-b2bFontSize12) !important;
    font-size: var(--c-b2bFontWeightBold) !important;
}
.sort-menu-dropdown p{
    color: var(--c-b2bColorGray300) !important;
    font-size: var(--c-b2bFontSize14) !important;
}
commerce_search-sort-menu button{
    color: #2d2926 !important;
    font-weight: var(--c-b2bModalWeightBold) !important;
    font-size: var(--c-b2bFontSize14) !important;
}
/* product tile */
commerce-search-results{
    li section{
        width: 300px;
        height: 426px;
        margin: 4px !important;
        border-width: 1px !important;
        border-color: var(--c-b2bColorWhite) !important;
    }
    li section:hover{
        border-color: #D5DAE6 !important;
        border-width: 1px !important;
    }
    li commerce_search-product-card section.cardContainerGrid{
        box-shadow: 0 0 4px #0000002e !important;
        border-radius: 6px !important;
    }
}
commerce_search-product-card{
    section:hover .callToActionButton button{
        background-color: var(--dxp-g-brand) !important; 
        color: var(--c-b2bColorWhite) !important; 
    }
    .fieldsArea a:hover{
        text-decoration: none !important;
    }
    .imageArea{
        margin-bottom: 28px !important;
        margin-top: 16px !important;
    }
    .imageArea img{
        height: 155px;
        width: 257px;
    }
    .priceArea{
        justify-self: left !important;
        min-height: 33px;
        margin-top: -16px;
    }
    commerce_search-product-field .slds-text-heading_medium{
        font-size: var(--c-b2bFontSize18) !important;
        font-weight: var(--c-b2bModalWeightBold) !important;
        margin-bottom: 0 !important;
        height: 50px;
        overflow: hidden;
        text-overflow: unset;
        white-space: normal !important;
    }
    commerce_search-product-field .slds-text-heading_small{
        font-size: var(--c-b2bFontSize14) !important;
        line-height: 16px !important;
        margin-bottom: 8px !important;
        justify-self: left !important;
        overflow: visible !important;
        text-overflow: unset !important;
        white-space: normal !important;
    }
    .callToActionArea,  .quantitySelectorContainer, commerce-action-button{
        width: 100% !important;
    }
    .callToActionArea{
        margin-bottom: 2rem !important;
    }
}
html[lang="ar"] commerce_search-product-card commerce_search-product-field .slds-text-heading_small{
    width: 100%;
}

/* quantity selector */
html[lang="ar"] commerce_search-product-card commerce-quantity-selector{
    margin-left: 16px !important;
}
commerce_search-product-card{
    .quantitySelectorContainer{
        flex-direction: row !important;
    }
    commerce-quantity-selector-popover{
        display: none !important;
    }
    commerce-quantity-selector commerce-number-input button, 
    commerce-quantity-selector commerce-number-input input{
        height: 33px !important;
        min-height: 33px !important;
        border: none !important;
        font-size: var(--c-b2bFontSize14) !important;
        background-color: var(--c-b2bColorLightGray) !important;
    }
    commerce-quantity-selector{
        margin-top: 8px !important;
        margin-right: 8px;
    }
    commerce-quantity-selector .slds-grid{
        height: 33px !important;
        min-height: 33px !important;
    }
    commerce-quantity-selector .number-input__decrement-button{
        padding: 16px !important;
        border-top-right-radius: 5px !important;
        border-bottom-right-radius: 5px !important;
    }
    commerce-quantity-selector .number-input__increment-button{
        padding: 16px !important;
        border-top-left-radius: 5px !important;
        border-bottom-left-radius: 5px !important;
    }
    commerce-quantity-selector input{
        width: 50px !important;
    }
    commerce-quantity-selector lightning-icon svg{
        fill: var(--dxp-g-brand) !important;
    }
}
commerce-search-results .cardContainerGrid{
    background-color: var(--c-b2bColorWhite) !important;
}
commerce_search-product-grid{
    .callToActionButton button{
        background-color: var(--dxp-g-brand) !important;
        width: 100% !important;
        height: 33px !important;
        border: none !important;
        padding: 8px !important;
        cursor: pointer !important;
        margin-top: 2px !important;
        font-size: 0px !important;
    }
    .callToActionButton button.disabled{
        opacity: 0.4;
    }
}
@media only screen and (max-width: 400px) {
    commerce_search-product-grid{
        .callToActionButton button {
            padding: 4px !important;
        }
    }
}

/* prices */
commerce_search-product-card{
    .priceArea{
        width: 100% !important;
    }
    commerce-product-pricing{
        width: 100% !important;
    }
}

/* mobile styles */
@media only screen and (max-width: 768px) {
    commerce_search-product-card{
        commerce-quantity-selector{
            margin-left: 8px;
            margin-top: 8px !important;
            margin-right: 8px;
        }
        commerce-action-button{
            margin-top: 2px;
        }
        commerce-product-pricing .price-container:has(.original-price) {
            margin-top: 16px !important;
        }
        commerce-product-pricing .price-container:has(.original-price) .price-col{
            order: 2 !important;
            position: absolute !important;
            right: 0 !important;
        }        
        commerce-product-pricing .price-container:has(.original-price) .price-col:first-of-type {
            order: 1 !important;
            position: absolute !important;
            left: 0 !important;
        }
        commerce-product-pricing .price-container:has(.original-price) .price-col:first-of-type lightning-formatted-number,
        commerce-product-pricing .price-container .negotiated-price{
            font-size: var(--c-b2bFontSize10) !important;
        }
        commerce-quantity-selector{
            margin-left: 16px !important;
        }
        .number-input__input{
            width: 40px !important;
        }
        commerce-action-button{
            margin-top: 0 !important;
        }
    }
    html[lang="ar"]{
        commerce_search-product-card{
            commerce-quantity-selector{
                margin-right: 0px !important;
            }
        }
    }
}
/* pricing */ 
commerce_search-product-card{
    commerce-product-pricing .price-container:has(.original-price) {
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
    }
    commerce-product-pricing .price-container:has(.original-price) .price-col:first-of-type {
        order: 2 !important;
        position: absolute !important;
        right: 0 !important;
    }
    commerce-product-pricing .price-container:has(.original-price) .price-col:first-of-type lightning-formatted-number {
        color: var(--c-b2bColorGray400) !important;
        font-weight: normal !important;
    }
}
html[lang="ar"] commerce_search-product-card commerce-product-pricing .price-container:has(.original-price) .price-col:first-of-type {
    left: 0 !important;
    right: auto !important;
}

/* quantity selector label */
commerce_search-product-card commerce-number-input label{
    display: none !important;
}

/* mobile styles */
@media only screen and (max-width: 768px) {
    /* filters*/
    commerce_builder-search-sort-menu .slds-grid{
        border: var(--c-b2bColorGray100) 1px solid;
        padding: 16px;
        color: #3E3E3E;
        font-weight: var(--c-b2bModalWeightBold);
        font-size: var(--c-b2bDefaultFontSize);
    }
    commerce_builder-search-results-layout .search-header{
        display: none !important;
    }
    commerce-search-results{
        li{
            width: 160px !important;
        }
        li section{
            width: 160px !important;
            height: 360px !important; 
            padding: 8px !important;
        }
        .cardContainerGrid{
            padding-bottom: 16px;
            border-radius: 6px !important;
            display: block !important;
        }
    }
    html[lang="ar"]{
        .logged-user-product-grid commerce-search-results li section{
            height: 360px !important; 
        }
        .guest-user-product-grid commerce-search-results li section{
            height: 235px !important; 
        }
        commerce_search-product-field .slds-text-heading_small {
            justify-self: center !important;
            color: var(--c-b2bColorGray300) !important;
            font-size: 11px !important;
            line-height: 11px !important;
            text-align: center !important;
            min-height: 35px !important;
        }
        commerce_search-product-card .callToActionArea{
            margin-top: 0 !important;
        }
    }
    commerce_search-product-card{
        .imageArea img{
            height: 72px !important;
        }
        commerce_search-product-field .slds-text-heading_medium{
            font-size: var(--c-b2bDefaultFontSize) !important;
            margin-bottom: 0 !important;
            height: 75px !important;
        }
        commerce_search-product-field .slds-text-heading_small {
            min-height: 55px !important;
            justify-self: center !important;
            color: var(--c-b2bColorGray300) !important;
            font-size: 11px !important;
            line-height: 11px !important;
            text-align: center !important;
        }
        commerce_search-product-field:has(lightning-formatted-rich-text[title="Excluding VAT"]),
        commerce_search-product-field:has(lightning-formatted-rich-text[title="غير شامل الضريبة"]){
            margin-top: -24px !important;
        }

        .priceArea{
            min-height: 32px !important;
            justify-self: center !important;
            width: 100% !important;
            justify-content: center !important;
        }
        .callToActionArea{
            margin-top: 16px;
        }
        .callToActionButton button{
            width: 40px;
        }
        .callToActionButton {
            height: 35px;
        }
    }
    commerce_search-product-field .slds-text-heading_medium{
        text-align: center;
    }
    commerce-product-pricing lightning-formatted-number{
        font-size: var(--c-b2bFontSize12) !important;
        color: var(--c-b2bColorBlue) !important;
    }
    commerce-number-input .slds-grid{
        margin-left: -4px !important;
    }
    commerce_search-product-card{
        commerce-quantity-selector button{
            padding: 0 !important;
            height: 16px !important;
            width: 16px !important;
        }
        commerce-quantity-selector input{
            width: 60px !important;
        }
        commerce_search-product-card commerce-action-button .slds-button.slds-button_outline-brand{
            width: 40px !important;
        }
    }
}

/* Guest user grid */
.guest-user-product-grid{
    commerce_search-product-grid{
        commerce_search-product-card commerce-action-button .slds-button,
        commerce_search-product-card commerce-action-link .slds-button.slds-button_brand{
            content: none !important;
            background-color: var(--c-b2bColorWhite) !important;
            border: 1px solid var(--c-b2bColorBlue) !important;
            color: var(--c-b2bColorBlue) !important;
            font-size: 14px !important;
            cursor: pointer !important;
        }
        commerce_search-product-card commerce-action-link .slds-button,
        commerce_search-product-card commerce-action-link .slds-button.slds-button_brand{
            width: 275px !important;
            height: 33px !important;
            margin-top: 2px !important;
        }
    }
    commerce-search-results{
        li section{
            height: 345px !important;
        }
        li section:hover .slds-button{
            background-color: var(--c-b2bColorBlue) !important;
            border: 1px solid var(--c-b2bColorBlue) !important;
            color: var(--c-b2bColorWhite) !important;
        }
    }
    commerce-action-button{
        width: 275px !important;
    }
    commerce_search-product-card{
        .priceArea{
            min-height: 0px !important;        
        }
    }
    commerce_search-product-card commerce_search-product-field .slds-text-heading_large{
        top: -257px !important;
    }
}
@media only screen and (max-width: 768px) {
    .guest-user-product-grid {
        commerce_search-product-grid{
            commerce_search-product-card commerce-action-button{
                display: none !important;
            }
        }
        commerce-search-results{
            li section{
                height: 245px !important;
            }
        }
        commerce_search-product-card commerce_search-product-field .slds-text-heading_large{
            top: -207px !important;
        }
    }
}

/* Badges*/
commerce_search-product-card commerce_search-product-field{
    position: relative !important;
}
commerce_search-product-card commerce_search-product-field .slds-text-heading_large{
    position: absolute;
    top: -257px;
    right: 0;
    background-color: var(--c-b2bColorRed400);
    border-end-start-radius: 13px;
    border-end-end-radius: 13px;
    color: var(--c-b2bColorWhite) !important;
    font-family: 'bebas' !important;
    font-weight: var(--c-b2bFontWeightBold) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 7px !important;
    font-size: 16px;
}

@media only screen and (max-width: 768px) {
    commerce_search-product-card commerce_search-product-field .slds-text-heading_large{
        top: -208px;
    }
    commerce_search-product-card .fieldsArea{
        height: 132px !important;
    }  
    .quantitySelectorContainer commerce-quantity-selector{
        margin-left: 8px !important;
    }
    html[lang="ar"]{
        commerce_search-product-card .fieldsArea{
            height: 120px !important;
        }  
        commerce_search-product-card .fieldsArea{
            height: 150px !important;
        }   
    }
}


/* Inventory */
commerce_search-product-card .fieldsArea div[style="color: rgb(255, 255, 255);"]{
    position: absolute !important;
    bottom: -100px !important;
    font-size: 14px !important;
    font-weight: var(--c-b2bFontWeightMedium) !important;
    width: 100% !important;
}

 @media only screen and (max-width: 768px) {
    commerce_search-product-card .fieldsArea div[style="color: rgb(255, 255, 255);"]{
        font-size: 11px !important;
        bottom: -92px !important;
    }
    html[lang="ar"]{
        commerce_search-product-card .fieldsArea div[style="color: rgb(255, 255, 255);"]{
            bottom: -86px !important;
        }
    }
}

/* Make possible for the user to select the SKU and product name */
commerce_search-product-card a{
    pointer-events: none !important;
    user-select: none !important;
}
commerce_search-product-card span{
    pointer-events: auto !important;
    user-select: text !important;
}