.wootify-matrix-selector {
    margin: 20px 0;
}

.wootify-variant-price-top {
    margin: 8px 0 14px;
}

.wootify-variant-price-top__value {
    font-size: 20px;
    font-weight: 700;
    color: #1e1e1e;
    line-height: 1.5;
}

.matrix-option-row {
    margin-bottom: 10px;
}

.matrix-option-row:last-child {
    margin-bottom: 0;
}

.option-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.option-helptext {
    display: inline-flex;
    align-items: center;
    padding: 2px 0px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    text-transform: none;
    letter-spacing: normal;
}

.option-values {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.value-chip {
    padding: 5px 10px;
    background: #e6e6e8;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    color: #222;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none !important;
    min-width: 50px;
    min-height: 40px;
    margin: 0;
}

.value-chip.chip-image-swatch {
    width: 85px;
    min-width: 85px;
    height: 85px;
    padding: 3px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.chip-image-wrap {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.chip-image-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chip-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
}

.value-chip.chip-color-swatch {
    width: 45px;
    min-width: 45px;
    height: 45px;
    padding: 3px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.chip-color-dot {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    position: relative;
}

.chip-color-dot::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.value-chip.chip-color-swatch:hover:not(.disabled),
.value-chip.chip-image-swatch:hover:not(.disabled) {
    transform: translateY(-1px);
    border: 2px solid #f4b400;
    background: #fff;
}

.value-chip.chip-color-swatch.active {
    background: #fff;
    /* border: 2px solid #f4b400;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f4b400; */
}

.value-chip.chip-color-swatch.active .chip-color-dot::after {
    display: flex;
}

.value-chip.chip-image-swatch.active {
    background: #fff;
    border: 2px solid #f4b400;
    /* box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f4b400; */
}

.value-chip.chip-color-swatch.disabled,
.value-chip.chip-image-swatch.disabled {
    background: #fff;
    opacity: 0.45;
    transform: none;
    text-decoration: none;
}

.value-chip:hover:not(.disabled) {
    /*border-color: #1e1e1e;
    color: #fff;
    background: #1e1e1e; */
}

.value-chip.active {
    background: #e6e6e8;
    /* border-color: #1e1e1e; */
    color: #222;
    font-weight: 500;
    box-shadow: 0 0px 0px 2px rgba(0, 0, 0, 0.744);
}

.value-chip.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f3f4f6;
    text-decoration: line-through;
}

.selected-variant-info {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.variant-price {
    font-size: 24px;
    font-weight: 700;
    color: #1e1e1e;
    margin-bottom: 4px;
}

.variant-stock {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.variant-stock.in-stock {
    color: #059669;
}

.variant-stock.out-of-stock {
    color: #dc2626;
}

.variant-stock::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.variant-sku {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.woocommerce-product-gallery.wootify-gallery-gray-mode {
    width: 100%;
}

.wootify-gallery-gray-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

/* ── Slick Carousel Gallery ── */
.woocommerce-product-gallery.wootify-slick-gallery {
    display: block !important;
    opacity: 1 !important;
    width: 100% !important;
}

/* Hide Flatsome native thumbnail column */
.wootify-slick-gallery~.product-thumbnails,
.wootify-slick-gallery~.vertical-thumbnails,
.col:has(.wootify-slick-gallery)~.col.vertical-thumbnails {
    display: none !important;
}

.wslk-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #eee;
    user-select: none;
    -webkit-user-select: none;
}

.wslk-track {
    display: flex;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.wslk-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
}

.wslk-slide img {
    display: block;
    width: 100%;
    height: auto;
    /* aspect-ratio: 1; 
    object-fit: none; */
    background: #f9fafb;
}

/* Arrows */
.wslk-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: #1e1e1e;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    transition: background 0.15s ease, opacity 0.15s ease;
    opacity: 0;
    pointer-events: none;
    padding: 0;
    line-height: 1;
}

.wslk-viewport:hover .wslk-arrow {
    opacity: 1;
    pointer-events: auto;
}

.wslk-arrow:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.wslk-arrow-prev {
    left: 10px;
}

.wslk-arrow-next {
    right: 10px;
}

/* Counter */
.wslk-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 5;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    pointer-events: none;
}

/* Thumbnail strip */
.wslk-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
    padding-bottom: 4px;
}

.wslk-thumbs::-webkit-scrollbar {
    height: 4px;
}

.wslk-thumbs::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.wslk-thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s ease;
}

.wslk-thumb:hover {
    border-color: #9ca3af;
}

.wslk-thumb.active {
    border-color: #1e1e1e;
}

.wslk-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile */
@media (max-width: 767px) {
    .wslk-arrow {
        width: 30px;
        height: 30px;
        opacity: 1;
        pointer-events: auto;
    }

    .wslk-arrow-prev {
        left: 6px;
    }

    .wslk-arrow-next {
        right: 6px;
    }

    .wslk-arrow svg {
        width: 16px;
        height: 16px;
    }

    .wslk-thumb {
        width: 56px;
        height: 56px;
    }

    .wslk-thumbs {
        gap: 6px;
        margin-top: 8px;
    }
}

.woocommerce-product-gallery.wootify-custom-gallery {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    align-items: flex-start !important;
    opacity: 1 !important;
    width: 100% !important;
}

/* Hide Flatsome native thumbnail column when custom gallery is active */
.wootify-custom-gallery~.product-thumbnails,
.wootify-custom-gallery~.vertical-thumbnails,
.col.vertical-thumbnails:has(~ .col .wootify-custom-gallery),
.col:has(.wootify-custom-gallery)~.col.vertical-thumbnails {
    display: none !important;
}

.wootify-custom-gallery .wcg-thumbs-col {
    flex: 0 0 100px;
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.wootify-custom-gallery .wcg-thumbs-col::-webkit-scrollbar {
    width: 4px;
}

.wootify-custom-gallery .wcg-thumbs-col::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.wootify-custom-gallery .wcg-thumb {
    display: block;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #f9fafb;
    transition: border-color 0.2s;
}

.wootify-custom-gallery .wcg-thumb:hover {
    border-color: #9ca3af;
}

.wootify-custom-gallery .wcg-thumb.active {
    border-color: #1e1e1e;
}

.wootify-custom-gallery .wcg-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wootify-custom-gallery .wcg-main-col {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    border: 1px solid #eee;
}

.wootify-custom-gallery .wcg-main-image {
    display: block;
    width: 100%;
    height: auto;
    /*object-fit: none;
    aspect-ratio: 1;*/
    transition: opacity 0.15s ease;
}

@media (max-width: 767px) {
    .woocommerce-product-gallery.wootify-custom-gallery {
        flex-direction: column-reverse !important;
    }

    .wootify-custom-gallery .wcg-thumbs-col {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        max-width: none;
        max-height: none !important;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .wootify-custom-gallery .wcg-thumb {
        width: 64px;
        height: 64px;
        min-width: 64px;
    }
}

/* ── Swiper Grid Gallery (1-2-1-2 pattern) ── */
.woocommerce-product-gallery.wootify-swiper-gallery {
    display: block !important;
    opacity: 1 !important;
}

/* Hide Flatsome native thumbnail column */
.wootify-swiper-gallery~.product-thumbnails,
.wootify-swiper-gallery~.vertical-thumbnails,
.col:has(.wootify-swiper-gallery)~.col.vertical-thumbnails {
    display: none !important;
}

.wsg-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.wsg-row {
    display: flex;
    gap: 6px;
    width: 100%;
}

.wsg-row-full {
    flex-direction: row;
}

.wsg-row-full .wsg-item {
    width: 100%;
}

.wsg-row-half .wsg-item {
    width: 50%;
}

.wsg-row-third .wsg-item {
    width: 33.333%;
}

.wsg-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: #f3f4f6;
    cursor: pointer;
    transition: outline-color 0.15s ease;
    outline: 2px solid transparent;
    outline-offset: -2px;
}

.wsg-item:hover {
    outline-color: #9ca3af;
}

.wsg-item.active {
    /* outline-color: #1e1e1e; */
}

.wsg-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wsg-row-full .wsg-item img {
    aspect-ratio: 4 / 3;
}

.wsg-row-half .wsg-item img {
    aspect-ratio: 1;
}

.wsg-row-third .wsg-item img {
    aspect-ratio: 3 / 4;
}

@media (max-width: 767px) {
    .wsg-grid {
        gap: 4px;
    }

    .wsg-row {
        gap: 4px;
    }

    .wsg-row-full .wsg-item img {
        aspect-ratio: 16 / 10;
    }

    .wsg-row-half .wsg-item img {
        aspect-ratio: 1;
    }
}