/* ========================================
   Category Top Bar
   Desktop only (≥1024px). Scroll-triggered.
   ======================================== */

/* ── Bar base — hidden on mobile, desktop-only ── */
#category-top-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 51;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hidden state — off-screen + invisible, no flash */
#category-top-bar.ctb-hidden {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Visible state */
#category-top-bar.ctb-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* ── Normal header: fades when top bar shows ── */
header.ctb-header-hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Desktop only ───────────────────────────── */
@media (min-width: 1024px) {
    #category-top-bar {
        display: block;
    }
}

/* ── Products scroll row ────────────────────── */
.ctb-products-wrap {
    width: 100%;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.ctb-products-wrap::-webkit-scrollbar {
    display: none;
}

.ctb-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: max-content;
    height: 58px;
    padding: 0 32px;
    gap: 0;
    margin: 0 auto;
    max-width: 1280px;
}

/* ── Divider between products ───────────────── */
.ctb-divider {
    width: 1px;
    height: 30px;
    background: #e5e7eb;
    flex-shrink: 0;
    margin: 0 32px;
}

/* ── Single product cell ────────────────────── */
.ctb-product {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ── Identity group (rank + logo + name) ────── */
.ctb-product-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Rank badge ─────────────────────────────── */
.ctb-rank {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
}

/* ── Product logo ───────────────────────────── */
.ctb-product-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
    background: #fff;
}

/* ── Product name ───────────────────────────── */
.ctb-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: 0;
    line-height: 1.4;
}

/* ── CTA Buttons ────────────────────────────── */
.ctb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    font-family: inherit;
    letter-spacing: 0;
    flex-shrink: 0;
    transition: filter 0.2s ease, transform 0.2s ease;
    -webkit-font-smoothing: antialiased;
}

.ctb-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    stroke-width: 2;
}

/* Campaign / vendor URL → green */
.ctb-btn-campaign {
    background: #097652;
    color: #ffffff;
    filter: brightness(1.1);
    
}

.ctb-btn-campaign:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Lead popup → indigo */
.ctb-btn-lead {
    background: #4f46e5;
    color: #ffffff;
    filter: brightness(1.1);
}

.ctb-btn-lead:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.ctb-btn:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* ── Reduced motion ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #category-top-bar,
    .ctb-btn {
        transition: none !important;
    }
}