/**
 * WooCommerce Swatch Styles – LuxThemesPro Minimal
 */

/* ─── SWATCH CONTAINER ───────────────────────────────── */
.lux-swatches {
    margin-bottom: 20px;
}

.lux-swatches__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #333;
    margin-bottom: 10px;
}

.lux-swatches__attr-name {
    color: #333;
}

.lux-swatches__selected-name {
    font-weight: 400;
    color: #666;
    text-transform: none;
    letter-spacing: 0;
}

.lux-swatches__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ─── COLOR SWATCHES ─────────────────────────────────── */
.lux-swatch--color {
    width: 36px;
    height: 36px;
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lux-swatch--color:hover {
    border-color: #ccc;
}

.lux-swatch--color.active {
    border-color: #333;
}

.lux-swatch__color {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Multicolor / pattern support */
.lux-swatch--color[data-value="multicolor"] .lux-swatch__color {
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red) !important;
}

/* White swatch needs a visible border */
.lux-swatch--color .lux-swatch__color[style*="ffffff"],
.lux-swatch--color .lux-swatch__color[style*="FFFFFF"],
.lux-swatch--color .lux-swatch__color[style*="#fff"],
.lux-swatch--color .lux-swatch__color[style*="#FFF"] {
    box-shadow: inset 0 0 0 1px #ddd;
}

/* ─── SIZE SWATCHES ──────────────────────────────────── */
.lux-swatch--size {
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #ccc;
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.lux-swatch--size.active {
    border-color: #333;
    border-width: 2px;
    background: #333;
    color: #fff;
}

.lux-swatch--size.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
    pointer-events: none;
}

.lux-swatch__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ─── SIZE GUIDE LINK ────────────────────────────────── */
.lux-size-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
    font-size: 12px;
    color: #888;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.lux-size-guide-link:hover {
    color: #333;
}

/* ─── DISABLED STATES ────────────────────────────────── */
.lux-swatch--color.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

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

/* ─── TOOLTIP ON HOVER ───────────────────────────────── */
.lux-swatch--color {
    position: relative;
}

.lux-swatch--color::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #333;
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    border-radius: 3px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.lux-swatch--color:hover::before {
    opacity: 1;
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 480px) {
    .lux-swatch--color {
        width: 32px;
        height: 32px;
    }
    .lux-swatch--size {
        min-width: 38px;
        height: 38px;
        padding: 0 10px;
    }
    .lux-swatch__label {
        font-size: 11px;
    }
}

/* ─── WOOCOMMERCE'S DROPDOWN (set by the swatches) ───── */
.woocommerce div.product form.cart .variations select[data-lux-swatch-select] {
    display: none;
}
/* The swatches carry their own label; WooCommerce's label cell is left empty. */
.variations tr:has(select[data-lux-swatch-select]) th.label {
    display: none;
}

/* ─── KEYBOARD FOCUS ─────────────────────────────────── */
.lux-swatch:focus-visible {
    outline: 2px solid var(--lux-wc-primary, #0073aa);
    outline-offset: 2px;
}
