/* =====================================================
   WC Brands Carousel – Stylesheet
   ===================================================== */

:root {
    --wcbc-primary:       #1a1a2e;
    --wcbc-accent:        #e94560;
    --wcbc-bg:            #ffffff;
    --wcbc-border:        #e8e8e8;
    --wcbc-shadow:        0 4px 24px rgba(0,0,0,.08);
    --wcbc-shadow-hover:  0 8px 40px rgba(0,0,0,.16);
    --wcbc-radius:        12px;
    --wcbc-nav-size:      42px;
    --wcbc-transition:    .35s cubic-bezier(.4,0,.2,1);
    --wcbc-img-height:    100px;
}

/* ── Wrapper ─────────────────────────────────────── */
.wcbc-carousel-wrapper {
    position: relative;
    overflow: hidden;
    padding: 12px 0 52px;
    user-select: none;
}

/* ── Track (overflow hidden on wrapper, scroll on track) */
.wcbc-carousel {
    display: flex;
    gap: 20px;
    transition: transform var(--wcbc-transition);
    will-change: transform;
}

/* ── Single slide ────────────────────────────────── */
.wcbc-slide {
    flex: 0 0 auto;
    /* width set dynamically by JS via --wcbc-cols variable */
    width: calc((100% - (var(--wcbc-cols, 5) - 1) * 20px) / var(--wcbc-cols, 5));
}

.wcbc-brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--wcbc-primary);
    border-radius: var(--wcbc-radius);
    background: var(--wcbc-bg);
    border: 1.5px solid var(--wcbc-border);
    padding: 18px 12px 14px;
    box-shadow: var(--wcbc-shadow);
    transition: transform var(--wcbc-transition),
                box-shadow var(--wcbc-transition),
                border-color var(--wcbc-transition);
    outline-offset: 3px;
}

.wcbc-brand-link:hover,
.wcbc-brand-link:focus-visible {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--wcbc-shadow-hover);
    border-color: var(--wcbc-accent);
    text-decoration: none;
    color: var(--wcbc-primary);
}

/* ── Brand image ─────────────────────────────────── */
.wcbc-brand-image-wrap {
    width: 100%;
    height: var(--wcbc-img-height);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wcbc-brand-img {
    max-width: 100%;
    max-height: var(--wcbc-img-height);
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform var(--wcbc-transition), filter var(--wcbc-transition);
    filter: grayscale(0%) brightness(1);
}

/* Optional: desaturate on idle, colour on hover */
.wcbc-carousel-wrapper.wcbc--greyscale .wcbc-brand-img {
    filter: grayscale(60%) brightness(1.05);
}
.wcbc-carousel-wrapper.wcbc--greyscale .wcbc-brand-link:hover .wcbc-brand-img {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.06);
}

.wcbc-brand-img.wcbc-placeholder {
    opacity: .35;
}

/* ── Brand name ──────────────────────────────────── */
.wcbc-brand-name {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--wcbc-primary);
    text-align: center;
    line-height: 1.3;
    transition: color var(--wcbc-transition);
}

.wcbc-brand-link:hover .wcbc-brand-name {
    color: var(--wcbc-accent);
}

/* ── Navigation arrows ───────────────────────────── */
.wcbc-nav {
    position: absolute;
    top: 50%;
    transform: translateY(calc(-50% - 24px)); /* offset dots */
    width: var(--wcbc-nav-size);
    height: var(--wcbc-nav-size);
    border-radius: 50%;
    border: 1.5px solid var(--wcbc-border);
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: var(--wcbc-primary);
    transition: background var(--wcbc-transition),
                border-color var(--wcbc-transition),
                color var(--wcbc-transition),
                box-shadow var(--wcbc-transition);
    padding: 0;
    line-height: 1;
}

.wcbc-nav svg {
    width: 18px;
    height: 18px;
    display: block;
}

.wcbc-prev { left: -6px; }
.wcbc-next { right: -6px; }

.wcbc-nav:hover,
.wcbc-nav:focus-visible {
    background: var(--wcbc-accent);
    border-color: var(--wcbc-accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(233,69,96,.35);
    outline: none;
}

.wcbc-nav:disabled,
.wcbc-nav.wcbc-disabled {
    opacity: .35;
    pointer-events: none;
}

/* ── Dots ────────────────────────────────────────── */
.wcbc-dots {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
}

.wcbc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--wcbc-border);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background var(--wcbc-transition),
                transform var(--wcbc-transition),
                width var(--wcbc-transition);
}

.wcbc-dot.wcbc-dot--active {
    background: var(--wcbc-accent);
    width: 22px;
    border-radius: 4px;
}

/* ── Empty state ─────────────────────────────────── */
.wcbc-no-brands {
    text-align: center;
    color: #888;
    padding: 24px;
    font-style: italic;
}

/* ── Responsive breakpoints ──────────────────────── */
@media (max-width: 1024px) {
    .wcbc-slide {
        width: calc((100% - 3 * 20px) / 4);
    }
}

@media (max-width: 768px) {
    .wcbc-slide {
        width: calc((100% - 2 * 20px) / 3);
    }
    :root {
        --wcbc-img-height: 70px;
    }
}

@media (max-width: 520px) {
    .wcbc-slide {
        width: calc((100% - 20px) / 2);
    }
    .wcbc-nav {
        display: none;
    }
    :root {
        --wcbc-img-height: 60px;
        --wcbc-nav-size: 34px;
    }
}

/* ── Reduced motion ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .wcbc-carousel,
    .wcbc-brand-link,
    .wcbc-brand-img,
    .wcbc-nav,
    .wcbc-dot {
        transition: none !important;
        animation: none !important;
    }
}
