.cakeclub-best-sellers {
    position: relative;
}

/* ===== Grid layout (default) ===== */
.cakeclub-best-sellers__grid,
.cakeclub-best-sellers__grid--layout-grid {
    display: grid;
    grid-template-columns: repeat(var(--best-sellers-columns, 3), 1fr);
    gap: 30px;
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
    transition: opacity 0.3s ease;
}

/* ===== List layout ===== */
.cakeclub-best-sellers__grid--layout-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
    transition: opacity 0.3s ease;
}

.cakeclub-best-sellers__grid--layout-list > .cakeclub-best-sellers__item {
    display: flex;
    gap: 20px;
    align-items: center;
}

.cakeclub-best-sellers__grid--layout-list .wp-block-soulcountry-product-template {
    width: 100%;
}

/* ===== Loading state (Interactivity: context.isLoading) ===== */
.cakeclub-best-sellers--loading .cakeclub-best-sellers__grid {
    opacity: 0.4;
    pointer-events: none;
}

/* ===== Carousel wrapper (provides anchor for side arrows) ===== */
.cakeclub-best-sellers__carousel {
    position: relative;
}

.cakeclub-best-sellers__carousel .cakeclub-best-sellers__grid {
    margin-bottom: 0;
}

/* ===== Align add-to-cart buttons to the bottom of each card ===== */
.cakeclub-best-sellers--align-buttons .cakeclub-best-sellers__item {
    display: flex;
    flex-direction: column;
}

.cakeclub-best-sellers--align-buttons .cakeclub-best-sellers__item > .wp-block-soulcountry-product-template {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.cakeclub-best-sellers--align-buttons .cakeclub-best-sellers__item .product-parent-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.cakeclub-best-sellers--align-buttons .cakeclub-best-sellers__item .add-to-cart-wrapper,
.cakeclub-best-sellers--align-buttons .cakeclub-best-sellers__item .wp-block-button,
.cakeclub-best-sellers--align-buttons .cakeclub-best-sellers__item .add-to-basket {
    margin-top: auto;
}

/* ===== No-results message ===== */
.cakeclub-best-sellers__no-results {
    padding: 2em 1em;
    text-align: center;
    color: var(--color-text-muted, #666);
}

/* ===== Carousel arrows (matches hero-slider style) =====
 * Vertical position is pinned to the centre of the product image via a CSS
 * custom property set from view.js; fall back to a sensible default so the
 * arrows remain usable before the script has measured the image.
 */
.cakeclub-best-sellers__arrow {
    position: absolute;
    top: var(--bs-arrow-center-y, 35%);
    transform: translateY(-50%);
    z-index: 3;

    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: #99c3b9;
    color: #394a78;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 2rem;
    line-height: 1;
    font-weight: 300;
    font-family: inherit;

    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.cakeclub-best-sellers__arrow span {
    transform: translateY(-2px);
    display: inline-block;
}

.cakeclub-best-sellers__arrow--prev {
    left: -30px;
    padding-right: 8px;
}

.cakeclub-best-sellers__arrow--next {
    right: -30px;
    padding-left: 8px;
}

.cakeclub-best-sellers__arrow:hover:not(:disabled) {
    background-color: #db5526;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.cakeclub-best-sellers__arrow:focus {
    outline: 2px solid #99c3b9;
    outline-offset: 2px;
}

.cakeclub-best-sellers__arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== Responsive: 2 columns on tablet ===== */
@media (max-width: 900px) {
    .cakeclub-best-sellers__grid--layout-grid,
    .cakeclub-best-sellers__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .cakeclub-best-sellers__arrow {
        width: 42px;
        height: 42px;
        font-size: 1.6rem;
    }

    .cakeclub-best-sellers__arrow--prev { left: -16px; }
    .cakeclub-best-sellers__arrow--next { right: -16px; }
}

/* ===== Responsive: 1 column on mobile, no pagination chrome ===== */
@media (max-width: 550px) {
    .cakeclub-best-sellers__grid--layout-grid,
    .cakeclub-best-sellers__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cakeclub-best-sellers__grid--layout-list > .cakeclub-best-sellers__item {
        flex-direction: column;
        align-items: stretch;
    }

    /* Interactivity is disabled on mobile: hide the arrows so users just see
     * the first page. view.js also short-circuits pagination at this width. */
    .cakeclub-best-sellers__arrow {
        display: none;
    }
}
