
.wd-swatches-single {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .wd-swatches-single .wd-swatch {
            display: flex !important;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            width: 70px !important;
            height: 100px !important;
            border: 1px solid #e1e1e1;
            border-radius: 6px !important;
            padding: 0 !important;
            margin: 0 !important;
            overflow: hidden;
            background-color: #fff;
            transition: all 0.2s ease;
            box-shadow: none;
            cursor: pointer;
        }

        .wd-swatches-single .wd-swatch-bg {
            display: block !important;
            width: 100% !important;
            height: 70px !important;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            border-radius: 0 !important;
            margin: 0 !important;
            background-color: transparent !important; 
        }

        .wd-swatches-single .wd-swatch-text {
            display: flex !important;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 30px !important;
            font-size: 12px !important;
            font-weight: 500;
            color: #333;
            text-align: center;
            line-height: 1.1;
            background-color: #f9f9f9;
            padding: 0 4px;
        }

        .wd-swatches-single .wd-swatch:hover,
        .wd-swatches-single .wd-swatch.wd-active {
            border: 2px solid #333 !important;
            transform: translateY(-2px);
        }

        .wd-swatches-single .wd-swatch.wd-text .wd-swatch-bg {
            display: block !important;
        }





.wd-swatches-product {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.wd-swatches-product .wd-swatch {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    border: 1px solid #e1e1e1;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    background-color: #fff;
    transition: all 0.2s ease;
    box-shadow: none;
    border-radius: 4px !important;
}

.wd-swatches-product .wd-swatch-bg {
    width: 100% !important;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.wd-swatches-product .wd-swatch-bg img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.wd-swatches-product .wd-swatch-text {
    width: 100%;
    min-height: 20px;
    padding: 4px 2px;
    text-align: center;
    line-height: 1.15;
    font-weight: 500;
    color: #333;
    background-color: #fff;
    display: block !important;
    font-size: clamp(7px, 2.5vw, 12px);
    white-space: normal;
    word-break: break-word;
}

.wd-swatches-grid.wd-swatches-product {
    justify-content: center;
    gap: 6px;
}

.wd-swatches-grid.wd-swatches-product .wd-swatch {
    width: 19% !important;
    height: auto !important;
    cursor: pointer;
}

.wd-swatches-grid.wd-swatches-product .wd-swatch:hover,
.wd-swatches-grid.wd-swatches-product .wd-swatch.wd-active {
    border: 1px solid #333 !important;
    transform: translateY(-2px);
}

.single-product .wd-swatches-product .wd-swatch,
td.value .wd-swatches-product .wd-swatch {
    width: 65px !important;
    height: auto !important;
    margin-right: 6px !important;
    margin-bottom: 6px !important;
}

.single-product .wd-swatches-product .wd-swatch-bg,
td.value .wd-swatches-product .wd-swatch-bg {
    aspect-ratio: 1 / 1;
}

.single-product .wd-swatches-product .wd-swatch-text,
td.value .wd-swatches-product .wd-swatch-text {
    min-height: 30px;
    padding: 4px 2px;
    font-size: clamp(9px, 2vw, 11px);
}

.single-product .wd-swatches-product .wd-swatch:hover,
td.value .wd-swatches-product .wd-swatch:hover {
    transform: none !important;
    border-color: #999;
}

.single-product .wd-swatches-product .wd-swatch.wd-active,
td.value .wd-swatches-product .wd-swatch.wd-active {
    border: 2px solid #d32f2f !important;
}

@media (max-width: 768px) {
    .wd-swatches-product {
        gap: 1% !important;
        justify-content: flex-start;
    }
    .wd-swatches-grid.wd-swatches-product .wd-swatch {
        width: 24% !important;
        height: auto !important;
        cursor: pointer;
    }
    .single-product .wd-swatches-product .wd-swatch,
    td.value .wd-swatches-product .wd-swatch {
        width: 24% !important;
        height: auto !important;
        flex: 0 0 24% !important;
        margin: 0 0 5px 0 !important;
    }
    .single-product .wd-swatches-product .wd-swatch-bg,
    td.value .wd-swatches-product .wd-swatch-bg {
        aspect-ratio: 1 / 1;
    }
    .single-product .wd-swatches-product .wd-swatch-text,
    td.value .wd-swatches-product .wd-swatch-text {
         min-height: 15px;
        font-size: clamp(6px, 3vw, 10px);
    }
}



.product-grid-item .wd-swatches-product,
.custom-acf-swatches-container {
    display: flex;
    flex-wrap: nowrap !important; 
    overflow-x: auto;
    gap: 6px;
    justify-content: flex-start;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    scroll-snap-type: x mandatory; 
}

.product-grid-item .wd-swatches-product::-webkit-scrollbar,
.custom-acf-swatches-container::-webkit-scrollbar {
    display: none;
}

.product-grid-item .wd-swatches-product .wd-swatch,
.custom-acf-swatches-container .wd-swatch {
    flex: 0 0 auto;
    width: 45px !important;
    height: 65px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e1e1e1;
    border-radius: 4px !important;
    margin: 0 !important;
    background-color: #fff;
    cursor: pointer;
    scroll-snap-align: start; 
}


.product-grid-item .wd-swatches-product .wd-swatch-bg,
.custom-acf-swatches-container .wd-swatch-bg {
    display: block !important;
    width: 100%;
    height: 40px !important;
    background-size: cover;
    background-position: center;
    border-radius: 0 !important;
}

.product-grid-item .wd-swatches-product .wd-swatch-text,
.custom-acf-swatches-container .wd-swatch-text {
    height: 25px !important;
    font-size: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: auto;
}

.product-grid-item .wd-swatch:hover,
.custom-acf-swatches-container .wd-swatch:hover,
.custom-acf-swatches-container .wd-swatch.wd-active {
    border-color: #333 !important;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .product-grid-item .wd-swatches-product .wd-swatch,
    .custom-acf-swatches-container .wd-swatch {
        width: 40px !important;
        height: 60px !important;
    }
    .product-grid-item .wd-swatches-product .wd-swatch-bg,
    .custom-acf-swatches-container .wd-swatch-bg {
        height: 38px !important;
    }
    .product-grid-item .wd-swatches-product .wd-swatch-text,
    .custom-acf-swatches-container .wd-swatch-text {
        height: 20px !important;
        font-size: 9px !important;
    }
}



.swatch-scroll-wrapper {
    position: relative;
    width: 100%;
    margin-top: 5px;
 
}

.swatch-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-60%); 
    width: 26px; 
    height: 26px;
    background: #fff;
    border-radius: 50%; 
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15); 
    opacity: 0;
    transition: all 0.2s ease;
    border: 1px solid rgba(0,0,0,0.05);
}


.swatch-scroll-wrapper:hover .swatch-nav-arrow {
    opacity: 1;
}


.swatch-nav-arrow::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid #333;
    border-right: 1.5px solid #333;
}


.swatch-nav-arrow.prev {
    left: 2px; 
}
.swatch-nav-arrow.prev::after {
    transform: rotate(-135deg);
    margin-left: 2px;
}


.swatch-nav-arrow.next {
    right: 2px; 
}
.swatch-nav-arrow.next::after {
    transform: rotate(45deg);
    margin-right: 2px;
}


.swatch-nav-arrow:hover {
    transform: translateY(-60%) scale(1.1);
    background: #f9f9f9;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}


.swatch-nav-arrow.disabled {
    opacity: 0 !important;
    pointer-events: none;
}


@media (max-width: 768px) {
    .swatch-nav-arrow {
        display: none !important;
    }
}

