/*
 * ULK Supply - Image Color Swatches
 */

body.single-product .ulk-color-swatches {
    margin: 18px 0 14px;
}

body.single-product .ulk-color-swatches__label {
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #444;
}

body.single-product .ulk-color-swatches__current {
    font-weight: 500;
}

body.single-product .ulk-color-swatches__options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

body.single-product .ulk-color-swatch {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 62px;
    height: 62px;
    padding: 4px;

    border: 1px solid #d5d5d5;
    border-radius: 50%;

    background: #fff;
    cursor: pointer;

    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

body.single-product .ulk-color-swatch:hover {
    border-color: #888;
}

body.single-product .ulk-color-swatch.is-selected {
    border: 2px solid #555;
    box-shadow: 0 0 0 2px #fff inset;
}

body.single-product .ulk-color-swatch__image {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 50%;
    background: #fff;
}

body.single-product .ulk-color-swatch__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

body.single-product .ulk-color-swatch.is-unavailable {
    opacity: .45;
    cursor: not-allowed;
}

body.single-product .ulk-color-swatch.is-unavailable::after {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    top: 50%;
    height: 1px;
    background: #b22222;
    transform: rotate(-45deg);
    transform-origin: center;
}

/*
 * Hide only the native Color row.
 * The real WooCommerce select remains in the DOM so its
 * variation JavaScript continues working normally.
 */
body.single-product
form.variations_form
table.variations
tr:has(select[name="attribute_pa_color"]) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

/* Mobile */
@media (max-width: 767px) {

    body.single-product .ulk-color-swatch {
        width: 56px;
        height: 56px;
    }

    body.single-product .ulk-color-swatches__options {
        gap: 8px;
    }
}


/* =========================================================
 * ULK SWATCHES - MOBEX NATIVE COLOR SELECT HIDE FIX
 * Keep WooCommerce select active in DOM, but visually hidden.
 * ========================================================= */

body.single-product form.variations_form table.variations {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}


/* =========================================================
 * ULK IMAGE SWATCHES
 * Hide Mobex duplicate Color selector.
 * WooCommerce native variation select remains active.
 * ========================================================= */

body.single-product
.summary
.et__variation-swatches
#attr-pa_color {
    display: none !important;
}

/*
 * Hide Mobex Clear row when Color is the only
 * Mobex variation selector on this product.
 */
body.single-product
.summary
.et__variation-swatches
.et__clear_variation-swatches {
    display: none !important;
}
