/*
 * Tailovo Variant Swatches — tvs-swatches.css v1.1.0
 */

/* ── Hidden select: keep in DOM for WC JS but invisible ── */
.tvs-hidden-select {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ── WC variations table: label stacks above swatches ── */
table.variations,
table.variations tbody,
table.variations tr {
    display: block;
    width: 100%;
    border: 0 !important;
}

table.variations th.label {
    display: block;
    width: 100%;
    white-space: normal;
    vertical-align: top;
    padding-bottom: 4px;
    border: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
}

table.variations td.value {
    display: block;
    width: 100%;
    padding-top: 0;
    border: 0 !important;
    border-top: 0 !important;
    box-shadow: none !important;
}


/* Selected value shown inline in th label */
.tvs-th-value {
    font-weight: 400;
    color: #222;
    margin-left: 3px;
}


/* ── Swatch list (ul) ─────────────────────────────────── */
.tvs-swatch-wrap {
    list-style: none;
    margin: 0 0 8px 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ── Swatch item (li) base ────────────────────────────── */
.tvs-swatch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid rgb(217, 217, 217);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}

.tvs-swatch:hover {
    border-color: #999;
    transform: translateY(-1px);
}

.tvs-swatch:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.tvs-swatch.tvs-swatch--active {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 1px rgb(0, 0, 0) inset, 0 0 0 1px rgb(0, 0, 0);
}

.tvs-swatch.tvs-swatch--disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Image swatch ─────────────────────────────────────── */
.tvs-swatch.tvs-swatch--image {
    padding: 0;
    overflow: hidden;
    background: #f5f5f5;
}

.tvs-swatch.tvs-swatch--image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    pointer-events: none;
}

/* ── Color swatch ─────────────────────────────────────── */
.tvs-swatch.tvs-swatch--color {
    padding: 0;
    overflow: hidden;
}

.tvs-swatch-color {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

/* ── Button / Text swatch ─────────────────────────────── */
.tvs-swatch.tvs-swatch--button {
    padding: 6px 14px;
    background: #fff;
    border-color: #d0d0d0;
    border-radius: 4px;
    margin: 0;
}

.tvs-swatch.tvs-swatch--button:hover {
    border-color: #1a1a1a;
    background: #fafafa;
}

.tvs-swatch.tvs-swatch--button.tvs-swatch--active {
    border-color: #1a1a1a;
    background: #fff;
    box-shadow: 0 0 0 1px #1a1a1a;
}

.tvs-swatch-text {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    line-height: 1.3;
}

/* ── Size variants ────────────────────────────────────── */
.tvs-swatch-wrap--small .tvs-swatch.tvs-swatch--image,
.tvs-swatch-wrap--small .tvs-swatch.tvs-swatch--color {
    width: 48px;
    height: 48px;
    min-width: 48px;
}

.tvs-swatch-wrap--medium .tvs-swatch.tvs-swatch--image,
.tvs-swatch-wrap--medium .tvs-swatch.tvs-swatch--color {
    width: 75px;
    height: 75px;
    min-width: 75px;
    margin: 0;
}

.tvs-swatch-wrap--large .tvs-swatch.tvs-swatch--image,
.tvs-swatch-wrap--large .tvs-swatch.tvs-swatch--color {
    width: 80px;
    height: 80px;
    min-width: 80px;
}

.tvs-swatch-wrap--small .tvs-swatch.tvs-swatch--button {
    padding: 4px 10px;
    font-size: 12px;
}

.tvs-swatch-wrap--large .tvs-swatch.tvs-swatch--button {
    padding: 8px 18px;
    font-size: 14px;
}

/* ── Tooltip (pure CSS) ───────────────────────────────── */
.tvs-swatch[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, .8);
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 999;
}

/* ── WooCommerce table alignment ──────────────────────── */
.variations td.value {
    vertical-align: top;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 600px) {

    .tvs-swatch-wrap--large .tvs-swatch.tvs-swatch--image,
    .tvs-swatch-wrap--large .tvs-swatch.tvs-swatch--color {
        width: 64px;
        height: 64px;
    }

    .tvs-swatch-wrap--medium .tvs-swatch.tvs-swatch--image,
    .tvs-swatch-wrap--medium .tvs-swatch.tvs-swatch--color {
        width: 56px;
        height: 56px;
    }

    .tvs-swatch-wrap {
        gap: 6px;
    }
}


/* ── Hide WooCommerce variation info block ─────────────── */
.woocommerce-variation.single_variation {
    display: none !important;
}