.single-product .sts-pdp-shelves {
    --shelf-gap: clamp(10px, 1.25vw, 18px);
    width: 100%;
    min-width: 0;
    max-width: var(--container-max-width, 1140px);
    margin-inline: auto;
    color: #231f20;
    container: sts-shelves / inline-size;
}

.single-product .sts-product-shelf {
    --shelf-columns: 2;
    box-sizing: border-box;
    display: block;
    min-width: 0;
    margin: 0;
    padding: clamp(20px, 3vw, 38px) 0 0;
}

.single-product .sts-product-shelf[hidden],
.single-product .sts-shelf-controls[hidden] {
    display: none !important;
}

.single-product .sts-shelf-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    margin: 0 0 .75rem;
}

.single-product .sts-shelf-heading > h2 {
    min-width: 0;
    margin: 0;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-weight: 700;
    font-size: clamp(1.15rem, 2.25vw, 1.6rem);
    line-height: 1.2;
    letter-spacing: -.025em;
    text-align: start;
    text-transform: none;
}

.single-product .sts-shelf-controls {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
}

:root body.single-product .sts-shelf-controls > button {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: #252220;
    font-size: 0;
    cursor: pointer;
}

/* The visible circle is smaller than its touch target. */
.single-product .sts-shelf-controls > button::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px solid #cfc9c7;
    border-radius: 50%;
}
.single-product .sts-shelf-controls > button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border: solid currentColor;
    border-width: 0 1.7px 1.7px 0;
    transform: translate(calc(-50% - 1px), -50%) rotate(-45deg);
}
.single-product .sts-shelf-controls > button[data-shelf-prev]::after {
    transform: translate(calc(-50% + 1px), -50%) rotate(135deg);
}
.single-product .sts-shelf-controls > button > svg { display: none; }
:root body.single-product .sts-shelf-controls > button:disabled {
    opacity: .36;
    cursor: default;
}
@media (hover: hover) {
    .single-product .sts-shelf-controls > button:enabled:hover::before { background-color: #f5f2ee; }
    .single-product .sts-shelf-controls > button::after { z-index: 1; }
}

:root body.single-product [data-sts-shelves] .sts-product-shelf ul.products.sts-shelf-track {
    display: grid !important;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-auto-flow: column;
    grid-template-columns: none !important;
    grid-auto-columns: calc((100% + var(--shelf-gap)) / var(--shelf-columns) - var(--shelf-gap));
    grid-template-rows: auto;
    align-items: start !important;
    gap: 0 var(--shelf-gap) !important;
    margin: 0 !important;
    padding: 3px 0 12px !important;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-color: #a49b97 #f2efec;
    scrollbar-width: thin;
    list-style: none;
}
.single-product .sts-shelf-track::-webkit-scrollbar { height: 5px; }
.single-product .sts-shelf-track::-webkit-scrollbar-track { background: #f2efec; }
.single-product .sts-shelf-track::-webkit-scrollbar-thumb { background: #a49b97; border-radius: 6px; }
.single-product .sts-shelf-track > li.product { scroll-snap-align: start; }
.single-product :is(.sts-shelf-track, .sts-shelf-controls button):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}
:root body.single-product .sts-shelf-track > li.product > a:focus-visible {
    outline-offset: -2px !important;
}

@container sts-shelves (min-width: 510px) {
    .single-product .sts-product-shelf { --shelf-columns: 3; }
}
@container sts-shelves (min-width: 680px) {
    .single-product .sts-product-shelf { --shelf-columns: 4; }
}
@container sts-shelves (min-width: 900px) {
    .single-product .sts-product-shelf { --shelf-columns: 6; }
}

/* Elementor's 100% widget height can reserve the old height after recent products arrive. */
body.single-product .elementor-widget-jet-single-related:has([data-sts-shelves]),
body.single-product .elementor-widget-jet-single-related > .elementor-widget-container:has([data-sts-shelves]),
body.single-product .elementor-13311 :is(.elementor-element-caed985, .elementor-element-caed985 > .e-con-inner, .elementor-element-6e57541):has([data-sts-shelves]) {
    --container-widget-height: auto;
    height: auto !important;
    max-height: none !important;
}
body.single-product .elementor-widget-jet-single-related:has([data-sts-shelves]) {
    flex: 0 0 auto !important;
    min-height: var(--sts-shelf-host-height, auto) !important;
}
