.hoc-swatch-hover-preview {
    --hoc-shp-size: 270px;
    --hoc-shp-radius: 2px;
    --hoc-shp-offset: 12px;

    position: absolute;
    z-index: 999999;
    width: var(--hoc-shp-size);
    max-width: calc(100vw - 16px);
    background: #1e1e1e;
    color: #fff;
    border-radius: var(--hoc-shp-radius);
    box-shadow: 0 12px 32px rgba(0,0,0,.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
    overflow: visible;
    box-sizing: border-box;
}

.hoc-swatch-hover-preview.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hoc-swatch-hover-preview__title {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    box-sizing: border-box;
}

.hoc-swatch-hover-preview__image-wrap {
    width: 100%;
    background: #fff;
    overflow: hidden;
    border-radius: 0 0 var(--hoc-shp-radius) var(--hoc-shp-radius);
}

.hoc-swatch-hover-preview__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(var(--hoc-shp-size) * 1.05);
    object-fit: cover;
    aspect-ratio: 1 / 1;
    margin: 0;
}

.hoc-swatch-hover-preview.hoc-shp-title-bottom {
    display: flex;
    flex-direction: column-reverse;
}

.hoc-swatch-hover-preview.hoc-shp-title-bottom .hoc-swatch-hover-preview__image-wrap {
    border-radius: var(--hoc-shp-radius) var(--hoc-shp-radius) 0 0;
}

.hoc-swatch-hover-preview__arrow {
    position: absolute;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -8px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}

.hoc-swatch-hover-preview[data-placement="top"] .hoc-swatch-hover-preview__arrow {
    bottom: -8px;
    border-top: 8px solid #1e1e1e;
}

.hoc-swatch-hover-preview[data-placement="bottom"] .hoc-swatch-hover-preview__arrow {
    top: -8px;
    border-bottom: 8px solid #1e1e1e;
}

/* Allow keyboard users to see which swatch has focus. */
.single-product .wd-swatch:focus-visible,
.single-product .variable-item:focus-visible,
.single-product [class*="swatch"]:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .hoc-swatch-hover-preview {
        --hoc-shp-size: min(240px, calc(100vw - 24px));
    }
}
