/* PrimeTech Variation Image Picker v1.3 */

/* Hide only WoodMart color swatches for color-like attributes when our picker exists */
.single-product .variations_form:has(.pt-vip-single) .variations tr:has(select[name="attribute_pa_color"]),
.single-product .variations_form:has(.pt-vip-single) .variations tr:has(select[name="attribute_color"]) {
    display: none !important;
}

.pt-vip-single {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin: 12px 0 18px;
}

.pt-vip-item {
    width: var(--pt-vip-size, 76px) !important;
    min-width: var(--pt-vip-size, 76px) !important;
    height: var(--pt-vip-size, 76px) !important;
    border-radius: 14px !important;
    border: 2px solid #e8e8e8 !important;
    background: #fff !important;
    padding: 0 !important;
    overflow: hidden !important;
    cursor: pointer;
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    transition: all .22s ease;
}

.pt-vip-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    padding: 4px !important;
}

.pt-vip-item span { display: none; }

.pt-vip-item:hover,
.pt-vip-item.is-active {
    border-color: #d90000 !important;
    box-shadow: 0 0 0 3px rgba(217,0,0,.12) !important;
    transform: translateY(-2px);
}

/* Product cards generated by plugin */
.pt-vip-loop {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 8px auto 6px !important;
    min-height: var(--pt-vip-loop-size, 28px);
}

.pt-vip-loop-item {
    width: var(--pt-vip-loop-size, 28px) !important;
    height: var(--pt-vip-loop-size, 28px) !important;
    border-radius: 6px !important;
    border: 1px solid #e6e6e6 !important;
    background: #fff !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 !important;
    transition: all .2s ease;
}

.pt-vip-loop-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 1px !important;
    display: block !important;
}

.pt-vip-loop-item:hover {
    border-color: #d90000 !important;
    transform: translateY(-1px);
}

/* WoodMart native swatches upgraded via data-image-src */
.wd-swatches-grid .wd-swatch.pt-vip-wd-ready,
.wd-swatches-product .wd-swatch.pt-vip-wd-ready,
.wd-product-swatches .wd-swatch.pt-vip-wd-ready {
    --wd-swatch-size: 24px;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    border-radius: 6px !important;
    border: 1px solid #e6e6e6 !important;
    background: #fff !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
}

.wd-swatches-grid .wd-swatch.pt-vip-wd-ready .pt-vip-wd-img-wrap,
.wd-swatches-product .wd-swatch.pt-vip-wd-ready .pt-vip-wd-img-wrap,
.wd-product-swatches .wd-swatch.pt-vip-wd-ready .pt-vip-wd-img-wrap {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
}

.wd-swatches-grid .wd-swatch.pt-vip-wd-ready img,
.wd-swatches-product .wd-swatch.pt-vip-wd-ready img,
.wd-product-swatches .wd-swatch.pt-vip-wd-ready img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 1px !important;
    display: block !important;
}

.wd-swatches-grid .wd-swatch.pt-vip-wd-ready:hover,
.wd-swatches-product .wd-swatch.pt-vip-wd-ready:hover,
.wd-product-swatches .wd-swatch.pt-vip-wd-ready:hover,
.wd-swatches-grid .wd-swatch.pt-vip-wd-ready.wd-active,
.wd-swatches-product .wd-swatch.pt-vip-wd-ready.wd-active,
.wd-product-swatches .wd-swatch.pt-vip-wd-ready.wd-active {
    border-color: #d90000 !important;
    box-shadow: 0 0 0 2px rgba(217,0,0,.12) !important;
}

/* Hide old WoodMart swatches only where our custom loop picker is present */
.product-grid-item:has(.pt-vip-loop) .wd-swatches-grid,
.product-grid-item:has(.pt-vip-loop) .wd-product-swatches,
.product-grid-item:has(.pt-vip-loop) .wd-swatches-product,
.product-grid-item:has(.pt-vip-loop) .wd-swatches-wrap,
.product-grid-item:has(.pt-vip-loop) .variable-items-wrapper {
    display: none !important;
}

@media (max-width: 768px) {
    .pt-vip-item {
        width: 62px !important;
        min-width: 62px !important;
        height: 62px !important;
    }
    .pt-vip-loop-item {
        width: 24px !important;
        height: 24px !important;
    }
}


/* SHOP LOOP SAFE MODE */
.pt-vip-loop {display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:nowrap;margin-top:10px;min-height:34px;overflow:hidden;}
.pt-vip-loop-item {width:var(--pt-vip-loop-size);height:var(--pt-vip-loop-size);border-radius:999px !important;overflow:hidden;border:1px solid #e5e5e5;background:#fff;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex:0 0 auto;}
.pt-vip-loop-item:hover {border-color:#e60000;transform:scale(1.05);}
.pt-vip-loop-item img {width:100%;height:100%;object-fit:cover;display:block;}
@media (max-width:768px){.pt-vip-loop{gap:4px;min-height:28px}.pt-vip-loop-item{width:22px!important;height:22px!important}}
