.product-color-swatches {
    position: relative;
    z-index: 3;
    /* One swatch row (1.55rem) so cards without colors keep the same title/price line */
    min-height: 1.55rem;
    margin: 0.3rem 0 0.95rem;
}

.product-color-swatches__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-color-swatches__swatch {
    display: inline-flex;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    padding: 2px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.product-color-swatches__swatch:hover .product-color-swatches__swatch-inner,
.product-color-swatches__swatch:focus-visible .product-color-swatches__swatch-inner {
    transform: scale(1.08);
}

.product-color-swatches__swatch.is-active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #1a1a1a;
}

.product-color-swatches__swatch-inner {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--listing-swatch-color, #d9d9d9);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease;
}

/*
 * Core keeps .product-rating at height:25px even when empty (whitespace breaks :empty).
 * That gap sits between our swatches and the product title.
 */
.cms-element-product-listing .product-box .product-rating,
.product-box .product-rating:empty,
.product-box .product-rating:not(:has(*)) {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
}

.product-box .product-variant-characteristics:empty,
.product-box .product-variant-characteristics-text {
    display: none;
}

.product-box .product-variant-characteristics {
    min-height: 0 !important;
    height: 0;
    margin: 0 !important;
    padding: 0;
    overflow: hidden;
}

.cms-element-product-listing .product-box .product-name {
    margin-top: 0;
}

/* Keep cover size stable when JS swaps variant images (esp. mobile / scale-down) */
.product-box .product-image-wrapper {
    overflow: hidden;
}

.product-box .product-image.is-standard,
.product-box .product-image.is-contain {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}
