/* Attribute-image controls stay the same size within each related card. */
body.single-product .related-products .wd-swatches-grid.kt-related-image-swatches {
    --wd-swatch-size: 32px;
    --wd-swatch-w: 32px;
    --wd-swatch-h: 32px;
    --wd-swatch-h-sp: 8px;
}

body.single-product .related-products .kt-related-image-swatch .wd-swatch-bg {
    overflow: hidden;
    background-color: #fff;
}

body.single-product .related-products .wd-swatch-bg > .kt-related-term-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: inherit;
    object-fit: cover;
    object-position: center;
}

/* Reserve the original card frame while another color image is loading. */
body.single-product .related-products .wd-product-img-link.kt-related-image-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: var(--kt-related-image-ratio);
    overflow: hidden;
}

body.single-product .related-products .kt-related-image-frame > img,
body.single-product .related-products .kt-related-image-frame > picture,
body.single-product .related-products .kt-related-image-frame > picture > img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    object-position: center;
}

body.single-product .kt-related-before-tabs {
    margin-bottom: 30px;
}

@media (max-width: 767px) {
    body.single-product .kt-related-before-tabs {
        margin-bottom: 20px;
    }
}
