/**
 * Warianty produktu — kafelki zamiast list rozwijanych.
 */

table.variations {
    border: none;
    margin: 0 0 1rem;
    width: 100%;
}

table.variations tbody tr {
    display: block;
    margin-bottom: 1.25rem;
}

table.variations tbody tr:last-child {
    margin-bottom: 0;
}

table.variations .label {
    display: block;
    padding: 0 0 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--graphite, #332f2c);
}

table.variations .label label {
    margin: 0;
}

table.variations .value {
    position: relative;
    display: block;
    padding: 0;
}

table.variations select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.variations_form .reset_variations {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--sage, #7a8f82);
    text-decoration: underline;
}

.bt-variation-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
}

.bt-variation-swatch--label {
    min-width: 3rem;
    background: var(--white, #fff);
    border: 1px solid var(--border-soft, #e6e2da);
    border-radius: var(--radius-sm, 12px);
    padding: 0.625rem 1rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--graphite, #332f2c);
    line-height: 1.3;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.bt-variation-swatch--label:hover {
    border-color: var(--sage, #7a8f82);
}

.bt-variation-swatch--label.is-active {
    border-color: var(--sage, #7a8f82);
    background-color: var(--sage, #7a8f82);
    color: var(--white, #fff);
    box-shadow: 0 4px 12px rgba(122, 143, 130, 0.35);
}

.bt-variation-swatch--color {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 50%;
    border: 2px solid var(--border-soft, #e6e2da);
    background: var(--swatch-color, #ccc);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(51, 47, 44, 0.08);
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.bt-variation-swatch--color.is-light {
    border-color: rgba(51, 47, 44, 0.28);
}

.bt-variation-swatch--color:hover {
    transform: scale(1.06);
    border-color: var(--cozy-latte, #c39b7d);
}

.bt-variation-swatch--color.is-active {
    border-color: var(--graphite, #332f2c);
    box-shadow:
        0 0 0 2px var(--white, #fff),
        0 0 0 4px var(--sage, #7a8f82);
}

/* Brak hex w mapie/meta — pastylka z inicjałem + podpis */
.bt-variation-swatch--fallback {
    width: auto;
    min-width: 2.75rem;
    height: auto;
    min-height: 2.75rem;
    padding: 0.35rem 0.55rem 0.3rem;
    border-radius: var(--radius-sm, 12px);
    background: var(--cream-bg, #fbf9f3);
    border: 1px solid var(--border-soft, #e6e2da);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--graphite, #332f2c);
    line-height: 1.15;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.bt-variation-swatch--fallback .bt-variation-swatch__initial {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
}

.bt-variation-swatch--fallback .bt-variation-swatch__caption {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted, #777);
    max-width: 4.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bt-variation-swatch--fallback.is-active {
    border-color: var(--sage, #7a8f82);
    background: var(--white, #fff);
    box-shadow: 0 4px 12px rgba(122, 143, 130, 0.25);
}

.bt-variation-swatch:disabled,
.bt-variation-swatch.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
