/* ============================================================
   CB Marketplace — Home Page (Modern)
   Design tokens:
     Font:    Epilogue
     Blue:    #1732a4
     Red:     #ff5858
     Dark:    #191c2f
     Grey BG: #f5f6fa
     Border:  #e4e8f0
   ============================================================ */

/* ──────────────────────────────────────────────
   1. HERO CAROUSEL
   ────────────────────────────────────────────── */
.cb-hero {
    margin-bottom: 0.5rem;
}

.cb-hero__carousel {
    border-radius: 0 0 1rem 1rem;
    overflow: hidden;
}

.cb-hero .carousel-item img {
    width: 100%;
    height: auto;
}

/* Indicators — pill / dot */
.cb-hero .carousel-indicators {
    margin-bottom: 0.75rem;
    gap: 6px;
}

.cb-hero .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #fff;
    opacity: 0.55;
    transition: opacity .3s, width .3s, border-radius .3s;
}

.cb-hero .carousel-indicators .active {
    opacity: 1;
    width: 24px;
    border-radius: 4px;
}

/* Circular prev / next */
.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. SECTIONS
   ────────────────────────────────────────────── */
.cb-sections > .cb-section:nth-child(even) {
    background: #f5f6fa;
}

.cb-section {
    padding: 2rem 0 1.25rem;
}

@media (min-width: 768px) {
    .cb-section { padding: 2.75rem 0 1.75rem; }
}

/* Section header */
.cb-section__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.cb-section__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 .3rem;
    letter-spacing: .3px;
    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-section__title { font-size: 1.35rem; }
}

.cb-section__bar {
    display: block;
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: #ff5858;
}

/* ──────────────────────────────────────────────
   3. HORIZONTAL SCROLL RAIL
   ────────────────────────────────────────────── */
.cb-rail {
    position: relative;
}

.cb-rail__track {
    display: grid;
    grid-template-columns: repeat(auto-fill, 156px);
    justify-content: space-evenly;
    row-gap: 1rem;
    padding: .5rem 0 1.25rem;
}

.cb-rail__fade {
    display: none;
}

.cb-rail__arrow {
    display: none;
}

/* ──────────────────────────────────────────────
   4. CARDS — shared base
   ────────────────────────────────────────────── */
.cb-card {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e4e8f0;
    display: flex;
    flex-direction: column;
    color: #191c2f;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.cb-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(23, 50, 164, .10);
    border-color: rgba(23, 50, 164, .18);
}

/* Shared image area */
.cb-card__visual {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f5f6fa;
}

.cb-card__visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform .35s ease;
}

.cb-card:hover .cb-card__visual img {
    transform: scale(1.05);
}

/* Shared info area */
.cb-card__info {
    padding: .6rem .65rem;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cb-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-card:hover .cb-card__name {
    color: #1732a4;
}

/* ── 4a. PRODUCT card ── */
.cb-card--product {
    border: 1px solid #e4e8f0;
}

.cb-card--product .add-to-quote {
    border-radius: 0 0 12px 12px;
}

.cb-card--product .cb-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
}

/* ── 4b. CATEGORY card ── */
.cb-card--category {
    border: none;
}

.cb-card--category .cb-card__visual {
    aspect-ratio: 3 / 2;
    background: #191c2f;
}

.cb-card--category .cb-card__visual img {
    object-fit: cover;
    padding: 0;
    opacity: .85;
    transition: transform .4s ease, opacity .3s;
}

.cb-card--category:hover .cb-card__visual img {
    transform: scale(1.08);
    opacity: 1;
}

.cb-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: .75rem .65rem;
    background: linear-gradient(0deg, rgba(0,0,0,.65) 0%, transparent 60%);
}

.cb-card__overlay .cb-card__name {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.35);
    text-align: left;
    font-size: .8rem;
}

.cb-card--category:hover .cb-card__name {
    color: #fff;
}

/* ── 4c. BRAND card ── */
.cb-card--brand .cb-card__visual {
    background: #fff;
    aspect-ratio: 4 / 3;
}

.cb-card--brand .cb-card__visual img {
    object-fit: contain;
    padding: 18px;
}

/* ──────────────────────────────────────────────
   5. RESPONSIVE CARD SIZES (mobile-first)
   ────────────────────────────────────────────── */

/* ≥ 576px */
@media (min-width: 576px) {
    .cb-rail__track { grid-template-columns: repeat(auto-fill, 170px); }
}

/* ≥ 768px */
@media (min-width: 768px) {
    .cb-rail__track {
        grid-template-columns: repeat(auto-fill, 185px);
    }
    .cb-card__name  { font-size: .82rem; }
}

/* ≥ 1200px */
@media (min-width: 1200px) {
    .cb-rail__track { grid-template-columns: repeat(auto-fill, 200px); }
    .cb-card__name  { font-size: .85rem; }
}

/* ≥ 1400px (xxl) */
@media (min-width: 1400px) {
    .cb-rail__track { grid-template-columns: repeat(auto-fill, 210px); }
}

/* ──────────────────────────────────────────────
   6. EMPTY STATE
   ────────────────────────────────────────────── */
.cb-empty {
    padding: 4rem 0;
}

.cb-empty i {
    font-size: 2.5rem;
    color: #c3c8d5;
}
