/**
 * WoodMart Swatch Availability Fix — CSS
 *
 * Marks out-of-stock / unavailable variation swatches with a strike-through
 * while keeping them fully CLICKABLE, even when the theme also applies its own
 * .wd-disabled class. Selecting one shows an "out of stock" notice.
 *
 * @version 1.8.0
 */

/* Force clickability even if the theme keeps .wd-disabled on the swatch. */
.wd-swatches-product .wd-swatch.wsf-oos,
.wd-swatches-product .wd-swatch.wsf-oos.wd-disabled {
    opacity: 0.55;
    position: relative;
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Diagonal strike line */
.wd-swatches-product .wd-swatch.wsf-oos::after {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    background-image: linear-gradient(
        to bottom right,
        transparent calc(50% - 1px),
        currentColor calc(50% - 1px),
        currentColor calc(50% + 1px),
        transparent calc(50% + 1px)
    );
    border-radius: inherit;
    pointer-events: none; /* overlay line must not eat the click */
    z-index: 2;
}

/* Selected unavailable swatch stays visible so the user sees their choice */
.wd-swatches-product .wd-swatch.wsf-oos.wd-active,
.wd-swatches-product .wd-swatch.wsf-oos.selected {
    opacity: 0.8;
}

/* Disabled add-to-cart visual when an unavailable option is chosen */
.single_add_to_cart_button.wc-variation-is-unavailable {
    opacity: 0.5;
    cursor: not-allowed;
}
