/**
 * Variation button swatches (replaces WPC Variation Swatches).
 * Theme styles targeting .wpcvs-term still apply; this file covers layout
 * and the native dropdown hide that the WPC plugin CSS used to provide.
 */

.psw-vs-wrapper.wpcvs-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.psw-vs-wrapper .psw-vs-terms,
.psw-vs-wrapper .wpcvs-terms {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.psw-vs-wrapper select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.single-product .product .summary form.cart .variations td.value {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.psw-vs-wrapper .wpcvs-term {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 42px;
    min-height: 42px;
    padding: 6px 10px;
    border: 1px solid var(--st-text-color, #222);
    border-radius: 3px;
    background: #fff;
    color: var(--st-text-color, #222);
    font-family: var(--st-font-primary, inherit);
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    user-select: none;
    visibility: visible;
}

.psw-vs-wrapper .wpcvs-term .wpcvs-term-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
}

.psw-vs-wrapper .wpcvs-term .wpcvs-term-label {
    padding: 0;
    color: inherit;
}

.psw-vs-wrapper .wpcvs-term.wpcvs-selected {
    border-color: var(--st-secondary-color, #de700f);
    background-color: var(--st-secondary-color, #de700f);
    color: #fff;
}

.psw-vs-wrapper .wpcvs-term.wpcvs-disabled,
.single-product .product .summary form.cart .variations .psw-vs-wrapper .wpcvs-term.wpcvs-disabled {
    display: none !important;
}

.psw-vs-wrapper .wpcvs-term:hover:not(.wpcvs-disabled):not(.wpcvs-selected) {
    outline: 1px solid #999;
    border-color: #fff;
}

.single-product .product .summary form.cart .variations .reset_variations {
    font-size: 14px;
    text-decoration: underline;
    white-space: nowrap;
}

/* Catalog: available options overlay the product image on hover. */
ul.products li.product .woocommerce-LoopProduct-link {
    position: relative;
    display: block;
}

ul.products li.product .psw-loop-swatches {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    box-sizing: border-box;
    padding: 12px 8px 16px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.55) 45%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

ul.products li.product:hover .psw-loop-swatches.is-loading,
ul.products li.product:hover .psw-loop-swatches.is-loaded,
ul.products li.product:focus-within .psw-loop-swatches.is-loading,
ul.products li.product:focus-within .psw-loop-swatches.is-loaded {
    opacity: 1;
    visibility: visible;
}

ul.products li.product .psw-loop-swatches-spinner {
    display: block;
    width: 22px;
    height: 22px;
    margin: 0 auto 4px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--st-secondary-color, #de700f);
    border-radius: 50%;
    animation: psw-loop-swatches-spin 0.6s linear infinite;
}

@keyframes psw-loop-swatches-spin {
    to {
        transform: rotate(360deg);
    }
}

ul.products li.product .psw-loop-swatches-attr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    max-width: 100%;
}

ul.products li.product .psw-loop-swatches .psw-loop-term {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 28px;
    min-height: 28px;
    padding: 4px 6px;
    border: 1px solid var(--st-text-color, #222);
    border-radius: 3px;
    background: #fff;
    color: var(--st-text-color, #222);
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
}

ul.products li.product .psw-loop-swatches .psw-loop-term .wpcvs-term-inner,
ul.products li.product .psw-loop-swatches .psw-loop-term .wpcvs-term-label {
    padding: 0;
    color: inherit;
}

