/* ═══ RV Product Page Swatches v2.5 ═══
 * HTML structure: <ul.rv-items-wrapper> → <li.rv-item> → <div.rv-item-contents> → <span.rv-item-span>
 * Mirrors WVS class architecture: selected / disabled / no-stock
 */

/* ── Wrapper ── */
ul.rv-items-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 6px 0 0 0;
    padding: 0;
}

/* ── Item (li) ── */
li.rv-item {
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: opacity .15s, transform .15s, box-shadow .15s;
    border-radius: 4px;
    outline: none;
}

/* ── Disabled state (not available) ── */
li.rv-item.disabled {
    pointer-events: none;
    cursor: not-allowed;
    position: relative;
}
li.rv-item.disabled .rv-item-span-color,
li.rv-item.disabled .rv-item-span-button {
    opacity: 0.4;
}

/* ── Out of stock (clickable but marked) ── */
li.rv-item.no-stock {
    pointer-events: auto;
    cursor: pointer;
    position: relative;
}
li.rv-item.no-stock .rv-item-span-color,
li.rv-item.no-stock .rv-item-span-button {
    opacity: 0.5;
}
li.rv-item.no-stock .rv-item-span-button {
    border-style: dashed;
    color: #999;
}

/* ── Red SVG cross overlay for disabled + no-stock ── */
li.rv-item.disabled .rv-item-span-color::before,
li.rv-item.disabled .rv-item-span-button::before,
li.rv-item.no-stock .rv-item-span-color::before,
li.rv-item.no-stock .rv-item-span-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23d32f2f' stroke-linecap='round' stroke-width='1.5' d='M5 5L19 19M19 5L5 19'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 80%;
    z-index: 10;
    pointer-events: none;
}
/* Hide cross when selected and in-stock */
li.rv-item.selected:not(.no-stock):not(.disabled) .rv-item-span-color::before,
li.rv-item.selected:not(.no-stock):not(.disabled) .rv-item-span-button::before {
    display: none;
}

/* ── Contents wrapper ── */
.rv-item-contents {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ═══════ COLOR SWATCHES ═══════ */

.rv-color-items-wrapper li.rv-item {
    border-radius: 50%;
}

.rv-item-span-color {
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: transform .15s, box-shadow .15s;
    position: relative;
}

/* Hover */
li.rv-item:not(.disabled):hover .rv-item-span-color {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* Selected color */
li.rv-item.selected .rv-item-span-color {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
    transform: scale(1.05);
}

/* Selected checkmark (CSS pseudo-element like WVS tick) */
li.rv-item.selected .rv-item-span-color::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 4px rgba(0,0,0,.6);
}

/* Light color check (dark text) — detected via inline border */
li.rv-item.selected .rv-item-span-color[style*="border:1px"]::after {
    color: #333;
    text-shadow: none;
}

/* Multi-color swatch */
.rv-item-span-multi {
    background-size: 100% 100% !important;
}

/* ═══════ BUTTON / TEXT SWATCHES (size, etc) ═══════ */

.rv-button-items-wrapper li.rv-item {
    border-radius: 6px;
}

.rv-item-span-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 38px;
    padding: 0 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    transition: all .15s;
    white-space: nowrap;
    position: relative;
}

/* Hover */
li.rv-item:not(.disabled):hover .rv-item-span-button {
    border-color: #333;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* Selected button */
li.rv-item.selected .rv-item-span-button {
    background: #333;
    border-color: #333;
    color: #fff;
    font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .rv-item-span-color {
        width: 28px;
        height: 28px;
    }
    .rv-item-span-button {
        min-width: 36px;
        height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }
}
