/* ============================================================
   CB Marketplace — Category & Brand Pages
   Design tokens:
     Font:    Epilogue
     Blue:    #1732a4
     Red:     #ff5858 / #e84a3d
     Dark:    #191c2f
     Grey BG: #f5f6fa
     Border:  #e4e8f0
     Gradient: linear-gradient(135deg, #e84a3d 0%, #2a348c 100%)
   ============================================================ */

/* ──────────────────────────────────────────────
   1. HERO CAROUSEL
   ────────────────────────────────────────────── */
.cb-hero {
    margin-bottom: 0;
}

.cb-hero__carousel {
    overflow: hidden;
}

.cb-hero .carousel-item img {
    width: 100%;
    height: auto;
}

.cb-hero .carousel-indicators {
    margin-bottom: .75rem;
    gap: 6px;
}

.cb-hero .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #fff;
    opacity: .55;
    transition: opacity .3s, width .3s, border-radius .3s;
}

.cb-hero .carousel-indicators .active {
    opacity: 1;
    width: 24px;
    border-radius: 4px;
}

.cb-hero .carousel-control-prev,
.cb-hero .carousel-control-next {
    width: 40px;
    height: 40px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .9);
    border-radius: 50%;
    opacity: 0;
    transition: opacity .25s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}

.cb-hero:hover .carousel-control-prev,
.cb-hero:hover .carousel-control-next {
    opacity: 1;
}

.cb-hero .carousel-control-prev { left: 12px; }
.cb-hero .carousel-control-next { right: 12px; }

.cb-hero .carousel-control-prev-icon,
.cb-hero .carousel-control-next-icon {
    width: 16px;
    height: 16px;
    filter: invert(.25);
}

/* ──────────────────────────────────────────────
   2. PAGE LAYOUT
   ────────────────────────────────────────────── */
.cb-cat {
    padding: 1.25rem 0 2rem;
}

/* Breadcrumb */
.cb-cat__breadcrumb .breadcrumb {
    margin: 0;
    font-size: .85rem;
}

.cb-cat__breadcrumb .breadcrumb-item a {
    color: #1732a4;
    text-decoration: none;
    font-weight: 500;
}

.cb-cat__breadcrumb .breadcrumb-item a:hover {
    text-decoration: underline;
}

.cb-cat__breadcrumb .breadcrumb-item.active {
    color: #7c8299;
}

/* Page title */
.cb-cat__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #e84a3d 0%, #2a348c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 768px) {
    .cb-cat__title { font-size: 1.35rem; }
}

/* ──────────────────────────────────────────────
   3. SUBCATEGORY SCROLL STRIP
   ────────────────────────────────────────────── */
.cb-subcat {
    position: relative;
    margin-bottom: 1.5rem;
}

.cb-subcat__track {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 4px 2px;
    scrollbar-width: none;
}

.cb-subcat__track::-webkit-scrollbar {
    display: none;
}

.cb-subcat__card {
    flex: 0 0 auto;
    width: 140px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e4e8f0;
    display: block;
    color: #191c2f;
    transition: transform .3s, box-shadow .3s, border-color .3s;
}

.cb-subcat__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(23, 50, 164, .1);
    border-color: rgba(23, 50, 164, .18);
}

.cb-subcat__img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    padding: 10px;
    background: #f5f6fa;
    display: block;
}

.cb-subcat__name {
    padding: .45rem .55rem;
    font-size: .73rem;
    font-weight: 600;
    color: #191c2f;
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cb-subcat__card:hover .cb-subcat__name {
    color: #1732a4;
}

/* Scroll arrows */
.cb-subcat__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #e4e8f0;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .95rem;
    color: #191c2f;
    transition: background .2s, color .2s;
    padding: 0;
}

.cb-subcat__arrow:hover {
    background: #1732a4;
    color: #fff;
    border-color: #1732a4;
}

.cb-subcat__arrow--left  { left: -8px; }
.cb-subcat__arrow--right { right: -8px; }

@media (min-width: 576px) {
    .cb-subcat__card { width: 155px; }
}

@media (min-width: 768px) {
    .cb-subcat__card { width: 165px; }
}

/* ──────────────────────────────────────────────
   4. FILTER SIDEBAR
   ────────────────────────────────────────────── */
.cb-filter {
    border-radius: 12px;
    border: 1px solid #e4e8f0;
    background: #fff;
    padding: 1.25rem;
    position: sticky;
    top: 110px;
}

.cb-filter__heading {
    font-size: .9rem;
    font-weight: 700;
    color: #191c2f;
    margin: 0;
}

.cb-filter__count {
    font-size: .78rem;
    color: #7c8299;
    margin: 0;
}

.cb-filter__search {
    border-radius: 999px;
    border: 1px solid #e4e8f0;
    background: #f5f6fa;
    padding: .5rem .85rem;
    font-size: .82rem;
    width: 100%;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.cb-filter__search:focus {
    border-color: rgba(23, 50, 164, .4);
    box-shadow: 0 0 0 .15rem rgba(23, 50, 164, .1);
    background: #fff;
}

.cb-filter__list {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.cb-filter__list .form-check-label {
    font-size: .82rem;
    color: #191c2f;
    cursor: pointer;
}

.cb-filter__list .form-check-input:checked {
    background-color: #1732a4;
    border-color: #1732a4;
}

.cb-filter__reset {
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 600;
    background: #f5f6fa;
    color: #191c2f;
    border: 1px solid #e4e8f0;
    padding: .55rem;
    width: 100%;
    cursor: pointer;
    transition: all .25s;
}

.cb-filter__reset:hover {
    background: #fff0f0;
    color: #e84a3d;
    border-color: #e84a3d;
}

@media (max-width: 991.98px) {
    .cb-filter-col {
        display: none;
    }
}

/* ──────────────────────────────────────────────
   5. PRODUCT GRID
   ────────────────────────────────────────────── */
.cb-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 156px);
    justify-content: space-evenly;
    row-gap: 1rem;
}

.cb-product-card {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e4e8f0;
    display: flex;
    flex-direction: column;
    transition: transform .3s, box-shadow .3s, border-color .3s;
}

.cb-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(23, 50, 164, .1);
    border-color: rgba(23, 50, 164, .18);
}

.cb-product-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.cb-product-card__visual {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f5f6fa;
}

.cb-product-card__visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform .35s;
}

.cb-product-card:hover .cb-product-card__visual img {
    transform: scale(1.05);
}

.cb-product-card__info {
    padding: .6rem .65rem;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cb-product-card__name {
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.35;
    color: #191c2f;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.cb-product-card:hover .cb-product-card__name {
    color: #1732a4;
}

.cb-product-card .add-to-quote {
    border-radius: 0 0 12px 12px;
}

/* Responsive grid sizes */
@media (min-width: 576px) {
    .cb-product-grid { grid-template-columns: repeat(auto-fill, 170px); }
}

@media (min-width: 768px) {
    .cb-product-grid { grid-template-columns: repeat(auto-fill, 185px); }
    .cb-product-card__name { font-size: .82rem; }
}

@media (min-width: 1200px) {
    .cb-product-grid { grid-template-columns: repeat(auto-fill, 200px); }
    .cb-product-card__name { font-size: .85rem; }
}

@media (min-width: 1400px) {
    .cb-product-grid { grid-template-columns: repeat(auto-fill, 210px); }
}

/* ──────────────────────────────────────────────
   6. EMPTY STATE
   ────────────────────────────────────────────── */
.cb-cat__empty {
    padding: 3rem 0;
    text-align: center;
    color: #b0b5c3;
}

.cb-cat__empty i {
    font-size: 2.5rem;
    margin-bottom: .5rem;
    display: block;
}
