/**
 * coveoGlobalCSS.css
 * Purpose: Global Coveo styles served via Salesforce Static Resource
 * Scope: Component-agnostic CSS variables and overrides for Coveo product listing components
 * 
 * Structure:
 * 1. CSS Custom Properties (Color palette, typography, spacing)
 * 2. Product List Layout (PLP wrapper and grid/list view styles)
 * 3. Product Card Components (Individual card styling)
 * 4. Filter & Sort Controls (Search filters and sorting UI)
 * 5. Pricing & Badges (Price display and promotional badges)
 * 6. Utility Classes (Helper classes and common patterns)
 */

/* ========================================
   1. CSS CUSTOM PROPERTIES
   Global design tokens and CSS variables
======================================== */
:root {
  
    /* ===== Color Palette ===== */
    
    /* Primary Colors */
    --warm-white: #F7F1E7;
    --deep-blue: #12212E;
    --sunshine-yellow: #FFC01F;

    /* Secondary Colors (Muted) */
    --beige: #F3E5C1;
    --tan: #DED1B1;
    --dusty-blue: #728A9C;
    --slate: #3E5769;
    --denim-blue: #0E2D44;

    /* Neutral Colors */
    --white: #FFF;
    --light-gray: #F7F7F7;
    --medium-gray: #B7B7B7;
    --dark-gray: #6F6D6A;
    --black: #000;

    /* UI Action Colors */
    --action-blue: #245B83;
    /* Set the link color */
    --dxp-c-link-text-color: var(--action-blue);

    /* Feedback Colors (Error & Success) */
    --success-green: #6ABF4B;
    --success-green-light: rgb(106, 191, 75, .2);
    --dxp-g-success: #6ABF4B;
    --error-red: #CB1640;
    --error-red-light: rgb(203, 22, 64, .2);
    --dxp-g-destructive: #CB1640;

    /* DXP Global Variables */
    --dxp-g-root: var(--warm-white);
    --dxp-g-root-contrast: #000;

    /* Component-Specific Colors */
    --product-card-color-surface: var(--white);

    /* ===== Typography System ===== */
    
    /* Font Family Variables */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-heading: 'Georgia', 'Times New Roman', serif;
    --font-family-monospace: 'Courier New', Courier, monospace;

    /* Extended Font Families */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --font-family-secondary: 'Playfair Display', Georgia, 'Times New Roman', serif;

    /* Base Font Configuration */
    --font-size-base: 1rem; /* Typically 16px */

    /* Font Weight Variables */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Heading Font Sizes */
    --heading-h1-font-size: 48px;
    --heading-h2-font-size: 40px;
    --heading-h3-font-size: 32px;
    --heading-h4-font-size: 24px;
    --heading-h5-font-size: 20px;
    --heading-h6-font-size: 16px;

    /* Heading Line Heights */
    --heading-h1-line-height: 1.2;
    --heading-h2-line-height: 1.25;
    --heading-h3-line-height: 1.3;
    --heading-h4-line-height: 1.35;
    --heading-h5-line-height: 1.4;
    --heading-h6-line-height: 1.5;

    /* Heading Font Weights */
    --heading-h1-font-weight: var(--font-weight-bold);
    --heading-h2-font-weight: var(--font-weight-bold);
    --heading-h3-font-weight: var(--font-weight-semibold);
    --heading-h4-font-weight: var(--font-weight-semibold);
    --heading-h5-font-weight: var(--font-weight-medium);
    --heading-h6-font-weight: var(--font-weight-medium);

    /* Body Font Sizes */
    --body-font-size-base: 16px;
    --body-font-size-sm: 14px;
    --body-font-size-lg: 18px;
    --body-line-height: 1.5;

    /* Letter Spacing */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;

    /* Component-Specific Font Sizes */
    --font-size-paragraph: var(--font-size-base); /* 16px */
    --font-size-button: var(--font-size-base);    /* 16px */
    --font-size-small: 0.875rem;                  
}
/* End of CSS Custom Properties */

/* ========================================
   2. PRODUCT LIST LAYOUT (PLP)
   Styles for product listing page containers and layouts
======================================== */

/* PLP List View Wrapper */
.product-list__wrapper_list {
    flex-direction: column !important;
}

/* PLP List View - Product Card */
.product-item__list .product-card {
    display: flex;
    flex-direction: row !important;
}

/* PLP Grid View Wrapper */
.product-list__wrapper_grid {
    background: transparent !important;
}

/* ========================================
   3. PRODUCT CARD COMPONENTS
   Component: c-coveo-product-individual-card
======================================== */

/* Product Card Title Styling */
c-coveo-product-individual-card h3.product-card__title,
c-coveo-product-individual-card h3.product-card__title a {
    font-size: 14px !important;
    line-height: 21px !important;
}

/* Product Card Grid View Container */
.product-item__grid {
    width: 100% !important;
    max-width: unset !important;
    min-width: 100% !important;
}

/* Strikethrough Price Styling */
.strikethrough .strikethrough {
    text-decoration-line: line-through;
}

/* Product Card Price Display */
.product-card__price {
    font-size: 25px !important;
}

/* Product Card List View - Content Section */
.product-item__list .product-card__content {
    width: 70% !important;
    min-width: 70% !important;
}

/* Product Card SKU Display */
.product-card__sku {
    margin: 0 !important;
    color: var(--dxp-c-link-text-color, var(--dxp-s-link-text-color, var(--dxp-g-brand))) !important;
    background-color: var(--dxp-c-link-color-background) !important;
    text-decoration: var(--dxp-c-link-text-decoration, var(--dxp-s-link-text-decoration, underline)) !important;
    text-shadow: var(--dxp-c-link-text-shadow) !important;
    font-size: 14px !important;
    font-style: var(--dxp-s-text-heading-medium-font-style) !important;
    font-family: var(--dxp-s-text-heading-medium-font-family, var(--dxp-g-heading-font-family)) !important;
}

/* Product Card Price Details Section */
.product-card__price-details {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Savings Price Display */
.saveprice {
    color: #acc37e;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    gap: 5px;
    font-family: var(--dxp-s-body-font-family);
}

/* Product Card Border States */
.product-item__list,
.product-item__grid {
    border: 2px solid transparent !important;
}

.product-item__list:hover,
.product-item__grid:hover {
    border: 2px solid #0E2D44 !important;
}

/* Product Card Swatcher Section */
.product-card_swatcher {
    height: 60.18px;
}

/* Product Card List View Layout */
.product-item__list .product-card {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.product-item__list .product-card__image-wrapper {
    width: 30%;
}

.product-item__list .product_card_productDetails {
    width: calc(70% - 10px);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding-top: 25px;
}

.product-item__list .product_keyfeatures .key-features-toggle span {
    display: none;
}

.product-item__list .product_keyfeatures ul.key-features-section {
    height: max-content !important;
}

.c-bwc_productCompareSelector_bwc_productCompareSelector{
    display: flex;
    gap: 5px;
}
/* End of Product Card Components */

/* ========================================
   4. FILTER & SORT CONTROLS
   Search filters and sorting UI components
======================================== */

/* Filter Container with Summary */
.cover_listing_filter:has(c-bwc-commerce-summary) {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

/* Filter Summary Component Width */
.cover_listing_filter:has(c-bwc-commerce-summary) c-bwc-commerce-summary {
    width: max-content; 
}

/* Filter Sort Container */
.cover_listing_filter:has(c-bwc-commerce-summary) > div:has(c-bwc-commerce-sort) {
    display: flex;
    justify-content: end;
    gap: 10px;
    align-items: center;
}

/* Sort Dropdown Container */
.sort__container {
    display: flex !important;
    align-items: center !important;
    gap: 5px;
}

/* Sort Header Styling */
.sort__header {
    margin: 0;
    padding: 0 !important;
}

/* Sort Dropdown Element */
[data-cy="sort-dropdown"] {
    margin: 0;
}
/* End of Filter & Sort Controls */

/* ========================================
   5. PRICING & BADGES
   Price displays and promotional badge styling
======================================== */

/* Top Rated Badge */
.product-card__badge-topRated {
    font-size: 14px !important;
    padding: 5px 10px !important;
    background: var(--sunshine-yellow) !important;
}

/* Primary CTA Button */
button.cta-button.cta-button--primary {
    background: #245B83 !important;
    text-transform: uppercase;
    border-radius: 30px;
    color: #fff !important;
    padding: 8px 40px;
}
/* End of Pricing & Badges */

/* ========================================
   End of coveoGlobalCSS.css
======================================== */

c-coveo-product-card-key-features:empty,
c-coveo-product-card-dimentions:empty,
c-coveo-product-individual-card:empty {
    display: none;
}

promo-text:empty {
    display: none;
}

body:has(c-bwc_coveo-product-listing) community_layout-section.rec-width.comm-section-container:has(c-bwc_coveo-product-listing){
    max-width: 1918px !important;
}

@media screen and (min-width:1680px){
    body:has(c-bwc_coveo-product-listing) community_layout-section.rec-width.comm-section-container:has(c-bwc_coveo-product-listing) .columns-content{
        /* background: yellow; */
        max-width: 100%;
        padding: 0 calc(var(--dxp-c-column-container-spacing-inline-end) / 3);
    }
}

c-coveo-product-individual-card{
    position: relative;
    padding-bottom: calc(10px + 10px);
}

c-bwc_coveo-product-card-c-t-a{
    position: absolute;
    bottom: 20px;
    padding-left: 0 !important;
    margin-top: 0px !important;
    padding: 10px 5px !important;
}

.product-card_compare-section{
    position: absolute;
    bottom: 20px;
    margin-top: 0px !important;
    padding: 10px 15px !important;
    width: 100%;
}

.c-bwc_productCompareSelector_bwc_productCompareSelector input{
    margin-top: 0 !important;
}

.c-bwc_productCompareSelector_bwc_productCompareSelector{
    margin-top: 0 !important;
}


.promosection_between_products{
  width: 100%;
  background: #d6d6d6;
  font-size: 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  text-align: center;
  padding: 20px;
  grid-column: 2;
  grid-row: 2;      
}

.promosection_between_products:has(img){
  padding: 0;
}

.promosection_between_products img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.membership_banner{
  margin-bottom: 20px;
}

@media screen and (max-width: 768px) {
    c-coveo-p-l-p-listing .product-item__list .product-card{
        display: flex;
        flex-direction: column !important;
    }
    c-coveo-p-l-p-listing .product-item__list .product-card__image-wrapper{
        width: 100%;
        object-fit: contain;
    }
    c-coveo-p-l-p-listing .product-item__list .product-card__image-wrapper img{
        object-fit: contain;
    }
    c-coveo-p-l-p-listing .product-item__list .product_card_productDetails{
        width: unset;
        flex-direction: column;
        display: flex;
    }

    c-bwc-commerce-view-toggle{
        display: none;
    }
        
    c-bwc_coveo-product-card-c-t-a{
        position: relative;
    }
}

c-coveo-product-individual-card .product-article{
  padding-bottom: 40px;
}

.slds-grid.main:has(c-coveo-p-l-p-listing){
    margin: auto;
}

/* Header search bar temp fix */
c-bwc_global-header.c-bwc_globalHeader_bwc_globalHeader-host {
    position: relative;
}

c-bwc-commerce-search-box-input:has(input:focus){
    position: absolute;
    left: 50%;
    width: 80%;
    transform: translateX(-50%);
    top: calc(100% - 50px);
}
.commerce-suggestions-list .product-card__price-section {
    background: transparent !important;
}
.commerce-suggestions-list .see-all-products-button{
    font-family: var(--font-family-primary);
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 0px !important;
    border: 1px solid rgb(36,91,131);
    color: rgb(36,91,131);
    outline: none;
}

.commerce-suggestions-list{
    padding-top: 0px;
    padding-bottom: 15px;
}

.commerce-suggestions-list .search-layout__left{
    /* background: #D6D6D6; */
    padding-top: 15px;
    border-right: 1px solid #00000059;
}

.commerce-suggestions-list .search-layout__right{
    padding-top: 15px !important;
}

.commerce-suggestions-list .slds-listbox__item.suggestions-option .option{
    display: flex !important;
    gap: 0px;
    align-items: center;
}

.commerce-suggestions-list .search-layout__left ul{
    display: flex;
    flex-direction: column;
}


.commerce-suggestions-list .search-layout__left lightning-formatted-rich-text{
    font-size: 16px !important;
}


.commerce-suggestions-list .search-layout__right .product-card__title {
    min-height: unset !important
}

.commerce-suggestions-list .search-layout__right .product-card__title a{
    font-size: 14px !important;
    text-decoration: underline !important;
}

.commerce-suggestions-list .product-suggestions__heading{
    font-size: 20px !important;
    font-weight: bold !important;
    font-family: var(--font-family-primary);
}

c-bwc-commerce-search-box-input .searchbox__submit-button{
    border-radius: 3px;
    max-width: 40px !important;
    padding: 20px 25px;
    position: relative;
    background: #fff;
    border: 1px solid #245B83;
    outline: none;
    height: 48px !important;
}

c-bwc-commerce-search-box-input .searchbox__submit-button .slds-icon-utility-search.slds-icon_container{
    position: absolute;
}