/* ============================================================
   Sheen Variation Swatches  v2.0
   ============================================================ */

:root {
    --sheen-size: 34px;
    --sheen-gap: 8px;
    --sheen-ring: #222;
    --sheen-oos-opacity: 0.38;
    --sheen-tip-bg: rgba(20,20,20,.92);
    --sheen-loop-size: 20px;
}

/* ── Reset list styles ─────────────────────────────────────── */
.sheen-swatches-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sheen-gap);
    align-items: center;
}

/* ── Each swatch <li> ──────────────────────────────────────── */
.sheen-swatch {
    position: relative;
    width: var(--sheen-size);
    height: var(--sheen-size);
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
    transition: border-color .18s, transform .15s, box-shadow .18s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

/* Inner circle (colour fill) */
.sheen-swatch-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,.12);
    overflow: hidden;
    pointer-events: none;
}

/* Text label for non-colour swatches */
.sheen-swatch-label {
    font-size: 9px;
    line-height: 1.2;
    text-align: center;
    color: #555;
    padding: 2px;
    word-break: break-word;
}

/* ── Hover (available only) ────────────────────────────────── */
.sheen-swatch:not(.is-oos):hover,
.sheen-swatch:not(.is-oos):focus-visible {
    transform: scale(1.12);
    border-color: var(--sheen-ring);
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
    z-index: 2;
}

/* ── Selected ──────────────────────────────────────────────── */
.sheen-swatch.is-selected {
    border-color: var(--sheen-ring);
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 4px var(--sheen-ring);
}

/* ── Out-of-stock ──────────────────────────────────────────── */
.sheen-swatch.is-oos {
    cursor: not-allowed;
    opacity: var(--sheen-oos-opacity);
    pointer-events: auto; /* keep for tooltip */
}
.sheen-swatch.is-oos .sheen-swatch-inner {
    filter: saturate(.2) brightness(1.05);
}
/* Diagonal strikethrough */
.sheen-swatch.is-oos::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        transparent calc(50% - 1.2px),
        rgba(100,100,100,.7) calc(50% - 1.2px),
        rgba(100,100,100,.7) calc(50% + 1.2px),
        transparent calc(50% + 1.2px)
    );
    pointer-events: none;
    z-index: 1;
}

/* ── ✕ overlay on OOS ──────────────────────────────────────── */
.sheen-oos-x {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    text-shadow:
        0 0 2px rgba(0,0,0,.8),
        0 1px 4px rgba(0,0,0,.5);
    pointer-events: none;
    border-radius: 50%;
    z-index: 2;
    line-height: 1;
}

/* ── Tooltip ───────────────────────────────────────────────── */
.sheen-tooltip {
    position: absolute;
    bottom: calc(100% + 9px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: var(--sheen-tip-bg);
    color: #fff;
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-family: inherit;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .17s, transform .17s;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.4;
}
.sheen-tooltip em {
    font-style: normal;
    color: #ffaaaa;
    font-size: 10px;
}
.sheen-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--sheen-tip-bg);
}
/* Show */
.sheen-swatch:hover  .sheen-tooltip,
.sheen-swatch:focus-visible .sheen-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Shop loop mini dots ───────────────────────────────────── */
.sheen-loop-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px 0 3px;
    align-items: center;
}
.sheen-loop-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--sheen-loop-size);
    height: var(--sheen-loop-size);
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.14);
    flex-shrink: 0;
    position: relative;
    transition: transform .14s;
    box-sizing: border-box;
}
.sheen-loop-dot:hover { transform: scale(1.3); z-index: 1; }
.sheen-loop-dot.is-oos {
    opacity: .38;
    filter: saturate(.2);
}
.sheen-loop-dot.is-oos::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        transparent calc(50% - 1px),
        rgba(100,100,100,.7) calc(50% - 1px),
        rgba(100,100,100,.7) calc(50% + 1px),
        transparent calc(50% + 1px)
    );
}
.sheen-loop-dot .sheen-oos-x {
    font-size: 10px;
    z-index: 2;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
    :root {
        --sheen-size: 28px;
        --sheen-loop-size: 16px;
        --sheen-gap: 6px;
    }
    .sheen-oos-x { font-size: 12px; }
}
