/* image-variation-swatches — frontend.css */

/* ── Swatch container ──────────────────────────────────────── */
.ivs-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px;
}

/* ── Individual swatch button ──────────────────────────────── */
.ivs-swatch {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 3px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
    outline: none;
    min-width: 70px;
}

.ivs-swatch:hover {
    border-color: #aaa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.10);
}

/* ── Active / selected state ───────────────────────────────── */
.ivs-swatch.ivs-active {
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.12);
}

/* ── Out of stock ──────────────────────────────────────────── */
.ivs-swatch.ivs-out-of-stock {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Diagonal slash for OOS */
.ivs-swatch.ivs-out-of-stock::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(0,0,0,.18) 4px,
        rgba(0,0,0,.18) 5px
    );
    pointer-events: none;
}

/* ── Swatch image ──────────────────────────────────────────── */
.ivs-swatch img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    pointer-events: none;
}

/* ── Text fallback (no image) ──────────────────────────────── */
.ivs-text-fallback {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Label below image ─────────────────────────────────────── */
.ivs-swatch-label {
    font-size: 11px;
    line-height: 1.2;
    color: #555;
    max-width: 68px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ivs-swatch.ivs-active .ivs-swatch-label {
    color: #111;
    font-weight: 600;
}

/* ── Responsive ────────────────────────────────────────────── */
@media ( max-width: 480px ) {
    .ivs-swatch img,
    .ivs-text-fallback {
        width: 54px;
        height: 54px;
    }
    .ivs-swatch {
        min-width: 60px;
    }
    .ivs-swatch-label {
        max-width: 58px;
    }
}
