/* HUMVN Variation Swatches */

/* Force hide converted dropdowns and Select2 containers */
.variations select[data-humvn-converted="true"],
.variations_form select[data-humvn-converted="true"],
table.variations select[data-humvn-converted="true"],
.humvn-select-hidden,
.humvn-select-hidden + .select2,
.humvn-select-hidden + .select2-container,
select.humvn-select-hidden ~ .select2,
select.humvn-select-hidden ~ .select2-container,
select[data-humvn-converted="true"] + .select2,
select[data-humvn-converted="true"] + .select2-container,
select[data-humvn-converted="true"] ~ .select2,
select[data-humvn-converted="true"] ~ .select2-container,
.humvn-s2-hidden {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
    clip: rect(0,0,0,0) !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.humvn-swatches-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.humvn-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: all 0.2s ease;
    box-sizing: border-box;
    position: relative;
}

.humvn-swatch:hover {
    border-color: #333;
}

.humvn-swatch.selected {
    border-color: #000;
    box-shadow: 0 0 0 1px #000;
}

.humvn-swatch.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    position: relative;
}

.humvn-swatch.disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #999;
    transform: rotate(-45deg);
}

/* Color Swatches */
.humvn-swatch-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.humvn-swatch-color.light-color {
    border-color: #ccc;
}

.humvn-swatch-color.selected {
    transform: scale(1.1);
}

/* Label/Button Swatches */
.humvn-swatch-label {
    min-width: 40px;
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fff;
    border-radius: 0;
}

.humvn-swatch-label:hover {
    background: #f5f5f5;
}

.humvn-swatch-label.selected {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Image Swatches */
.humvn-swatch-image {
    width: 48px;
    height: 48px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
}

.humvn-swatch-image.selected {
    transform: scale(1.05);
}

/* Tooltip */
.humvn-swatch[title] {
    position: relative;
}

.humvn-swatch[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #333;
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    border-radius: 3px;
    margin-bottom: 5px;
    z-index: 10;
}

.humvn-swatch[title]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .humvn-swatch-color {
        width: 28px;
        height: 28px;
    }

    .humvn-swatch-label {
        min-width: 36px;
        height: 32px;
        padding: 0 10px;
        font-size: 12px;
    }

    .humvn-swatch-image {
        width: 40px;
        height: 40px;
    }
}
