/* ─── Carousel wrapper ───────────────────────────────── */
.ct-child-carousel {
    position: relative;
}

/* ─── Arrow row: title area with arrows top-right ───── */
.ct-child-carousel .ct-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    min-height: 32px;   /* reserve space even if no title */
}

.ct-carousel-controls {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* ─── Arrows ─────────────────────────────────────────── */
.ct-carousel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    font-size: 38px;
    color: #999;
    transition: color .2s, opacity .2s;
    line-height: 1;
    padding: 0;
}

.ct-carousel-btn:hover {
    color: #333;
}

.ct-carousel-btn:hover {
    border-color: #333;
    color: #000;
}

/* ─── Track ──────────────────────────────────────────── */
.ct-child-carousel ul.products {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: var(--ct-carousel-gap, 20px);
    padding: 0 !important;
    margin: 0 !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ct-child-carousel ul.products::-webkit-scrollbar {
    display: none;
}

/* ─── Card sizing — desktop ──────────────────────────── */
.ct-child-carousel ul.products li.product {
    flex: 0 0 calc(
        (100% - var(--ct-carousel-gap, 20px) * (var(--desktop-cols) - 1))
        / var(--desktop-cols)
    ) !important;
    width: auto !important;
    scroll-snap-align: start;
    box-sizing: border-box;
}

/* ─── Card sizing — mobile ───────────────────────────── */
@media (max-width: 768px) {
    .ct-child-carousel ul.products li.product {
        flex: 0 0 calc(
            (100% - var(--ct-carousel-gap, 20px) * (var(--mobile-cols) - 1))
            / var(--mobile-cols)
        ) !important;
    }

    /* hide arrows on mobile — swipe handles it */
    .ct-carousel-controls {
        display: none;
    }
}