/**
 * Frontend Variation Swatches & Interactive Pills
 * Merch & Carter E-Commerce Suite
 */

.wss-swatches-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 16px 0;
    align-items: center;
}

.wss-swatch-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 40px;
    padding: 0 14px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.wss-swatch-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.wss-swatch-btn.wss-active {
    border-color: #2563eb !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25) !important;
    font-weight: 700;
}

/* Out of Stock Strikethrough */
.wss-swatch-btn.wss-out-of-stock {
    opacity: 0.45;
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.wss-swatch-btn.wss-out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 8%;
    width: 84%;
    height: 1.5px;
    background: #ef4444;
    transform: rotate(-25deg);
}

/* Stock Mini Tag */
.wss-stock-tag {
    font-size: 10px;
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 4px;
    background: #dcfce7;
    color: #15803d;
    font-weight: 700;
}

.wss-stock-tag.low-stock {
    background: #fef3c7;
    color: #b45309;
}

/* Color Circles */
.wss-swatch-color {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    padding: 0;
}

/* Hover Tooltip */
.wss-swatch-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
    z-index: 50;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.wss-swatch-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
}

.wss-swatch-btn:hover .wss-swatch-tooltip {
    opacity: 1;
}

/* Hide native ugly select when our swatches are rendered */
select.wss-replaced-select {
    display: none !important;
}
