/* /marketplace/marketplace.css — the marketplace page's own styles, all in
   one file now instead of 3 (this used to just @import 2 marketplace-styles/
   partials for everything below). marketplace-products.css and
   product-strip.css stay as real imports below — both are genuinely shared
   with other pages (cart, landing, product-details, wishlist), not
   marketplace-specific, so folding them in here would duplicate them. */
@import url(/landing/landing-styles/variables.css);
@import url(/landing/landing-styles/base.css);
@import url(/landing/landing-styles/navbar.css);
@import url(/marketplace/marketplace-styles/marketplace-products.css);
@import url(/landing/landing-styles/toast.css);
@import url(/marketplace/marketplace-styles/product-strip.css);
@import url(/landing/landing-styles/footer.css);
@import url(/landing/landing-styles/cookie-banner.css);

body{
    background: var(--surface);
}

.marketplace-header{
    background: var(--surface);
    border-radius: 12px;
    padding: 40px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 60px;
}

.marketplace-header h1{
    font-size: 40px;
    font-family: var(--headers);
    font-weight: 700;
    color: var(--second-color);
    margin: 0 0 5px 0;
}

.marketplace-header p{
    font-size: 14px;
    color: var(--main-text);
}

.results-count{
    background: #fff;
    border: 1px solid #eee;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #6b6b6b;
    white-space: nowrap;
    margin-top: 45px;
}

.marketplace-layout{
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    align-items: start;
    padding: 0 2rem 80px 2rem;
}

.marketplace-sidebar{
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    position: sticky;
    top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 85px;
}
.page-btn{
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 50%;
    cursor: pointer;
    font-family: var(--body-font);
    font-weight: 600;
}
.page-btn.active{
    background: var(--main-text);
    color: #fff;
    border-color: var(--main-text);
}
.page-arrow{
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 50%;
    cursor: pointer;
}
.page-arrow:disabled{
    opacity: 0.7;
    cursor: not-allowed;
}

.filters-head{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.filters-head h2{
    font-family: var(--headers);
}
.filters-head-actions{
    display: flex;
    align-items: center;
    gap: 12px;
}
.reset-filters{
    background: none;
    border: none;
    color: var(--second-color);
    cursor: pointer;
    font-family: var(--body-font);
}
/* Only relevant once the sidebar becomes an off-canvas panel below
   1200px — see the media query near the bottom of this file. */
.sidebar-close-btn{
    display: none;
    background: none;
    border: none;
    align-items: center;
    justify-content: center;
    padding: 4px;
    color: var(--main-text);
    cursor: pointer;
}

.filter-section{
    margin-bottom: 20px;
}
.filter-section h3{
    font-size: 14px;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    font-family: var(--body-font);
    color: var(--second-color);
}

.vendor-search-box{
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--greys);
    border-radius: 8px;
    padding: 8px 12px;
}
.vendor-search-box input{
    border: none;
    outline: none;
    width: 100%;
    font-family: var(--body-font);
    font-size: 13px;
}

.suggested-vendors{
    list-style: none;
    padding: 0;
    margin-top: 10px;
    border: 1px solid var(--greys);
    padding: 6px;
    border-radius: 10px;
}
.suggested-vendor-item a{
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.suggested-vendor-item a:visited{
    color: inherit;
}
.suggested-vendor-item{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
}

.suggested-vendor-item img,
.suggested-vendor-item .vendor-initials-fallback{
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.suggested-vendor-item .vendor-initials-fallback{
    background-color: var(--second-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.suggested-vendor-item p{
    font-size: 13.3px;
    margin: 0;
}
.suggested-vendor-item:hover{
    background-color: var(--greys-two);
    padding: 5px;
    border-radius: 10px;
    transition: var(--transition);
}

.category-list, .availability-list{
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-list li, .availability-list li{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13.3px;
}
/* Collapsed by default — the category checklist was long enough to push
   Availability/Sort/Apply well down the sidebar. The last 4 categories
   stay hidden until "Show more" is clicked. */
.category-list .category-extra{
    display: none;
}
.category-list.show-all .category-extra{
    display: flex;
}
.category-list-toggle{
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 8px 0 4px;
    margin-bottom: 6px;
    color: var(--second-color);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--body-font);
    cursor: pointer;
}
.category-list-toggle svg{
    transition: transform 0.2s ease;
}
.category-list-toggle[aria-expanded="true"] svg{
    transform: rotate(180deg);
}
.category-checkbox,
input[type="radio"][name="availability"]{
    accent-color: var(--second-color);
}
.cat-count{
    color: var(--second-color);
}
.sort-filter select{
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: var(--body-font);
}

.apply-filters-btn{
    width: 100%;
    background: var(--second-color);
    color: var(--white);
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--headers);
}

.products-display{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Marketplace search */
.marketplace-search{
    margin-bottom: 24px;
}

.search-row{
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.search-box-large{
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    flex: 1;
    min-width: 0;
}
/* Hidden on desktop, where the sidebar is always visible inline — see
   the media query below for when this appears. */
.filters-toggle-btn{
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 18px;
    font-family: var(--body-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--main-text);
    cursor: pointer;
    flex-shrink: 0;
}
.filters-toggle-btn:hover{
    border-color: var(--second-color);
    color: var(--second-color);
}
.search-box-large:focus-within{
    border: 1px solid var(--second-color);
    outline: none;
}
.search-box-large input{
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    font-family: var(--body-font);
    font-weight: 300;
}
.category-buttons{
    list-style: none;
    display: flex;
    gap: 10px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.each-button{
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 35px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    font-family: var(--body-font);
}

.each-button.active{
    background: var(--second-color);
    color: #fff;
}

/* Dark backdrop behind the off-canvas sidebar below 1200px. Present in
   the DOM on every breakpoint but only ever toggled .open on the tiers
   where the sidebar itself goes off-canvas (see marketplace.js). */
.sidebar-overlay{
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.sidebar-overlay.open{
    display: block;
    opacity: 1;
}
/* Prevents the page behind the panel from scrolling while it's open. */
body.sidebar-open{
    overflow: hidden;
}

/* Footer "Categories" deep-links to #categoryButtons — keep the row clear of
   the fixed navbar when jumped to, instead of hiding it underneath. */
#categoryButtons{
    scroll-margin-top: 110px;
}

/* Below 1200px a fixed 260px sidebar was leaving too little room for the
   product grid (4 columns of leftover space made cards uncomfortably
   narrow well before the 900px "phone" tier even kicked in) — the
   sidebar moves off-canvas here instead, opened via #filtersToggleBtn,
   and the grid gets the full width back. */
@media (max-width: 1200px){
    .marketplace-layout{
        grid-template-columns: 1fr;
        padding: 0 20px 60px 20px;
    }
    .filters-toggle-btn{
        display: inline-flex;
    }
    .sidebar-close-btn{
        display: inline-flex;
    }
    .marketplace-sidebar{
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        width: 340px;
        max-width: 85vw;
        z-index: 200;
        border-radius: 0;
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
    }
    .marketplace-sidebar.open{
        transform: translateX(0);
    }
    /* Tablet: sidebar closed gives the grid its full width back — 3
       columns instead of 4 squeezed alongside a docked sidebar. */
    .products-display{
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Phone: the panel covers the full screen when open (a drawer would be
   too narrow to be useful at this width) and the grid drops to 2
   columns, same as before this feature existed. */
@media (max-width: 900px){
    .marketplace-header{ padding: 28px 20px; margin-top: 40px; }
    .marketplace-header h1{ font-size: 28px; }
    .results-count{ margin-top: 0; }
    .marketplace-sidebar{
        width: 100%;
        max-width: 100%;
    }
    .products-display{
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}
@media (max-width: 480px){
    .products-display{
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .search-row{
        flex-wrap: wrap;
    }
    .filters-toggle-btn{
        width: 100%;
        justify-content: center;
        padding: 12px 18px;
    }
}
