/* =============================================================
   Inventory product card — SALE / REPO chips, SKU, Location
   ============================================================= */

.ps-product__thumbnail { position: relative; }

.ps-product__tag-chip {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    padding: 6px 12px;
    position: absolute;
    text-transform: uppercase;
    top: 10px;
    z-index: 3;
}
.ps-product__tag-chip--sale { background: #b32b1c; left: 10px; }
.ps-product__tag-chip--repo { background: #2563eb; right: 10px; }

.ps-product__sku,
.ps-product__location {
    color: #666;
    font-size: 13px;
    line-height: 1.35;
    margin: 4px 0 0;
}
.ps-product__content .ps-product__title {
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

/* Hide review stars on inventory listing cards — they're not relevant
   for sheds/cabins and the product team asked for them removed. */
.ps-shopping-product .ps-product .ps-product__content .rating_wrap {
    display: none !important;
}

/* =============================================================
   Inventory filters — clean / simple / responsive
   Targets the storefront /inventory page filter sidebar.
   ============================================================= */

/* -------- Sidebar shell -------- */
.ps-layout--shop .ps-layout__left-container {
    background: #f6f6f5;
    border-radius: 0;
    padding: 24px 20px;
}

.bb-shop-sidebar {
    font-size: 14px;
}

/* "FILTERS" heading (uppercase, bold, prominent) */
.bb-shop-sidebar::before {
    color: #1a1a1a;
    content: "Filters";
    display: block;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 18px;
    text-transform: uppercase;
}

/* -------- Section blocks -------- */
.bb-product-form-filter .bb-product-filter {
    background: transparent;
    border: none;
    margin: 0 0 22px;
    padding: 0;
}

/* Each attribute filter (Siding Style, Width, Length, Dealer Location, etc.)
   sits in its own .bb-product-filter-attribute-item — give each one matching
   vertical spacing so the sidebar doesn't feel cramped between them. */
.bb-product-form-filter .bb-product-filter-attribute-item {
    margin: 0 0 22px;
    padding: 0;
}

.bb-product-filter-title {
    border: none !important;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 10px !important;
    padding: 0;
    text-transform: none;
}

.bb-product-filter-content {
    padding: 0;
}

/* Remove the old separator under each attribute item */
.bb-product-filter .bb-product-filter-attribute-item {
    border-bottom: none !important;
    margin-bottom: 22px !important;
    padding-bottom: 0 !important;
}

/* -------- Dropdowns (custom-dropdown-filter) -------- */
.bb-product-filter .custom-dropdown-filter,
.bb-product-filter .dropdown.custom-dropdown-filter {
    width: 100%;
}

.bb-product-filter .custom-dropdown-filter > .dropdown-toggle,
.bb-product-filter .custom-dropdown-filter > button[data-bs-toggle="dropdown"] {
    align-items: center;
    background: #fff;
    border: 1px solid #d8d6d3;
    border-radius: 4px;
    box-shadow: none;
    color: #333;
    display: flex;
    font-size: 14px;
    font-weight: 400;
    height: 42px;
    justify-content: space-between;
    padding: 0 14px;
    text-align: left;
    transition: border-color 0.15s ease;
    width: 100%;
}

.bb-product-filter .custom-dropdown-filter > .dropdown-toggle:hover,
.bb-product-filter .custom-dropdown-filter > .dropdown-toggle:focus,
.bb-product-filter .custom-dropdown-filter.show > .dropdown-toggle {
    border-color: var(--primary-color, #b32b1c);
    box-shadow: none;
    outline: none;
}

.bb-product-filter .custom-dropdown-filter .dropdown-toggle::after {
    border: 0;
    content: "\f107"; /* fa chevron-down */
    font-family: "FontAwesome", "Font Awesome 6 Free", sans-serif;
    font-size: 14px;
    font-weight: 900;
    margin: 0;
    transform: none;
    vertical-align: middle;
}

.bb-product-filter .custom-dropdown-filter .dropdown-menu {
    background: #fff;
    border: 1px solid #d8d6d3;
    border-radius: 4px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
    margin: 4px 0 0;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0;
    width: 100%;
}

.bb-product-filter .custom-dropdown-filter .dropdown-menu .form-check,
.bb-product-filter .custom-dropdown-filter .dropdown-menu .bb-product-filter-link {
    align-items: center;
    color: #333;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    margin: 0;
    padding: 8px 14px;
    transition: background-color 0.12s ease;
}

.bb-product-filter .custom-dropdown-filter .dropdown-menu .form-check:hover,
.bb-product-filter .custom-dropdown-filter .dropdown-menu .bb-product-filter-link:hover {
    background-color: #f6f6f5;
}

/* -------- Checkboxes / list items -------- */
.bb-product-filter-items .form-check,
.bb-product-filter-items .bb-product-filter-item {
    align-items: center;
    display: flex;
    margin-bottom: 8px;
    padding: 0;
}

.bb-product-filter-items .form-check-input {
    accent-color: var(--primary-color, #b32b1c);
    cursor: pointer;
    height: 16px;
    margin-right: 8px;
    margin-top: 0;
    width: 16px;
}

.bb-product-filter-items .form-check-label,
.bb-product-filter-items .bb-product-filter-link {
    color: #333;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

/* -------- Price slider (noUiSlider) -------- */
.bb-product-price-filter-info {
    margin-bottom: 14px;
}

.bb-product-price-filter-info > * {
    background: var(--primary-color, #b32b1c);
    border-radius: 3px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
}

.bb-product-filter .noUi-target,
.bb-shop-sidebar .noUi-target {
    background: #d8d6d3;
    border: none;
    border-radius: 2px;
    box-shadow: none;
    height: 4px;
}

.bb-product-filter .noUi-connect,
.bb-shop-sidebar .noUi-connect {
    background: var(--primary-color, #b32b1c);
}

.bb-product-filter .noUi-handle,
.bb-shop-sidebar .noUi-handle {
    background: var(--primary-color, #b32b1c);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    cursor: grab;
    height: 18px !important;
    right: -9px !important;
    top: -7px !important;
    width: 18px !important;
}

.bb-product-filter .noUi-handle::before,
.bb-product-filter .noUi-handle::after,
.bb-shop-sidebar .noUi-handle::before,
.bb-shop-sidebar .noUi-handle::after {
    display: none;
}

/* -------- Apply / Clear action buttons -------- */
.bb-shop-sidebar .btn-apply-sidebar-filters {
    background: var(--primary-color, #b32b1c) !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: none;
    color: #fff !important;
    font-size: 14px;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    padding: 10px 16px !important;
    text-transform: none;
    transition: filter 0.15s ease;
}

.bb-shop-sidebar .btn-apply-sidebar-filters:hover {
    filter: brightness(0.95);
}

.bb-shop-sidebar .btn-outline-secondary {
    background: transparent;
    border: 1px solid #d8d6d3 !important;
    border-radius: 4px !important;
    color: #555 !important;
    font-weight: 600 !important;
    padding: 10px 16px !important;
    transition: background 0.15s ease;
}

.bb-shop-sidebar .btn-outline-secondary:hover {
    background: #f0efed;
    color: #333 !important;
}

/* =============================================================
   Mobile drawer
   On screens < 1200px, the sidebar collapses to a slide-in panel
   triggered by #products-filter-sidebar (existing button in the
   products toolbar). Wired to .ps-layout__left.active in backend.js.
   ============================================================= */

@media (max-width: 1199px) {
    .ps-layout--shop .ps-layout__left {
        background: transparent;
        bottom: 0;
        left: -340px;
        max-width: 90vw;
        position: fixed;
        top: 0;
        transition: left 0.28s ease;
        visibility: hidden;
        width: 340px;
        z-index: 1080;
    }

    .ps-layout--shop .ps-layout__left.active {
        left: 0;
        visibility: visible;
    }

    .ps-layout--shop .ps-layout__left .ps-layout__left-container {
        background: #fff;
        border-radius: 0;
        height: 100vh;
        overflow-y: auto;
        padding: 18px 18px 28px;
        width: 100%;
    }

    .ps-layout--shop .ps-layout__left .ps-filter__header {
        align-items: center;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        margin: -18px -18px 18px;
        padding: 14px 18px;
    }

    .ps-layout--shop .ps-layout__left .ps-filter__header h3 {
        font-size: 16px;
        font-weight: 700;
        margin: 0;
        text-transform: uppercase;
    }

    .ps-layout--shop .ps-layout__left .ps-filter__header .ps-btn--close {
        color: #333;
        font-size: 20px;
        line-height: 1;
        padding: 4px 8px;
    }

    /* Hide the auto-injected "Filters" pseudo-heading on mobile —
       the .ps-filter__header above replaces it. */
    .ps-layout--shop .ps-layout__left .bb-shop-sidebar::before {
        display: none;
    }

    /* Dim screen behind the drawer */
    .ps-layout--shop .ps-layout__left .screen-darken {
        background: rgba(0, 0, 0, 0.45);
        bottom: 0;
        left: 100%;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        top: 0;
        transition: opacity 0.28s ease;
        width: 100vw;
    }

    .ps-layout--shop .ps-layout__left.active .screen-darken {
        opacity: 1;
        pointer-events: auto;
    }

    /* Mobile-only filter trigger button polish */
    .header__filter button#products-filter-sidebar {
        align-items: center;
        background: #fff;
        border: 1px solid #d8d6d3;
        border-radius: 4px;
        color: #333;
        display: inline-flex;
        font-size: 14px;
        font-weight: 600;
        gap: 6px;
        height: 42px;
        padding: 0 16px;
    }

    .header__filter button#products-filter-sidebar:hover {
        border-color: var(--primary-color, #b32b1c);
        color: var(--primary-color, #b32b1c);
    }
}

/* =============================================================
   Header search autocomplete dropdown rows — compact, professional
   ============================================================= */
.ps-product--search-result {
    align-items: center !important;
    color: inherit;
    text-decoration: none;
    padding: 10px 14px !important;
    margin-bottom: 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    gap: 12px;
}
.ps-product--search-result:last-child {
    border-bottom: none !important;
}
.ps-product--search-result:hover {
    background-color: #f7f7f7;
}
.ps-product--search-result:hover .ps-product__title {
    color: var(--primary-color, #b32b1c);
}

.ps-product--search-result .ps-product__thumbnail {
    flex: 0 0 56px !important;
    max-width: 56px !important;
    min-width: 56px !important;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f4f4f4;
}
.ps-product--search-result .ps-product__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ps-product--search-result .ps-product__content {
    padding-left: 0 !important;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ps-product--search-result .ps-product__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.ps-product--search-result .ps-product__title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-product--search-result .ps-product__price {
    font-size: 13px !important;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    flex: 0 0 auto;
    margin: 0 !important;
}

/* Secondary line: SKU · Dealer · Chips, all inline. */
.ps-product--search-result .ps-product__sku,
.ps-product--search-result .ps-product__vendor {
    color: #777;
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    border: none;
    display: inline;
    text-transform: none;
    font-weight: 400;
}

.ps-product--search-result .ps-product__vendor {
    text-decoration: none;
}
.ps-product--search-result .ps-product__vendor img {
    display: none; /* keep the row visually tight; dealer name alone is enough at this size */
}
.ps-product--search-result .ps-product__vendor span {
    text-decoration: underline;
    color: #555;
}

/* Single secondary line with SKU · Dealer · Chips. */
.ps-product--search-result .ps-product__meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}
.ps-product--search-result .ps-product__meta-row > * + *::before {
    content: "·";
    color: #ccc;
    margin-right: 6px;
    display: inline-block;
}
.ps-product--search-result .ps-product__chips::before {
    display: none !important;
}

.ps-product--search-result .ps-product__chips {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.ps-product--search-result .ps-product__chips .ps-product__tag-chip {
    position: static;
    padding: 2px 6px;
    font-size: 9px;
    letter-spacing: 0.05em;
    border-radius: 2px;
    top: auto;
    left: auto;
    right: auto;
}
