/* ==========================================================================
   Mayordent Product Swatches — Frontend
   ========================================================================== */

/* ── Wrapper: horizontal wrap ────────────────────────────────────────────── */
.wcvs-swatches {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 8px 0 12px !important;
    padding: 0 !important;
    width: 100% !important;
    list-style: none !important;
    background: transparent !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

/* ── Tarjeta base ────────────────────────────────────────────────────────── */
.wcvs-swatch {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 0 12px !important;
    height: 52px !important;
    min-height: 52px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-radius: 9px !important;
    border: 1.5px solid #e0e0e0 !important;
    background: #ffffff !important;
    cursor: pointer !important;
    position: relative !important;
    box-sizing: border-box !important;
    text-align: left !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease !important;
    user-select: none !important;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    font-family: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04) !important;
}

.wcvs-swatch:hover {
    border-color: #bbb !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06) !important;
    background: #fafafa !important;
}

/* ── SELECCIONADO ────────────────────────────────────────────────────────── */
.wcvs-swatch.is-selected {
    border-color: #1a1a1a !important;
    background: #fafafa !important;
    box-shadow:
        0 0 0 1px #1a1a1a,
        0 4px 16px rgba(0,0,0,0.13),
        0 2px 6px rgba(0,0,0,0.08) !important;
}

/* ── Radio button a la derecha ───────────────────────────────────────────── */
.wcvs-radio {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    border-radius: 50% !important;
    border: 2px solid #d0d0d0 !important;
    background: #fff !important;
    margin-left: 4px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: border-color 0.18s ease, background 0.18s ease !important;
    position: relative !important;
}

.wcvs-swatch.is-selected .wcvs-radio {
    border-color: #1a1a1a !important;
    background: #1a1a1a !important;
}

.wcvs-swatch.is-selected .wcvs-radio::after {
    content: '' !important;
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    background: #fff !important;
    display: block !important;
}

/* ── Visuals ─────────────────────────────────────────────────────────────── */
.wcvs-swatch-inner {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}

.wcvs-color-inner {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    border: 1.5px solid rgba(0,0,0,0.10) !important;
    flex-shrink: 0 !important;
    display: block !important;
}

.wcvs-image-inner {
    width: 34px !important;
    height: 34px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #f0f0f0 !important;
    flex-shrink: 0 !important;
}

.wcvs-image-inner img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wcvs-no-image {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #aaa !important;
    text-transform: uppercase !important;
}

.wcvs-label-inner {
    display: none !important;
}

/* ── Contenido (label + stock) ───────────────────────────────────────────── */
.wcvs-swatch-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    text-align: left !important;
    min-width: 0 !important;
    gap: 2px !important;
}

.wcvs-swatch-label {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #222 !important;
    line-height: 1.3 !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    pointer-events: none !important;
    white-space: normal !important;
    word-break: break-word !important;
}

.wcvs-swatch.is-selected .wcvs-swatch-label {
    font-weight: 600 !important;
    color: #1a1a1a !important;
}

/* ── Stock ───────────────────────────────────────────────────────────────── */
.wcvs-stock {
    font-size: 11px !important;
    line-height: 1.2 !important;
    font-weight: 400 !important;
    pointer-events: none !important;
    white-space: normal !important;
}

.wcvs-stock.in-stock    { color: #2e7d32 !important; }
.wcvs-stock.low-stock   { color: #e65100 !important; font-weight: 500 !important; }
.wcvs-stock.out-of-stock { color: #999 !important; }

/* ── Sin stock ───────────────────────────────────────────────────────────── */
.wcvs-swatch.is-disabled {
    opacity: 0.75 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #f8f8f8 !important;
}
.wcvs-swatch.is-disabled .wcvs-swatch-label {
    text-decoration: line-through !important;
    color: #888 !important;
}
.wcvs-swatch.is-disabled .wcvs-stock {
    text-decoration: none !important;
    color: #aaa !important;
}

/* ── Label del atributo a la izquierda ───────────────────────────────────── */
.variations th.label,
.variations th.label label,
table.variations th,
table.variations th label {
    text-align: left !important;
}

/* ── Select oculto ───────────────────────────────────────────────────────── */
select.wcvs-hidden-select {
    display: none !important;
}

/* ── Responsivo ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .wcvs-swatch {
        padding: 0 10px !important;
        height: 48px !important;
    }
}
