
/* =============================
   LAYOUT SYSTEM
============================= */

.buyer-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
    padding: 30px 10px;
}

/* =============================
   FILTER SIDEBAR
============================= */

.buyer-filters {
    position: sticky;
    top: 20px;

    display: flex;
    flex-direction: column;
    gap: 16px;

    padding: 16px;

    background: rgba(255,255,255,.96);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 14px;

    box-shadow: 0 6px 18px rgba(0,0,0,.04);

    backdrop-filter: blur(10px);
}

/* =============================
   SEARCH
============================= */

.buyer-catalog-search {
    width: 100%;
    padding: 10px 12px;

    border: 1px solid #e6e6e6;
    border-radius: 10px;

    font-size: 13px;

    color: #111;
    outline: none;

    transition: border .2s ease, box-shadow .2s ease;
}

.buyer-catalog-search:focus {
    border-color: #111;
    box-shadow: 0 0 0 2px rgba(0,0,0,.06);
}

/* =============================
   SORT
============================= */

.buyer-catalog-sort {
    width: 100%;
    padding: 10px 12px;

    border: 1px solid #e6e6e6;
    border-radius: 10px;

    font-size: 13px;
    background: #fff;
}

/* =============================
   PRICE FILTER
============================= */

.buyer-price-filter {
    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 14px;

    background: #fff;

    border: 1px solid rgba(0,0,0,.06);
    border-radius: 14px;
}

.price-filter-label {
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #9a9a9a;
}

/* =============================
   SLIDER 
============================= */

/* =============================
   PRICE SLIDER BASE
============================= */

.price-slider-wrap {
    position: relative;
    height: 36px;
    display: flex;
    align-items: center;
}

/* BASE TRACK (always grey) */

.price-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;

    height: 2px;

    background: #e6e6e6;
    border-radius: 999px;

    transform: translateY(-50%);    
    z-index: 1;
}

.price-active-track {
    position: absolute;
    top: 50%;
    height: 2px;

    transform: translateY(-50%);

    background: #111;
    border-radius: 999px;

    z-index: 2;

    left: var(--min-percent, 0%);
    right: calc(100% - var(--max-percent, 100%));
}

/* =============================
   INPUT LAYER (TWO HANDLES)
============================= */

.price-slider-wrap input[type="range"] {
    position: absolute;
    width: 100%;

    height: 36px;
    margin: 0;

    -webkit-appearance: none;
    appearance: none;

    background: transparent;

    pointer-events: none;
    z-index: 3;
}

/* re-enable pointer only on thumb */

.price-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;

    width: 18px;
    height: 18px;

    background: #111;
    border: 2px solid #fff;

    border-radius: 50%;

    box-shadow: 0 2px 10px rgba(0,0,0,.18);

    cursor: grab;

    pointer-events: auto;

    transition: transform .15s ease;
}

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

.price-slider-wrap input[type="range"]:active::-webkit-slider-thumb {
    cursor: grabbing;
}

/* Firefox */

.price-slider-wrap input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;

    background: #111;
    border: 2px solid #fff;

    border-radius: 50%;

    cursor: grab;
    pointer-events: auto;
}

/* =============================
   VALUE DISPLAY
============================= */

.price-range-values {
    display: flex;
    justify-content: space-between;

    font-size: 11px;
    color: #9a9a9a;

    margin-top: 6px;
}

#priceMinValue,
#priceMaxValue {
    color: #111;
    font-weight: 600;
}

.price-track,
.price-active-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 2px;
}

/* =============================
   CATALOG AREA
============================= */

.buyer-catalog {
    min-width: 0;
}

.buyer-catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

/* =============================
   CARD SYSTEM (FULL FIX)
============================= */

.buyer-catalog-card {
    background: #fff;

    border: 1px solid rgba(0,0,0,.06);
    border-radius: 12px;

    overflow: hidden;

    box-shadow: 0 2px 8px rgba(0,0,0,.03);

    transition: transform .25s ease, box-shadow .25s ease;
    will-change: transform;
}

.buyer-catalog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(0,0,0,.08);
}

/* =============================
   SORT BADGE
============================= */

.buyer-catalog-sort-order {
    position: absolute;
    top: 10px;
    left: 10px;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;
    font-weight: 600;

    background: rgba(255,255,255,.92);

    border: 1px solid rgba(0,0,0,.06);
    border-radius: 8px;

    backdrop-filter: blur(6px);

    z-index: 2;
}

/* =============================
   IMAGE SYSTEM (ENSURES VISIBILITY)
============================= */

.buyer-catalog-image {
    position: relative;

    aspect-ratio: 1 / 1;

    background: #f4f4f4;

    overflow: hidden;
}

.buyer-catalog-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transform: scale(1);
    transition: transform .6s cubic-bezier(.2,.8,.2,1);
}

.buyer-catalog-card:hover .buyer-catalog-image img {
    transform: scale(1.08);
}

/* =============================
   CONTENT SYSTEM
============================= */

.buyer-catalog-content {
    padding: 12px 12px 8px;
}

.buyer-catalog-content h3 {
    margin: 0 0 4px;

    font-size: 13.5px;
    font-weight: 600;

    color: #111;
}

.buyer-catalog-content p {
    margin: 0;

    font-size: 12px;
    line-height: 1.35;

    color: #8a8a8a;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    min-height: 30px;
}

/* =============================
   PRICING SYSTEM (FULL FIX)
============================= */

.buyer-catalog-pricing {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    padding: 10px 12px 12px;

    border-top: 1px solid rgba(0,0,0,.06);
}

/* labels */

.pricing-label {
    font-size: 9.5px;
    letter-spacing: .14em;
    text-transform: uppercase;

    color: #b0b0b0;

    margin-bottom: 3px;
}

/* planned price (subtle secondary value) */

.planned-price {
    font-size: 11px;
    color: #c8c8c8;

    text-decoration: line-through;
}

/* buyer price (primary emphasis) */

.buyer-price {
    font-size: 15px;
    font-weight: 600;

    color: #111;
}

/* =============================
   RESPONSIVE GRID
============================= */

@media (max-width: 1100px) {
    .buyer-layout {
        grid-template-columns: 280px 1fr;
    }

    .buyer-catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .buyer-layout {
        grid-template-columns: 1fr;
    }

    .buyer-filters {
        position: relative;
        top: auto;
    }

    .buyer-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .buyer-catalog-grid {
        grid-template-columns: 1fr;
    }
}