.kaui-hover-gallery {
    --kaui-gallery-teal: #07b097;
    --kaui-gallery-coral: #f68f7e;
    --kaui-gallery-cream: #fdf9f4;
    --kaui-gallery-line: rgba(214, 191, 182, 0.62);
    --kaui-gallery-shadow: 0 18px 40px rgba(42, 42, 42, 0.08);
    box-sizing: border-box;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.kaui-hover-gallery *,
.kaui-hover-gallery *::before,
.kaui-hover-gallery *::after {
    box-sizing: border-box;
}

.kaui-hover-gallery__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: clamp(390px, 52vw, 620px);
    margin: 0;
    padding: clamp(18px, 4vw, 44px);
}

.kaui-hover-gallery__main-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: inherit;
    text-decoration: none;
    cursor: zoom-in;
}

.kaui-hover-gallery__main {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: clamp(360px, 48vw, 590px);
    height: auto;
    object-fit: contain;
    opacity: 1;
    transform: translateZ(0);
    transition: opacity 160ms ease;
}

.kaui-hover-gallery__main.is-changing {
    opacity: 0.62;
}

.kaui-hover-gallery__thumb-shell {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
    padding: 0 clamp(10px, 2vw, 18px) clamp(20px, 4vw, 34px);
}

.kaui-hover-gallery__thumbs {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.kaui-hover-gallery__thumbs::-webkit-scrollbar {
    display: none;
}

.kaui-hover-gallery__thumb,
.kaui-hover-gallery__nav {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: none;
    font: inherit;
}

.kaui-hover-gallery__thumb {
    position: relative;
    flex: 0 0 84px;
    width: 84px;
    height: 84px;
    padding: 5px;
    border: 1px solid var(--kaui-gallery-line);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(42, 42, 42, 0.035);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.kaui-hover-gallery__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 11px;
    object-fit: cover;
}

.kaui-hover-gallery__thumb:hover,
.kaui-hover-gallery__thumb:focus-visible {
    border-color: rgba(7, 176, 151, 0.55);
    box-shadow: 0 10px 24px rgba(7, 176, 151, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.kaui-hover-gallery__thumb.is-active {
    border-color: var(--kaui-gallery-teal);
    box-shadow: 0 0 0 2px rgba(7, 176, 151, 0.16), 0 12px 28px rgba(7, 176, 151, 0.12);
}

.kaui-hover-gallery__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--kaui-gallery-line);
    border-radius: 999px;
    color: #3b2d28;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.kaui-hover-gallery__nav svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.kaui-hover-gallery__nav:hover,
.kaui-hover-gallery__nav:focus-visible {
    color: var(--kaui-gallery-teal);
    border-color: rgba(7, 176, 151, 0.48);
    background: #fff;
    outline: none;
    transform: translateY(-1px);
}

.kaui-hover-gallery__nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.kaui-format-product-detail .product-visual-col.kaui-hover-gallery-ready > .kaui-product-detail-graphic,
.kaui-format-product-detail .product-visual-col.kaui-hover-gallery-ready > .bottle-stage,
.kaui-format-product-detail .product-visual-col.kaui-hover-gallery-ready > .thumb-row {
    display: none !important;
}

.kaui-format-product-detail .product-visual-col.kaui-hover-gallery-ready {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

.woocommerce div.product div.images .kaui-hover-gallery {
    max-width: none;
}

@media (max-width: 1024px) {
    .kaui-hover-gallery {
        max-width: 460px;
    }

    .kaui-hover-gallery__stage {
        min-height: clamp(340px, 58vw, 540px);
    }

    .kaui-hover-gallery__main {
        max-height: clamp(320px, 54vw, 520px);
    }
}

@media (max-width: 767px) {
    .kaui-hover-gallery {
        max-width: 100%;
    }

    .kaui-hover-gallery__stage {
        min-height: clamp(310px, 92vw, 460px);
        padding: 22px 18px 12px;
    }

    .kaui-hover-gallery__main {
        max-height: clamp(300px, 86vw, 430px);
    }

    .kaui-hover-gallery__thumb-shell {
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        gap: 8px;
        margin-top: 2px;
        padding: 0 14px 26px;
    }

    .kaui-hover-gallery__thumb {
        flex-basis: 68px;
        width: 68px;
        height: 68px;
        border-radius: 13px;
        padding: 4px;
    }

    .kaui-hover-gallery__thumb img {
        border-radius: 9px;
    }

    .kaui-hover-gallery__nav {
        width: 30px;
        height: 30px;
    }
}
