/* Navneleg Suite: WooCommerce variantvalg som knapper */
.single-product .nls-variant-buttons,
.single-product .nl-attr-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 18px;
}

.single-product .nls-variant-buttons .nl-attr-btn,
.single-product .nl-attr-buttons .nl-attr-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #000;
    border-radius: 0;
    background: #fff;
    color: #000;
    min-height: 38px;
    padding: 8px 16px;
    font: inherit;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease, opacity .15s ease;
}

.single-product .nls-variant-buttons .nl-attr-btn:hover:not(:disabled),
.single-product .nl-attr-buttons .nl-attr-btn:hover:not(:disabled) {
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
    transform: translateY(-1px);
}

.single-product .nls-variant-buttons .nl-attr-btn.is-active,
.single-product .nl-attr-buttons .nl-attr-btn.is-active {
    background: #000;
    color: #fff;
}

.single-product .nls-variant-buttons .nl-attr-btn:focus-visible,
.single-product .nl-attr-buttons .nl-attr-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.single-product .nls-variant-buttons .nl-attr-btn.is-disabled,
.single-product .nls-variant-buttons .nl-attr-btn:disabled,
.single-product .nl-attr-buttons .nl-attr-btn.is-disabled,
.single-product .nl-attr-buttons .nl-attr-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.single-product .variations select.nl-attr-select,
.single-product .variations select.nls-variant-select {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 1px !important;
    min-height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.single-product .variations .nl-attr-select2,
.single-product .variations .nls-variant-select2,
.single-product .variations select.nl-attr-select + .select2,
.single-product .variations select.nl-attr-select + .select2-container {
    display: none !important;
}

@media (max-width: 767px) {
    .single-product .nls-variant-buttons,
    .single-product .nl-attr-buttons {
        gap: 6px;
    }

    .single-product .nls-variant-buttons .nl-attr-btn,
    .single-product .nl-attr-buttons .nl-attr-btn {
        min-height: 36px;
        padding: 7px 11px;
        font-size: 13px;
    }
}
/* Color variants: visual swatches while WooCommerce keeps pa_farve matching. */
.single-product .nls-variant-buttons .nl-attr-btn.nl-attr-btn--color,
.single-product .nl-attr-buttons .nl-attr-btn.nl-attr-btn--color {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #111;
    box-shadow: none;
}

.single-product .nls-variant-buttons .nl-attr-btn.nl-attr-btn--color:hover:not(:disabled),
.single-product .nl-attr-buttons .nl-attr-btn.nl-attr-btn--color:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
}

.single-product .nls-variant-buttons .nl-attr-btn.nl-attr-btn--color.is-active,
.single-product .nl-attr-buttons .nl-attr-btn.nl-attr-btn--color.is-active {
    border: 0;
    outline: 0 !important;
    background: transparent;
    color: #111;
    box-shadow: none;
}


.single-product .nls-variant-buttons .nl-attr-btn.nl-attr-btn--color:focus,
.single-product .nls-variant-buttons .nl-attr-btn.nl-attr-btn--color:focus-visible,
.single-product .nl-attr-buttons .nl-attr-btn.nl-attr-btn--color:focus,
.single-product .nl-attr-buttons .nl-attr-btn.nl-attr-btn--color:focus-visible {
    outline: 0 !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
}

.single-product .nls-variant-buttons .nl-attr-btn.nl-attr-btn--color:hover:not(:disabled) .nl-color-swatch,
.single-product .nl-attr-buttons .nl-attr-btn.nl-attr-btn--color:hover:not(:disabled) .nl-color-swatch {
    box-shadow: 0 0 0 2px rgba(0,0,0,.14);
}

.single-product .nls-variant-buttons .nl-attr-btn.nl-attr-btn--color.is-active .nl-color-swatch,
.single-product .nl-attr-buttons .nl-attr-btn.nl-attr-btn--color.is-active .nl-color-swatch,
.single-product .nls-variant-buttons .nl-attr-btn.nl-attr-btn--color:focus-visible .nl-color-swatch,
.single-product .nl-attr-buttons .nl-attr-btn.nl-attr-btn--color:focus-visible .nl-color-swatch {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111;
}
.single-product .nl-color-swatch {
    display: block;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 50%;
    background: var(--nls-swatch);
    box-shadow: none;
}

.single-product .nl-attr-btn--color.is-split .nl-color-swatch {
    background: linear-gradient(
        135deg,
        var(--nls-swatch) 0%,
        var(--nls-swatch) 49.5%,
        var(--nls-swatch-2) 50.5%,
        var(--nls-swatch-2) 100%
    );
}
.single-product .nl-attr-btn--color.is-active .nl-color-swatch::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translate(-50%,-60%) rotate(-45deg);
    filter: drop-shadow(0 0 1px rgba(0,0,0,.65));
}

@media (max-width: 767px) {
    .single-product .nls-variant-buttons .nl-attr-btn.nl-attr-btn--color,
    .single-product .nl-attr-buttons .nl-attr-btn.nl-attr-btn--color {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 3px;
    }
}
/* Mobile layout hardening for variation buttons and color swatches. */
@media (max-width: 767px) {
    .single-product .variations .nls-variant-buttons,
    .single-product .variations .nl-attr-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        margin: 8px 0 18px;
    }

    .single-product .variations .nls-variant-buttons .nl-attr-btn:not(.nl-attr-btn--color),
    .single-product .variations .nl-attr-buttons .nl-attr-btn:not(.nl-attr-btn--color) {
        width: 100%;
        min-width: 0;
        min-height: 46px;
        padding: 9px 10px;
        white-space: normal;
        text-align: center;
        overflow-wrap: anywhere;
        line-height: 1.2;
    }

    .single-product .variations select[name="attribute_pa_farve"] + .nls-variant-buttons,
    .single-product .variations select[name="attribute_pa_farve"] + .nl-attr-buttons {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        width: auto;
    }

    .single-product .variations select[name="attribute_pa_farve"] + .nls-variant-buttons .nl-attr-btn.nl-attr-btn--color,
    .single-product .variations select[name="attribute_pa_farve"] + .nl-attr-buttons .nl-attr-btn.nl-attr-btn--color {
        box-sizing: border-box;
        display: inline-grid !important;
        place-items: center;
        flex: 0 0 42px;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        max-width: 42px !important;
        max-height: 42px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: transparent !important;
        line-height: 1 !important;
        overflow: visible !important;
    }

    .single-product .variations select[name="attribute_pa_farve"] + .nls-variant-buttons .nl-color-swatch,
    .single-product .variations select[name="attribute_pa_farve"] + .nl-attr-buttons .nl-color-swatch {
        box-sizing: border-box;
        display: block !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        border-radius: 50% !important;
        aspect-ratio: 1 / 1;
    }
}
/* Variant buttons/swatches make WooCommerce's separate "Ryd" link redundant. */
.single-product .variations_form .reset_variations {
    display: none !important;
}