section.product #product_cart .product-variant-choices,
section.product #product_cart .select_box--previews {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-height: 420px;
    padding: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c9d3bf transparent;
}

section.product .variations .product-variant-choices > div {
    min-width: 0;
    margin: 0 !important;
}

section.product #product_cart .product-variant-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 84px;
    margin: 0;
    padding: 10px;
    border: 1px solid #d5ddce;
    border-radius: 6px;
    background: #fff;
    color: #253326;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    text-align: left;
    white-space: normal;
    cursor: pointer;
}

section.product #product_cart .select_box--previews::after {
    content: none;
}

/* The legacy select picker styles every nested span as an individual button. */
section.product #product_cart :where(.product-variant-label) span {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    align-items: initial;
    justify-content: initial;
    letter-spacing: normal;
    text-transform: none;
}

section.product .variations .product-variant-label:focus-visible,
section.product .variations .btn-check:focus-visible + .product-variant-label {
    outline: 2px solid var(--smpls-color-theme);
    outline-offset: 2px;
}

section.product #product_cart .select_option.selected.product-variant-label {
    border-color: var(--smpls-color-theme);
    background: #e8f0df !important;
    color: #253326 !important;
    box-shadow: inset 3px 0 var(--smpls-color-theme);
}

@media (max-width: 1199.98px) and (min-width: 992px), (max-width: 575.98px) {
    section.product #product_cart .product-variant-choices,
    section.product #product_cart .select_box--previews {
        grid-template-columns: minmax(0, 1fr);
    }
}

section.product #product_cart .product-variant-label > .product-variant-label__image {
    display: block;
    flex: 0 0 48px;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 5px;
    background: #fff;
}

section.product #product_cart .product-variant-label__image img {
    display: block;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 48px;
    object-fit: contain;
}

section.product #product_cart .product-variant-label > .product-variant-label__info {
    display: block;
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    white-space: normal;
}

section.product #product_cart .product-variant-label__title {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    white-space: normal;
    font-size: 13px;
    line-height: 1.4;
}

section.product #product_cart .product-variant-label__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 5px;
    color: var(--smpls-color-theme);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    padding: 0;
    white-space: normal;
}

section.product #product_cart .product-variant-label:hover {
    border-color: var(--smpls-color-theme);
    background: #f3f6ef;
    color: #253326;
}

section.product #product_cart .product-variant-label.disabled {
    flex-direction: row;
    align-items: center;
    background: #f0f1ed;
    color: #687163;
    cursor: not-allowed;
    opacity: .8;
}

section.product #product_cart .input-option .btn-check:checked + .product-variant-label {
    border-color: var(--smpls-color-theme);
    /* Override the legacy variant buttons' forced solid background. */
    background: #e8f0df !important;
    color: #253326 !important;
    box-shadow: inset 3px 0 var(--smpls-color-theme);
}

.product-variant-label__unavailable {
    color: #7a8174;
    font-weight: 400;
}

section.product .input-option .product-variant-label.disabled::after {
    content: none;
}

.product-variant-preview {
    position: fixed;
    z-index: 10000;
    width: 224px;
    max-width: calc(100vw - 24px);
    padding: 12px;
    border: 1px solid #dce4d4;
    border-radius: 12px;
    background: #fff;
    color: #253326;
    font-family: var(--smpls-font-primary, 'Roboto Condensed', sans-serif);
    line-height: 1.5;
    box-shadow: 0 10px 40px #25332626;
    pointer-events: none;
}

.product-variant-preview[hidden] {
    display: none;
}

.product-variant-preview > img {
    display: block;
    width: 100%;
    height: 200px;
    border-radius: 6px;
    object-fit: contain;
}

.product-variant-preview__title {
    display: block;
    margin-top: 10px;
    font-size: 15px;
    font-weight: 600;
}

.product-variant-preview__price {
    display: block;
    margin-top: 7px;
    color: var(--smpls-color-theme);
    font-size: 17px;
    font-weight: 600;
}

.product-variant-preview__availability {
    display: block;
    margin-top: 4px;
    color: #687163;
    font-size: 12px;
}
