/*
|--------------------------------------------------------------------------
| 1. Search Results Dropdown/Page Wrapper
|--------------------------------------------------------------------------
|
| Contains all styles for the main search results experience,
| including styles that were previously in the "Global Overrides" section.
|
*/

#rebuy-smart-search-results-dropdown#rebuy-smart-search-results-dropdown,
#rebuy-smart-search-results-sidebar-flyout-filter#rebuy-smart-search-results-sidebar-flyout-filter {
    padding: 0;
    margin-top: 0;
    max-width: none;
}

#rebuy-smart-search-results-dropdown,
#rebuy-smart-search-results-sidebar-flyout-filter {

    #rebuy-smart-search-results-page-dropdown__input {
        border-radius: var(---radius);
        border: 1px solid white;
    }

    #rebuy-smart-search-results-page-dropdown__input:focus,
    #rebuy-smart-search-results-page-dropdown__input:active {
        border: 1px solid var(---color-border-dark);
    }

    /* General Container/Layout */
    .rebuy-smart-search-results-dropdown {
        min-height: 50vh;
    }


    .rebuy-smart-search-results-page__container,
    .rebuy-search-filters {
        padding-inline: 1rem;
        /* margin-bottom: 0 !important; */
    }

    .rebuy-smart-search-results-page__container.gap-default {
        column-gap: 0.5rem;
        row-gap: 1.5rem;
    }

    /* Header and Input Area */
    .rebuy-smart-search-results-page__header-section {
        background-color: #eeeceb;
        padding-block: 2rem;
        text-align: center;
        justify-content: center;

        /* --- Merged from Global Overrides --- */
        h1 {
            margin-top: 0;
        }
    }

    .rebuy-smart-search-results-page__input-section,
    .rebuy-smart-search-results-page-dropdown__context {
        max-width: 798px;
        margin: 0 auto;
        justify-content: center;
    }

    /* --- Merged from Global Overrides --- */
    .rebuy-smart-search-results-page-dropdown__context {
        margin-top: 1rem;
    }

    /* Product Cards */
    .rebuy-product-info {
        text-align: left;
    }

    .rebuy-smart-search-results-page__product .rebuy-product-info {
        text-align: left;
    }

    .rebuy-smart-search-results-page__product-skeleton {
        padding-bottom: var(---product-grid-aspect-ratio);
    }

    /* Sorting Controls */
    .rebuy-smart-search-results-page__sort-by {
        display: flex;
        gap: 0.5rem;

        label.rebuy-smart-search-results-page-dropdown__sort-by-label {
            white-space: nowrap;
            display: flex;
            align-items: center;
            text-transform: uppercase;
            gap: 1rem;
            font-size: .875rem;
        }

        #rebuy-smart-search-sort-options.rebuy-select {
            text-transform: uppercase;
            background-image: var(---ico-select);
            background-repeat: no-repeat;
            background-position: right 10px center;
            background-color: transparent;
            background-size: 11px auto;
            font-size: .875rem !important;
            padding-left: 0.5rem;
            padding-right: 1.25rem;
        }
    }

    /* Filtering Controls */
    .rebuy-search-filters.rebuy-search-filters {
        display: none;
        /* align-items: center;
        flex-direction: row; */
    }

    .rebuy-smart-search-results-page-dropdown__result-section {
        margin-top: 1rem;
    }

    .rebuy-search-filter p {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        text-transform: uppercase;
        margin: 0;
        font-size: .875em;
    }

    #rebuy-smart-search-results-filter-flyout {

        /* --- Merged from Global Overrides --- */
        .rebuy-smart-search-results-page-sidebar-flyout__filter-list-title {
            color: #221E1B;
            font-family: var(---font-stack-body);
            font-size: 14px;
            font-style: normal;
            font-weight: 400;
            line-height: 140%;
            letter-spacing: 0.7px;
            text-transform: uppercase;
        }

        .rebuy-smart-search-results-page-sidebar-flyout__context-left {
            width: 100%;
        }

        .rebuy-smart-search-results-page__filter-option-checkbox-label,
        .radio-label {
            color: var(--COLOR-BLACK);
            font-family: var(---font-stack-body);
            font-size: 14px;
            font-weight: 300;
            line-height: 140%;
            text-transform: capitalize;
        }
    }

    #filterSelectMenu {
        position: fixed;
        top: 0;
        bottom: 0;
        z-index: 10000;
        border-radius: 0;
        height: 100dvh;
        overflow: scroll;

        /* --- Merged from Global Overrides --- */
        .rebuy-smart-search-results-page-dropdown__filter-list-title {
            color: #221E1B;
            font-family: var(---font-stack-body);
            font-size: 14px;
            font-style: normal;
            font-weight: 400;
            line-height: 140%;
            letter-spacing: 0.7px;
            text-transform: uppercase;
            color: #221E1B;
            font-family: var(---font-stack-body);
            font-size: 14px;
            font-style: normal;
            font-weight: 400;
            line-height: 140%;
            letter-spacing: 0.7px;
            text-transform: uppercase;
        }

        .rebuy-smart-search-results-page__filter-option-checkbox-label,
        .radio-label {
            color: var(--COLOR-BLACK);
            font-family: var(---font-stack-body);
            font-size: 14px;
            font-weight: 300;
            line-height: 140%;
            text-transform: capitalize;
        }
    }

    /* Radio/Checkbox Inputs */
    label.rebuy-radio-label {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    [type="radio"].radio-input.rebuy-radio {
        padding: 0;
        border-color: var(--COLOR-BLACK);
    }

    [type="radio"]:checked.radio-input.rebuy-radio {
        background: var(--COLOR-BLACK);
    }

    [type="radio"]:disabled.radio-input.rebuy-radio {
        opacity: 0.2;
    }

    [type="checkbox"].rebuy-checkbox {
        padding: 0.5rem;
    }

    .rebuy-checkbox:checked,
    input[type="checkbox"][class="rebuy-checkbox"]:checked,
    .rebuy-cart .rebuy-checkbox:checked {
        border-color: var(--COLOR-BLACK);
        background: var(--COLOR-BLACK);
    }

    /* Pagination */
    .rebuy-smart-search-results-page__pagination-label.active button {
        color: var(--COLOR-BLACK);
    }

    /* Media Queries */
    @media (max-width: 749px) {
        .rebuy-smart-search-results-page__header-section {
            padding-inline: 1rem;
        }

        #filterSelectMenu {
            max-width: none;
            width: 100%;
        }
    }

    @media (min-width: 750px) {
        #filterSelectMenu {
            overflow: scroll;
            width: 20vw;
        }
    }
}

/*
|--------------------------------------------------------------------------
| 2. Rebuy Quick View Dropdown
|--------------------------------------------------------------------------
|
| Contains all styles for the Quick View experience,
| including styles that were previously in the "Global Overrides" section.
|
*/

.rebuy-quick-view-dropdown {
    .rebuy-quick-view-skeleton__product-image {
        width: 100% !important;
        padding-bottom: 100%;
    }

    .rebuy-quick-view-skeleton__product-details {
        margin-right: auto;
        align-items: start !important;
    }

    .rebuy-quick-view__collection-section button.see-more {
        color: var(--COLOR-BLACK);
    }

    .rebuy-quick-view__collection-section,
    .rebuy-quick-view__product-section {
        gap: .625rem;
    }

    .rebuy-quick-view__product-list {
        gap: .5rem;
    }

    /* Sub-containers & Layout */
    .rebuy-quick-view-dropdown__container {
        height: auto;
        top: 0;
        animation: none !important;
        opacity: 1;
        transition: transform 0.4s ease-in-out, width 0.4s ease-in-out, background-color 0.2s ease-in-out;
    }

    .rebuy-quick-view-dropdown__input-container {
        padding: 0;
    }

    .rebuy-quick-view-dropdown__grid-gap-default {
        gap: 0.5rem;
    }

    /* Search Input within Quick View */
    .rebuy-quick-view__search-input {
        margin: 0;
        border: none;
        padding: 0;
        background: transparent;
        color: var(---color-text);
        font-size: calc(var(--font-2) * var(---font-adjust-body));
        padding-block: 13px;
        margin: 0;
        border: 1px solid var(---color-border);
        border-radius: var(---radius-sm);
        background-color: var(---color-bg);
        padding: 0;
    }

    #searchInput {
        width: 100%;
    }

    /* Product Section Specific Overrides */
    .rebuy-quick-view__product-section .rebuy-quick-view__product .rebuy-product-title {
        text-align: left;
    }

    .rebuy-quick-view__product-section .rebuy-quick-view__product .price {
        justify-content: start;
    }

    /* --- Merged from Global Overrides --- */
    .rebuy-quick-view__product-section.rebuy-quick-view__product-section {
        grid-area: inherit;
    }

    /* --- Merged from Global Overrides: Color & Font definitions --- */
    .rebuy-quick-view__title,
    .rebuy-quick-view__no-results p,
    a,
    p,
    li,
    button  {
        color: var(--COLOR-BLACK);
    }
    
    .rebuy-quick-view__no-results p {
        text-align: center;
    }

    .rebuy-quick-view__title,
    .rebuy-quick-view__no-results p {
        font-size: .875rem;
        font-style: normal;
        font-weight: 500;
        line-height: 140%;
        text-transform: uppercase;
        font-family: var(---font-stack-body);
    }

    /* Media Queries (Min-width: 750px) */
    @media (min-width: 750px) {
        .rebuy-quick-view-dropdown__input-container {
            height: 52px;
        }

        .rebuy-quick-view-dropdown__results {
            /* display: grid;
            grid-template-columns: 200px minmax(0, 1fr); */
            gap: 1.875rem;
        }

        .rebuy-quick-view__search-input {
            width: 50%;
        }

        .rebuy-quick-view-dropdown__close {
            position: absolute;
            left: 100%;
        }
    }

    /* Media Queries (Max-width: 749px) */
    @media (max-width: 749px) {
        .rebuy-quick-view-dropdown__close {
            display: none;
        }

        .rebuy-quick-view-dropdown__container {
            top: 100%;
            padding-inline: 1rem;
            /* background-color: transparent; */
        }
    }

}

/*
|--------------------------------------------------------------------------
| 3. Shared/Common Component Styles
|--------------------------------------------------------------------------
|
| These styles apply to components that appear in *both* the
| Search Results Page AND the Quick View dropdown.
|
*/

/* Base Product Card Info */
.rebuy-product-info {
    margin-top: .625rem;
    text-align: left;
    margin-bottom: 0.5rem;

    .rebuy-product-title,
    .price {
        color: var(--COLOR-BLACK);
        font-size: 0.875rem;
        font-style: normal;
        font-weight: 500;
        line-height: 140%;
    }

    .price {
        gap: 0.25rem;
    }
}

/* Base Image Aspect Ratio Container */
.rebuy-smart-search__absolute-image-container,
.rebuy-smart-search-results-page__absolute-image-container {
    padding-bottom: var(---product-grid-aspect-ratio);
}

/*
|--------------------------------------------------------------------------
| 4. Top-Level Wrapper Overrides
|--------------------------------------------------------------------------
|
| These are high-specificity overrides applied to the main
| component IDs. They contain shared styles for elements
| nested deep inside.
|
*/

/* This applies to the quick view *only* */
#rebuy-quick-view-dropdown-search .rebuy-quick-view__overlay-body.rebuy-quick-view__overlay-body {
    max-width: 1200px;
}

/* These styles are shared between both components */
#rebuy-quick-view-dropdown-search,
#rebuy-smart-search-results-dropdown,
#rebuy-smart-search-results-sidebar-flyout-filter {

    .rebuy-money {
        font-size: .875rem;
    }

    .rebuy-smart-search-results-page-dropdown__result-title {
        margin-bottom: 0;
        font-family: var(---font-stack-body);
        font-weight: 300;
        font-size: 1em;
    }

    .rebuy-money.sale {
        --rb-smart-search-quick-view-product-price-sale-color: #D75533;
        font-weight: 500;
        color: #D75533;
    }

    #rebuy-quick-view-overlay {
        border-top: solid 1px #C9C8C7;
        box-shadow: none;
    }

    .rebuy-quick-view__collection-list,
    .rebuy-quick-view__search-term-section-list-container {
        font-size: .875rem;
        font-style: normal;
        font-weight: 300;
        line-height: 140%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: .625rem;
    }

    .rebuy-quick-view-dropdown__search-term {
        margin-bottom: 0;
    }

    .rebuy-product-price {
        font-weight: 500;
    }

    .rebuy-product-options select.rebuy-select.rebuy-select {
        border-radius: var(---radius);
        border: solid 1px #C9C8C7;
        background-image: var(---ico-select);
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-color: transparent;
        background-size: 11px auto;
        font-size: .875rem !important;
        padding-left: 0.5rem;
        padding-right: 0;
    }

    /* Shared CTA Button */
    button.rebuy-quick-view__product-cta,
    .rebuy-smart-search-results-page__cta {
        color: var(--COLOR-BLACK);
        background-color: white;
        text-transform: uppercase;
        border-radius: var(---radius);
        border: solid 1px #C9C8C7;
        transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
        padding-block: 0.95rem;
    }

    button.rebuy-quick-view__product-cta:hover,
    .rebuy-smart-search-results-page__cta:hover {
        background-color: var(--COLOR-BLACK);
        color: white;
        text-transform: uppercase;
        border-radius: var(---radius);
        border: solid 1px var(--COLOR-BLACK);
        ;
    }

    .rebuy-button.rebuy-smart-search-results-page__continuous-scroll-button {
        color: var(--COLOR-BLACK);
        text-transform: uppercase;
        background-color: transparent;
        text-decoration: underline;
        text-underline-offset: .375rem;
    }
}