/**
 * Universal Filter Sidebar & Mobile Drawer / Sort Sheet CSS
 * 1:1 Reference Design matching Screenshot 3, 4, 5
 */

:root {
    --brand-pink: #ff1a58;
    --gray-bg: #f8f9fa;
    --border-color: #eaeaea;
}

/* ========================================================
   DESKTOP FILTER SIDEBAR (Screenshot 3)
   ======================================================== */
.universal-filter-sidebar {
    background: #ffffff;
    border-radius: 8px;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
}

.universal-filter-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

/* Custom Scrollbar for filter sidebar */
.universal-filter-sticky::-webkit-scrollbar,
.mobile-filter-drawer-body::-webkit-scrollbar {
    width: 5px;
}
.universal-filter-sticky::-webkit-scrollbar-thumb,
.mobile-filter-drawer-body::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}
.universal-filter-sticky::-webkit-scrollbar-track,
.mobile-filter-drawer-body::-webkit-scrollbar-track {
    background: transparent;
}

/* Accordion Section */
.filter-section {
    position: relative;
    border-bottom: 1px solid var(--border-color);
}
.filter-section:last-child {
    border-bottom: none;
}

.filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    cursor: pointer;
    user-select: none;
    padding: 0 4px;
}

.filter-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #101828;
    margin: 0;
}

.filter-chevron {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.filter-section.is-collapsed .filter-chevron {
    transform: rotate(180deg);
}

.filter-section-body {
    padding: 4px 4px 18px;
    transition: all 0.25s ease;
}

.filter-section.is-collapsed .filter-section-body {
    display: none;
}

/* Dual Range Slider (Price) */
.price-slider-wrap {
    padding: 6px 4px 8px;
}

.price-slider-track-wrap {
    position: relative;
    width: 100%;
    height: 5px;
    background: #e5e7eb;
    border-radius: 5px;
    margin: 12px 0 6px;
}

.price-slider-active-bar {
    position: absolute;
    height: 100%;
    background: #000000;
    border-radius: 5px;
    top: 0;
    bottom: 0;
}

.price-slider-ranges {
    position: relative;
    height: 5px;
    margin-top: -5px;
}

.price-slider-ranges input[type="range"] {
    position: absolute;
    top: -6px;
    left: 0;
    width: 100%;
    height: 5px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
}

.price-slider-ranges input[type="range"]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--brand-pink, #ff1a58);
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.15s ease;
}

.price-slider-ranges input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.price-slider-ranges input[type="range"]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--brand-pink, #ff1a58);
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Number inputs below slider */
.price-inputs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}

.price-input-box {
    flex: 1;
    position: relative;
}

.price-input-box input {
    width: 100%;
    height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #101828;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
    padding: 0 8px;
}

.price-input-box input:focus {
    border-color: #000000;
}

.price-separator {
    color: #6b7280;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

/* Checkbox Lists (Category, Brands, etc.) */
.filter-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.filter-checkbox-item input[type="checkbox"] {
    width: 17px;
    height: 17px;
    border-radius: 4px;
    accent-color: var(--brand-pink, #ff1a58);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.filter-checkbox-label {
    font-size: 13.5px;
    color: #374151;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    line-height: 1.3;
}

.filter-checkbox-item:hover .filter-checkbox-label {
    color: #111827;
}

.filter-item-count {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.filter-show-more-btn {
    display: block;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
    color: #111827;
    cursor: pointer;
    margin-top: 10px;
    background: none;
    border: none;
    padding: 4px;
    width: 100%;
}

.filter-show-more-btn:hover {
    color: var(--brand-pink, #ff1a58);
}

/* ========================================================
   PHONE VIEW FILTER PILL (Screenshot 4)
   ======================================================== */
.mobile-filter-pill-container {
    display: none;
    position: fixed;
    bottom: 82px;
    left: 50%;
    transform: translate(-50%, 16px);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
}

@media (max-width: 991px) {
    .mobile-filter-pill-container {
        display: block !important;
    }
    .mobile-filter-pill-container.is-visible {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translate(-50%, 0) !important;
    }
    .desktop-filter-sidebar-wrapper {
        display: none !important;
    }
    .filter-sidebar-col,
    .col-sm-3:has(.universal-filter-sidebar) {
        display: contents !important;
    }
    .filter-product-col,
    .col-sm-9:has(.category-products-section) {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    .filter_sort .filter_btn {
        display: none !important;
    }
}

.mobile-filter-pill {
    background: #000000;
    border-radius: 9999px;
    padding: 9px 18px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-pill-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 2px 8px;
    outline: none;
    white-space: nowrap;
}

.mobile-pill-divider {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
}

/* ========================================================
   PHONE VIEW FILTER DRAWER (Screenshot 5 - Right Side)
   ======================================================== */
.mobile-filter-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-filter-backdrop.is-active {
    opacity: 1;
    visibility: visible;
}

.mobile-filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    z-index: 1045;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.mobile-filter-drawer.is-active {
    transform: translateX(0);
}

.mobile-filter-drawer-header {
    padding: 10px 16px 12px;
    border-bottom: 1px solid #f1f2f7;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.mobile-drag-bar {
    width: 32px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 4px;
    margin: 0 auto 10px;
}

.mobile-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-filter-title {
    font-size: 16px;
    font-weight: 600;
    color: #101828;
    margin: 0;
}

.mobile-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    border-radius: 50%;
}

.mobile-filter-drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px 18px 80px;
}

.mobile-filter-drawer-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 18px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.mobile-btn-cancel {
    background: transparent;
    border: none;
    font-size: 13.5px;
    font-weight: 500;
    color: #4b5563;
    padding: 8px 16px;
    cursor: pointer;
}

.mobile-btn-apply {
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 30px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mobile-btn-apply:hover {
    background: #222222;
}

/* ========================================================
   PHONE VIEW SORT BOTTOM SHEET
   ======================================================== */
.mobile-sort-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-sort-backdrop.is-active {
    opacity: 1;
    visibility: visible;
}

.mobile-sort-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 1045;
    padding: 10px 16px 24px;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
}

.mobile-sort-sheet.is-active {
    transform: translateY(0);
}

.mobile-sort-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 6px;
    border-radius: 8px;
    font-size: 14px;
    text-transform: capitalize;
    border: none;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
}

.mobile-sort-option:hover,
.mobile-sort-option.is-active {
    background: #f3f4f6;
    color: #000000;
    font-weight: 600;
}

.mobile-sort-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.mobile-sort-option.is-active .mobile-sort-radio {
    border: 5px solid #111827;
}

/* ========================================================
   SCREENSHOT 2 (1:1 REFERENCE) LISTING TOOLBAR & GRID
   ======================================================== */
.bb-listing-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 13px;
    color: #6b7280;
}

.bb-listing-breadcrumb a {
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.bb-listing-breadcrumb a:hover {
    color: #000000;
}

.bb-listing-breadcrumb svg {
    flex-shrink: 0;
    display: inline-block;
}

.bb-listing-breadcrumb span {
    color: #111827;
    font-weight: 600;
    text-transform: capitalize;
}

.bb-listing-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.bb-listing-title {
    font-family: 'Arsenal', sans-serif, -apple-system;
    font-size: 26px;
    font-weight: 700;
    color: #000000;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

@media (max-width: 575px) {
    .bb-listing-title {
        font-size: 20px;
    }
}

.bb-listing-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bb-sort-form {
    margin: 0;
}

.bb-sort-dropdown-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bb-sort-select {
    appearance: none;
    -webkit-appearance: none;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 32px 8px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: #111827;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bb-sort-select:hover,
.bb-sort-select:focus {
    border-color: #000000;
}

.bb-sort-arrow {
    position: absolute;
    right: 12px;
    pointer-events: none;
}

.universal-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    background: transparent;
    padding: 0;
    margin: 0;
    transition: opacity 0.22s ease, filter 0.22s ease;
}

.universal-products-grid.is-loading {
    opacity: 0.35;
    pointer-events: none;
    filter: grayscale(15%);
}

@media (max-width: 1199px) {
    .universal-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .universal-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

.universal-product-grid-col {
    width: 100%;
    height: 100%;
}

.universal-product-grid-col .universal-product-card {
    width: 100%;
    height: 100%;
}

.universal-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
}

/* Reset any unwanted container border boxes on listing pages (Screenshot 1 fix) */
.filter-product-col .category-products-section,
.filter-product-col .sorting-section {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.filter-product-col .category-products-head {
    display: none !important;
}

