.spb-el-bestseller_carousel {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
}

.spb-bestsellers-frame.is-boxed {
    margin-inline: auto;
    max-width: var(--spb-max-width, 1180px);
}

.spb-bestsellers-frame.is-wide {
    grid-column: 1 / -1;
}

:is(.shop-page-builder, .spb-preview-page) > .spb-bestsellers-section {
    --spb-bestsellers-gutter: clamp(.875rem, 2vw, 1.5rem);
}

:is(.shop-page-builder[style*="--spb-section-scale:normal"], .spb-preview-page[data-spb-section-spacing="normal"]) > .spb-section.spb-bestsellers-section.spb-pad-desktop-normal.spb-pad-mobile-normal {
    padding-block: clamp(1.25rem, 2.5vw, 2.25rem);
}

:is(.shop-page-builder, .spb-preview-page) > .spb-section.spb-bestsellers-section-wide {
    padding-inline: 0;
}

:is(.shop-page-builder, .spb-preview-page) > .spb-section.spb-bestsellers-section-wide > .spb-inner {
    max-width: none;
    width: 100%;
}

.spb-preview-page > .spb-bestsellers-section-wide > .spb-inner > .spb-slot {
    border-inline-width: 0;
    padding-inline: 0;
}

.spb-preview-page > .spb-bestsellers-section-wide > .spb-inner > .spb-slot > .spb-bestsellers-frame {
    border: 0;
    padding: 0;
}

.spb-preview-page > .spb-bestsellers-section-wide > .spb-inner > .spb-slot > .spb-slot-add {
    grid-column: 1 / -1;
    margin-inline: auto;
    width: calc(100% - var(--spb-bestsellers-gutter) * 2);
}

.spb-preview-page .spb-slot.is-selected:has(> .spb-bestsellers-frame.is-selected):not(.is-drop) {
    background: transparent;
    border-color: transparent;
}

.spb-preview-page .spb-el.spb-bestsellers-frame.is-selected {
    border-color: transparent;
    box-shadow: none;
}

.spb-preview-page .spb-bestsellers-section.spb-block-selected:has(.spb-bestsellers-frame.is-selected) {
    outline: none;
}

.spb-admin-preview:not(.is-clean-preview) .spb-bestsellers-frame.is-selected > .spb-bestsellers {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

:is(.shop-page-builder, .spb-preview-page):has(> .spb-section:not(.spb-bestsellers-section-wide) > .spb-inner > .spb-slot > .spb-bestsellers-frame.is-wide) {
    container-type: inline-size;
}

:is(.shop-page-builder, .spb-preview-page) > .spb-section:not(.spb-bestsellers-section-wide) > .spb-inner > .spb-slot > .spb-bestsellers-frame.is-wide {
    width: 100cqw;
    margin-inline: calc((100% - 100cqw) / 2);
}

.spb-bestsellers {
    box-sizing: border-box;
    container-type: inline-size;
    font-family: var(--spb-body-font, Roboto, Arial, sans-serif);
}

.spb-bestsellers-frame.is-wide .spb-bestsellers,
.spb-bestsellers.has-background {
    padding-inline: var(--spb-bestsellers-gutter, clamp(.875rem, 2vw, 1.5rem));
}

.spb-bestsellers.has-background {
    background-color: var(--spb-bestsellers-background);
    padding-block: .9rem;
}

.spb-bestsellers .shop-card-price,
.spb-bestsellers .spb-home-product-card-price {
    font-family: inherit;
}

.spb-bestsellers :is(h2, h3, .spb-home-product-card-title) {
    font-family: var(--spb-heading-font, Montserrat, Roboto, sans-serif);
}

.spb-bestsellers-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .65rem 1rem;
    margin-bottom: .85rem;
}

.spb-bestsellers-header h2 {
    margin: 0;
    font-size: clamp(1.25rem, 3cqw, 1.75rem);
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.spb-bestsellers-controls {
    display: flex;
    gap: .35rem;
}

.spb-bestsellers-controls[hidden],
.spb-bestsellers-controls [hidden] {
    display: none;
}

.spb-bestsellers-controls button {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid #d9dedb;
    border-radius: 50%;
    color: #1b2723;
    background: #fff;
    font-size: 1.28rem;
    line-height: 1;
    cursor: pointer;
}

.spb-bestsellers-controls button:hover {
    background: #eef7f5;
}

.spb-bestsellers-track {
    --spb-bestsellers-gap: .75rem;
    --spb-bestsellers-auto-columns: 2;
    --spb-bestsellers-capacity: 2;
    --spb-bestsellers-columns: min(var(--spb-bestsellers-desktop-columns, var(--spb-bestsellers-auto-columns)), var(--spb-bestsellers-capacity));
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% + var(--spb-bestsellers-gap)) / var(--spb-bestsellers-columns) - var(--spb-bestsellers-gap));
    gap: var(--spb-bestsellers-gap);
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: .4rem;
}

.spb-bestsellers-track > * {
    align-self: stretch;
    min-width: 0;
}

.spb-bestsellers-track > .shop-card {
    grid-template-rows: auto 1fr;
}

.spb-bestsellers-track .shop-card-media {
    height: auto;
    aspect-ratio: 1;
}

.spb-bestsellers-track .shop-card-body {
    grid-template-rows: 1fr auto;
}

.spb-bestsellers-track :is(.shop-card-info > p:first-child, .shop-card-body h3, .spb-home-product-card-title, .spb-home-product-card-category, .spb-bestsellers-details > strong) {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spb-bestsellers-track :is(.shop-card-price, .spb-home-product-card-price, .spb-bestsellers-price) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .15rem .4rem;
    min-width: 0;
}

.spb-bestsellers-track .shop-price-current {
    order: -1;
    white-space: nowrap;
}

.spb-bestsellers-track .shop-price-original {
    color: #61726a;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: line-through;
    white-space: nowrap;
}

.spb-bestsellers-item {
    position: relative;
    display: flex;
    overflow: hidden;
    align-items: center;
    gap: .65rem;
    border: 1px solid #d9dedb;
    border-radius: .65rem;
    background: #fff;
    color: #1b2723;
    text-decoration: none;
    line-height: 1.3;
}

.spb-bestsellers-item:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -3px;
}

.spb-bestsellers-item img {
    display: block;
    object-fit: cover;
}

.spb-bestsellers-details {
    display: grid;
    gap: .25rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.spb-bestsellers-price {
    font-weight: 700;
    color: var(--shop-primary, #185642);
}

.spb-bestsellers-price .shop-price-current {
    color: inherit;
}

.spb-bestsellers-track.is-photo .spb-bestsellers-item {
    aspect-ratio: 1;
    background: #eef7f5;
}

.spb-bestsellers-track.is-photo img {
    width: 100%;
    height: 100%;
}

.spb-bestsellers-track.is-photo .spb-bestsellers-details {
    position: absolute;
    inset: .5rem .5rem auto;
    padding: .42rem .6rem;
    border-radius: .35rem;
    background: #fff;
    font-size: .875rem;
}

.spb-bestsellers-track.is-compact {
    --spb-bestsellers-auto-columns: 1;
}

.spb-bestsellers-track.is-compact .spb-bestsellers-item {
    container: bestseller-card / inline-size;
    gap: .5rem;
    min-height: 4.25rem;
    padding: .55rem .6rem;
}

.spb-bestsellers-track.is-compact img {
    flex: 0 0 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .4rem;
}

.spb-bestsellers-track.is-compact .spb-bestsellers-details {
    font-size: .875rem;
    line-height: 1.25;
}

.spb-bestsellers-rank {
    display: grid;
    flex: 0 0 1.4rem;
    height: 1.4rem;
    place-items: center;
    border-radius: 50%;
    background: #e8f3ee;
    color: #185642;
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

@container (max-width: 359px) {
    .spb-bestsellers-track.is-card {
        --spb-bestsellers-auto-columns: 1;
    }
    .spb-bestsellers-track.is-compact {
        --spb-bestsellers-capacity: 1;
    }
}

@container (width < 520px) {
    .spb-bestsellers-track {
        --spb-bestsellers-columns: min(var(--spb-bestsellers-mobile-columns, var(--spb-bestsellers-auto-columns)), var(--spb-bestsellers-capacity));
    }
}

@container bestseller-card (width < 190px) {
    .spb-bestsellers-rank {
        position: absolute;
        inset: .3rem auto auto .35rem;
        width: 1.2rem;
        height: 1.2rem;
    }

    .spb-bestsellers-track.is-compact img {
        flex-basis: 2.25rem;
        width: 2.25rem;
        height: 2.25rem;
    }
}

@container (360px <= width < 480px) {
    .spb-bestsellers-track.is-photo {
        --spb-bestsellers-capacity: 3;
    }
}

@container (min-width: 480px) {
    .spb-bestsellers-track {
        --spb-bestsellers-capacity: 3;
    }
}

@container (min-width: 520px) {
    .spb-bestsellers-track {
        --spb-bestsellers-auto-columns: 3;
    }

    .spb-bestsellers-track.is-compact {
        --spb-bestsellers-auto-columns: 2;
    }
}

@container (min-width: 700px) {
    .spb-bestsellers-track { --spb-bestsellers-capacity: 4; }
}

@container (min-width: 850px) {
    .spb-bestsellers-track {
        --spb-bestsellers-auto-columns: 4;
    }

    .spb-bestsellers-track.is-compact {
        --spb-bestsellers-auto-columns: 3;
    }
}

@container (min-width: 870px) {
    .spb-bestsellers-track { --spb-bestsellers-capacity: 5; }
}

@container (min-width: 1040px) {
    .spb-bestsellers-track { --spb-bestsellers-capacity: 6; }
}

@container (min-width: 1100px) {
    .spb-bestsellers-track {
        --spb-bestsellers-auto-columns: 5;
    }
    .spb-bestsellers-track.is-compact {
        --spb-bestsellers-auto-columns: 4;
    }
}

@container (min-width: 1210px) {
    .spb-bestsellers-track { --spb-bestsellers-capacity: 7; }
}

@container (min-width: 1380px) {
    .spb-bestsellers-track { --spb-bestsellers-capacity: 8; }
    .spb-bestsellers-track.is-compact { --spb-bestsellers-auto-columns: 5; }
}
