:root {
    --ts-gallery-admin-offset: 0px;
    --ts-gallery-backdrop: var(--surface-page);
    --ts-gallery-surface: var(--surface-card);
    --ts-gallery-control: var(--surface-control);
    --ts-gallery-control-hover: var(--surface-control-hover);
    --ts-gallery-border: var(--border-control);
    --ts-gallery-text: var(--text-strong);
    --ts-gallery-muted: var(--text-muted);
    --ts-gallery-accent: var(--theme-accent);
    --ts-gallery-focus: var(--focus-ring);
}

body.admin-bar {
    --ts-gallery-admin-offset: 32px;
}

.desktop-product-gallery,
.desktop-product-gallery .swiper-wrapper,
.desktop-product-gallery .swiper-slide {
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.desktop-product-gallery {
    aspect-ratio: 1 / 1;
    contain: inline-size;
    overflow: hidden;
    position: relative;
}

.desktop-product-gallery .swiper-wrapper,
.desktop-product-gallery .swiper-slide {
    height: 100%;
}

.desktop-product-gallery .swiper-slide > img {
    display: block;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    width: 100%;
}

@media (min-width: 768px) {
    body.single-product #site-main .product-panel > .right-panel,
    body.single-product #site-main .product-panel > .right-panel > .top-box,
    body.single-product #site-main .product-panel > .right-panel > .top-box > .image-panel,
    body.single-product #site-main .product-panel > .right-panel > .top-box > .details-box {
        min-width: 0;
    }

    body.single-product #site-main .product-panel > .right-panel > .top-box > .image-panel {
        flex: 0 1 39.5%;
        max-width: 39.5%;
    }

    body.single-product #site-main .product-panel > .right-panel > .top-box > .details-box {
        flex: 1 1 0;
    }
}

.ts-desktop-image-swipe {
    overflow: hidden;
}

.ts-desktop-image-swipe > img {
    touch-action: pan-y;
    user-select: none;
    will-change: transform;
    -webkit-user-drag: none;
}

.ts-desktop-image-swipe > img:not(.ts-desktop-image-ghost) {
    position: relative;
    z-index: 1;
}

.ts-desktop-image-swipe > .ts-desktop-image-ghost {
    inset-inline: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    will-change: transform;
    z-index: 2;
}

.ts-desktop-image-swipe > img:active {
    cursor: grabbing;
}

.desktop-product-gallery-controls {
    align-items: center;
    background: var(--ts-gallery-control);
    border: 1px solid var(--ts-gallery-border);
    border-radius: 999px;
    bottom: 12px;
    color: var(--ts-gallery-text);
    direction: ltr;
    display: flex;
    gap: 2px;
    left: 50%;
    padding: 3px;
    position: absolute;
    transform: translateX(-50%);
    transition: opacity 180ms ease, transform 180ms ease;
    z-index: 6;
}

.desktop-product-gallery-controls[hidden] {
    display: none;
}

.ts-desktop-image-swipe .desktop-product-gallery-controls {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
}

.ts-desktop-image-swipe:hover .desktop-product-gallery-controls,
.ts-desktop-image-swipe:focus-within .desktop-product-gallery-controls {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.desktop-product-gallery-prev,
.desktop-product-gallery-next {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--ts-gallery-text);
    cursor: pointer;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    margin: 0;
    padding: 0;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
    width: 30px;
}

.desktop-product-gallery-prev:hover,
.desktop-product-gallery-next:hover {
    background: var(--ts-gallery-control-hover);
}

.desktop-product-gallery-prev:active,
.desktop-product-gallery-next:active {
    transform: scale(.94);
}

.desktop-product-gallery-prev:focus-visible,
.desktop-product-gallery-next:focus-visible,
.productImageGallery .close-popup:focus-visible,
.productImageGallery [role="button"]:focus-visible {
    outline: 2px solid var(--ts-gallery-focus);
    outline-offset: 2px;
}

.desktop-product-gallery-pagination {
    color: var(--ts-gallery-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 30px;
    min-width: 42px;
    text-align: center;
}

.productImageGallery {
    --ts-gallery-backdrop: var(--surface-page);
    --ts-gallery-surface: var(--surface-card);
    --ts-gallery-control: var(--surface-control);
    --ts-gallery-control-hover: var(--surface-control-hover);
    --ts-gallery-border: var(--border-control);
    --ts-gallery-text: var(--text-strong);
    --ts-gallery-control-text: var(--text-strong);
    --ts-gallery-muted: var(--text-muted);
    --ts-gallery-accent: var(--theme-accent);
    --ts-gallery-focus: var(--focus-ring);
    --ts-gallery-media-canvas: #ffffff;
    --ts-gallery-rail-surface: var(--surface-raised);
    --ts-gallery-glass-surface: color-mix(
        in srgb,
        var(--surface-overlay) 90%,
        var(--surface-raised)
    );
    --ts-gallery-glass-border: color-mix(
        in srgb,
        var(--text-on-brand) 24%,
        transparent
    );
    --ts-gallery-glass-highlight: color-mix(
        in srgb,
        var(--text-on-brand) 20%,
        transparent
    );
    --ts-gallery-rail-ease: cubic-bezier(.2, 0, 0, 1);
    --ts-gallery-thumb-width: 88px;
    --ts-gallery-thumb-height: 76px;
    --ts-gallery-thumb-gap: 6px;

    background: var(--ts-gallery-backdrop) !important;
    bottom: 0 !important;
    height: calc(100vh - var(--ts-gallery-admin-offset)) !important;
    height: calc(100dvh - var(--ts-gallery-admin-offset)) !important;
    inset-inline: 0 !important;
    overflow: hidden !important;
    position: fixed !important;
    top: var(--ts-gallery-admin-offset) !important;
    width: 100vw !important;
    z-index: 100000 !important;
}

.productImageGallery .popup-container,
.productImageGallery .popup-content {
    background: var(--ts-gallery-backdrop) !important;
    bottom: 0 !important;
    color: var(--ts-gallery-text) !important;
    height: 100% !important;
    inset-inline: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    max-width: none !important;
    padding: 0 !important;
    position: absolute !important;
    top: 0 !important;
    width: 100% !important;
}

.productImageGallery .popup-content {
    display: flex !important;
    flex-direction: column;
}

.productImageGallery .header {
    inset: 0 0 auto !important;
    margin: 0 !important;
    pointer-events: none;
    position: absolute !important;
    z-index: 12;
}

.productImageGallery .close-popup {
    align-items: center;
    background: var(--ts-gallery-control) !important;
    border: 1px solid var(--ts-gallery-border) !important;
    border-radius: 50%;
    color: var(--ts-gallery-control-text) !important;
    cursor: pointer;
    display: inline-flex !important;
    font-family: inherit;
    font-size: 28px;
    font-style: normal;
    height: 44px;
    inset-inline-end: 18px;
    justify-content: center;
    line-height: 1;
    margin: 0 !important;
    padding: 0 0 3px !important;
    pointer-events: auto;
    position: absolute !important;
    top: 18px;
    transition:
        background-color 140ms var(--theme-motion-ease),
        border-color 140ms var(--theme-motion-ease),
        color 140ms var(--theme-motion-ease),
        transform 140ms var(--theme-motion-ease);
    width: 44px;
    z-index: 14;
}

.productImageGallery .close-popup:hover {
    background: var(--ts-gallery-accent) !important;
    border-color: var(--ts-gallery-accent) !important;
    color: var(--text-on-accent) !important;
}

.productImageGallery .close-popup:active {
    transform: scale(.94);
}

.productImageGallery .galleryBox {
    align-items: center;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column !important;
    flex: 1;
    gap: 18px;
    height: 100% !important;
    justify-content: center;
    margin: 0 !important;
    min-height: 0;
    padding: 72px 72px 20px !important;
    width: 100% !important;
}

.productImageGallery .imageGalleryBox {
    flex: 1;
    height: min(72vh, 760px) !important;
    margin: 0 !important;
    max-width: 980px;
    min-height: 0;
    position: relative;
    width: min(72vw, 980px) !important;
}

.productImageGallery .imageGallery {
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--ts-gallery-text) 20%, transparent);
    border-radius: 20px;
    background: var(--ts-gallery-media-canvas);
    box-shadow: 0 24px 60px var(--shadow-color);
}

.productImageGallery .imageGallery,
.productImageGallery .imageGallery .swiper-wrapper,
.productImageGallery .imageGallery .swiper-slide {
    height: 100% !important;
    width: 100% !important;
}

.productImageGallery .imageGallery .swiper-slide {
    align-items: center;
    display: flex;
    justify-content: center;
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.productImageGallery .imageGallery img {
    background: var(--ts-gallery-media-canvas);
    height: 100% !important;
    max-height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    width: 100% !important;
    transform-origin: center center;
    transition: transform 180ms var(--ts-gallery-rail-ease);
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

.productImageGallery .imageGallery .swiper-slide.is-zoomed img {
    cursor: grab;
    max-height: none !important;
    max-width: none !important;
    transition: none;
}

.productImageGallery .imageGallery .swiper-slide.is-zoomed.is-panning img {
    cursor: grabbing;
}

.productImageGallery .imageGallery .swiper-slide.is-zoomed {
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.productImageGallery .ts-product-gallery-zoom-hint {
    position: absolute;
    inset-inline-end: 14px;
    inset-block-start: 14px;
    z-index: 9;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--ts-gallery-glass-border);
    border-radius: 999px;
    background: var(--ts-gallery-glass-surface);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    box-shadow:
        inset 0 1px 0 var(--ts-gallery-glass-highlight),
        0 8px 18px var(--shadow-color);
    color: var(--text-on-brand);
    font-size: 11px;
    font-variation-settings: "wght" 600;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition:
        opacity 160ms var(--theme-motion-ease),
        transform 160ms var(--theme-motion-ease);
}

.productImageGallery.is-zoom-hint-visible .ts-product-gallery-zoom-hint {
    opacity: 1;
    transform: translateY(0);
}

/*
 * Video slides: keep a true 16:9 (or portrait) frame centered in the stage.
 * Idle (not playing) state must look intentional — never a black void with a corner card.
 */
.productImageGallery .imageGallery .wbs-product-video-slide {
    container-type: size;
    background: #0b0d10;
    padding: 0 !important;
}

.productImageGallery .imageGallery .wbs-product-video-slide.is-portrait {
    min-height: 0 !important;
}

.productImageGallery .imageGallery .wbs-product-video-shell,
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player,
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player.is-landscape,
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player.is-portrait {
    --gallery-video-w: 16;
    --gallery-video-h: 9;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    width: min(100cqw, calc(100cqh * var(--gallery-video-w) / var(--gallery-video-h))) !important;
    height: min(100cqh, calc(100cqw * var(--gallery-video-h) / var(--gallery-video-w))) !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    border: 1px solid color-mix(in srgb, var(--ts-gallery-text) 16%, transparent) !important;
    border-radius: 16px !important;
    background:
        radial-gradient(
            120% 90% at 50% 18%,
            color-mix(in srgb, var(--ts-gallery-accent) 18%, transparent),
            transparent 58%
        ),
        linear-gradient(
            160deg,
            color-mix(in srgb, var(--surface-navigation) 92%, #1a2330),
            #07090d 62%
        ) !important;
    aspect-ratio: var(--gallery-video-w) / var(--gallery-video-h) !important;
    box-shadow: 0 18px 48px var(--shadow-color) !important;
}

.productImageGallery .imageGallery .wbs-product-video-shell::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(
            180deg,
            transparent 42%,
            color-mix(in srgb, var(--surface-overlay) 72%, transparent) 100%
        );
    content: "";
    pointer-events: none;
}

.productImageGallery .imageGallery .wbs-product-video-shell.is-loaded::before,
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player::before {
    opacity: 0;
}

.productImageGallery .imageGallery .wbs-product-video-shell.is-portrait,
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player.is-portrait {
    --gallery-video-w: 9;
    --gallery-video-h: 16;
}

@supports not (width: 1cqw) {
    .productImageGallery .imageGallery .wbs-product-video-shell,
    .productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player {
        width: 100% !important;
        height: auto !important;
        max-height: 100% !important;
    }
}

/* Idle play CTA — centered homepage-style glass control */
.productImageGallery .imageGallery .wbs-product-video-play {
    position: relative;
    z-index: 2;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    min-width: 0 !important;
    min-height: 64px !important;
    margin: 0 !important;
    padding: 8px 16px 8px 8px !important;
    border: 1px solid color-mix(in srgb, var(--text-on-brand) 22%, transparent) !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--surface-overlay) 88%, var(--surface-raised)) !important;
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--text-on-brand) 18%, transparent),
        0 14px 34px var(--shadow-color) !important;
    color: var(--text-on-brand) !important;
    cursor: pointer;
    transition:
        transform 160ms var(--theme-motion-ease, ease),
        border-color 160ms var(--theme-motion-ease, ease),
        background-color 160ms var(--theme-motion-ease, ease);
}

.productImageGallery .imageGallery .wbs-product-video-play:hover,
.productImageGallery .imageGallery .wbs-product-video-play:focus-visible {
    border-color: var(--ts-gallery-accent) !important;
    transform: translateY(-1px);
    outline: none;
}

.productImageGallery .imageGallery .wbs-product-video-play:active {
    transform: translateY(0) scale(.98);
}

.productImageGallery .imageGallery .wbs-product-video-play__icon {
    display: grid !important;
    place-items: center !important;
    flex: 0 0 46px !important;
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    background: var(--ts-gallery-accent) !important;
    color: var(--text-on-accent) !important;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--text-on-brand) 35%, transparent),
        0 6px 16px color-mix(in srgb, var(--ts-gallery-accent) 35%, transparent);
}

.productImageGallery .imageGallery .wbs-product-video-play__icon i,
.productImageGallery .imageGallery .wbs-product-video-play__icon i::before {
    display: block !important;
    margin: 0 !important;
    color: inherit !important;
    font-size: 17px !important;
    line-height: 1 !important;
    transform: translateX(1px);
}

.productImageGallery .imageGallery .wbs-product-video-play__copy {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
    min-width: 0 !important;
    text-align: start !important;
}

.productImageGallery .imageGallery .wbs-product-video-play__copy strong {
    font-size: 14px !important;
    font-variation-settings: "wght" 700 !important;
    line-height: 1.2 !important;
    color: var(--text-on-brand) !important;
}

.productImageGallery .imageGallery .wbs-product-video-play__copy span {
    font-size: 12px !important;
    font-variation-settings: "wght" 500 !important;
    line-height: 1.2 !important;
    color: color-mix(in srgb, var(--text-on-brand) 68%, transparent) !important;
}

.productImageGallery .imageGallery .wbs-product-video-shell iframe,
.productImageGallery .imageGallery .wbs-product-video-shell video,
.productImageGallery .imageGallery .wbs-product-video-shell .ts-video-player__media,
.productImageGallery .imageGallery .wbs-product-video-shell .h_iframe-aparat_embed_frame {
    position: absolute !important;
    inset: 0 !important;
    z-index: 1;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: inherit;
    background: #000;
}

.productImageGallery .imageGallery .wbs-product-video-shell video,
.productImageGallery .imageGallery .wbs-product-video-shell .ts-video-player__media {
    object-fit: contain;
}

/* Hide Aparat fallback chrome once the iframe is mounted */
.productImageGallery .imageGallery .wbs-product-video-shell.is-loaded > .ts-lazy-embed__direct,
.productImageGallery .imageGallery .wbs-product-video-shell.is-loaded > .ts-lazy-embed__status,
.productImageGallery .imageGallery .wbs-product-video-shell.is-loaded > .ts-lazy-embed__retry,
.productImageGallery .imageGallery .wbs-product-video-shell[data-ts-lazy-loaded="true"] > .ts-lazy-embed__direct,
.productImageGallery .imageGallery .wbs-product-video-shell[data-ts-lazy-loaded="true"] > .ts-lazy-embed__status,
.productImageGallery .imageGallery .wbs-product-video-shell[data-ts-lazy-loaded="true"] > .ts-lazy-embed__retry {
    display: none !important;
}

/* Shared player controls stay above the media layer */
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player .ts-video-player__start,
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player .ts-video-player__controls,
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player .ts-video-player__kicker,
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player .ts-video-player__loading,
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player .ts-video-player__feedback,
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player .ts-video-player__gesture-hint,
.productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player .ts-video-player__status {
    z-index: 4;
}

.product-galleries .wbs-product-video-shell.ts-video-player {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    aspect-ratio: var(--wbs-video-aspect-ratio, 16 / 9);
    border-radius: 18px;
    box-shadow: none;
}

/* Video thumbs in the rail — dark video chip, not a blank white image tile */
.productImageGallery .imageGalleryThumbs .swiper-slide:has(.wbs-product-video-gallery-thumb) {
    background:
        linear-gradient(
            160deg,
            color-mix(in srgb, var(--ts-gallery-accent) 12%, #12161d),
            #0b0e13
        ) !important;
}

.productImageGallery .imageGalleryThumbs .wbs-product-video-gallery-thumb {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 6px 4px !important;
    border: 0 !important;
    border-radius: inherit !important;
    background: transparent !important;
    color: var(--ts-gallery-accent) !important;
    cursor: pointer;
    transform: none !important;
    opacity: 1 !important;
}

.productImageGallery .imageGalleryThumbs .wbs-product-video-gallery-thumb__icon {
    display: grid !important;
    place-items: center !important;
    width: 28px !important;
    height: 28px !important;
    border: 1px solid color-mix(in srgb, var(--ts-gallery-accent) 45%, transparent) !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--ts-gallery-accent) 16%, transparent) !important;
    color: var(--ts-gallery-accent) !important;
}

.productImageGallery .imageGalleryThumbs .wbs-product-video-gallery-thumb__icon i,
.productImageGallery .imageGalleryThumbs .wbs-product-video-gallery-thumb__icon i::before {
    display: block !important;
    margin: 0 !important;
    color: inherit !important;
    font-size: 12px !important;
    line-height: 1 !important;
    transform: translateX(0.5px);
}

.productImageGallery .imageGalleryThumbs .wbs-product-video-gallery-thumb__label {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    color: color-mix(in srgb, var(--text-on-brand) 88%, transparent) !important;
    font-size: 10px !important;
    font-variation-settings: "wght" 650 !important;
    line-height: 1.1 !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.productImageGallery .imageGalleryThumbs .swiper-slide.ts-product-gallery-thumb-active .wbs-product-video-gallery-thumb__icon {
    background: var(--ts-gallery-accent) !important;
    border-color: var(--ts-gallery-accent) !important;
    color: var(--text-on-accent) !important;
}

.productImageGallery .imageGalleryThumbs .swiper-slide.ts-product-gallery-thumb-active .wbs-product-video-gallery-thumb__label {
    color: var(--ts-gallery-text) !important;
}

body.is-product-gallery-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.productImageGallery .popup-gallery-prev,
.productImageGallery .popup-gallery-next {
    align-items: center;
    background: var(--ts-gallery-control) !important;
    border: 1px solid var(--ts-gallery-border) !important;
    border-radius: 50% !important;
    color: var(--ts-gallery-control-text) !important;
    cursor: pointer;
    display: flex !important;
    height: 44px !important;
    justify-content: center;
    margin: 0 !important;
    position: absolute !important;
    top: 50%;
    transform: translateY(-50%);
    transition:
        background-color 140ms var(--theme-motion-ease),
        border-color 140ms var(--theme-motion-ease),
        color 140ms var(--theme-motion-ease),
        transform 140ms var(--theme-motion-ease);
    width: 44px !important;
    z-index: 8;
}

.productImageGallery .popup-gallery-prev {
    inset-inline-start: -62px !important;
}

.productImageGallery .popup-gallery-next {
    inset-inline-end: -62px !important;
}

.productImageGallery .popup-gallery-prev:hover,
.productImageGallery .popup-gallery-next:hover {
    background: var(--ts-gallery-accent) !important;
    border-color: var(--ts-gallery-accent) !important;
    color: var(--text-on-accent) !important;
}

.productImageGallery .popup-gallery-prev:active,
.productImageGallery .popup-gallery-next:active {
    transform: translateY(-50%) scale(.94);
}

.productImageGallery .thumbGallery {
    background: var(--ts-gallery-surface) !important;
    border: 1px solid var(--ts-gallery-border);
    border-radius: 16px;
    box-sizing: border-box;
    height: min(72vh, 760px) !important;
    margin: 0 !important;
    padding: 8px !important;
    width: 92px !important;
}

.productImageGallery .thumbGallery .swiper-slide {
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 180ms ease, opacity 180ms ease;
}

.productImageGallery .thumbGallery .swiper-slide-thumb-active {
    border-color: var(--ts-gallery-accent) !important;
}

.productImageGallery .imageGalleryThumbsBox {
    box-sizing: border-box;
    flex: 0 0 auto;
    max-width: min(920px, calc(100vw - 32px)) !important;
    overflow: hidden;
    width: min(920px, calc(100vw - 32px)) !important;
}

/* No edge-fade overlays — they fought the rail surface and clipped thumbs poorly */
.productImageGallery .imageGalleryThumbsBox::before,
.productImageGallery .imageGalleryThumbsBox::after {
    content: none !important;
    display: none !important;
}

.productImageGallery .imageGalleryThumbs {
    box-sizing: border-box;
    overflow: hidden;
    padding: 6px;
    border: 1px solid color-mix(in srgb, var(--ts-gallery-text) 18%, transparent);
    border-radius: 14px;
    background: var(--ts-gallery-rail-surface) !important;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--text-on-brand) 18%, transparent),
        0 12px 28px var(--shadow-color);
}

.productImageGallery .imageGalleryThumbs .swiper-wrapper {
    align-items: stretch;
    min-width: max-content;
}

.productImageGallery .imageGalleryThumbs .swiper-slide {
    position: relative;
    flex: 0 0 var(--ts-gallery-thumb-width);
    box-sizing: border-box;
    width: var(--ts-gallery-thumb-width) !important;
    height: var(--ts-gallery-thumb-height) !important;
    margin-inline: calc(var(--ts-gallery-thumb-gap) / 2);
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--ts-gallery-text) 14%, transparent) !important;
    border-radius: 9px !important;
    background: var(--ts-gallery-media-canvas);
    cursor: pointer;
    opacity: .94;
    backface-visibility: hidden;
    transition:
        border-color 180ms var(--theme-motion-ease),
        opacity 180ms var(--theme-motion-ease);
}

@media (hover: hover) and (pointer: fine) {
    .productImageGallery .imageGalleryThumbs .swiper-slide:hover {
        opacity: .95;
        border-color: color-mix(in srgb, var(--ts-gallery-text) 28%, transparent) !important;
    }
}

.productImageGallery .imageGalleryThumbs .swiper-slide.ts-product-gallery-thumb-active {
    flex-basis: var(--ts-gallery-thumb-width);
    width: var(--ts-gallery-thumb-width) !important;
    border-color: var(--ts-gallery-accent) !important;
    opacity: 1;
}

/* Kill the legacy floating center bar from product.css */
.productImageGallery .imageGalleryThumbs .swiper-slide.swiper-slide-thumb-active::before,
.productImageGallery .imageGalleryThumbs .swiper-slide.ts-product-gallery-thumb-active::before {
    content: none !important;
    display: none !important;
}

/* Full-width bottom chrome accent — attached to the card edge, not floating on media */
.productImageGallery .imageGalleryThumbs .swiper-slide.ts-product-gallery-thumb-active::after {
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 2;
    height: 3px;
    border-radius: 0 0 8px 8px;
    background: var(--ts-gallery-accent);
    content: "";
    pointer-events: none;
}

.productImageGallery .imageGalleryThumbs .swiper-slide:focus-visible {
    outline: 2px solid var(--ts-gallery-focus);
    outline-offset: -3px;
}

.productImageGallery .imageGalleryThumbs .swiper-slide > img {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 100% !important;
    margin: 0;
    padding: 2px !important;
    border: 0;
    background: var(--ts-gallery-media-canvas);
    object-fit: contain;
    object-position: center;
    opacity: 1;
    transform: none;
    transition:
        filter 180ms var(--theme-motion-ease),
        opacity 180ms var(--theme-motion-ease);
}

.productImageGallery .imageGalleryThumbs .swiper-slide.ts-product-gallery-thumb-active > img {
    filter: none;
    opacity: 1;
    transform: none;
}

.productImageGallery .imageGalleryThumbs .swiper-slide > img {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.productImageGallery .ts-product-gallery-counter {
    position: absolute;
    isolation: isolate;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    border: 1px solid var(--ts-gallery-glass-border);
    border-radius: 999px;
    background: var(--surface-overlay);
    background: var(--ts-gallery-glass-surface);
    -webkit-backdrop-filter: blur(18px) saturate(140%) contrast(105%);
    backdrop-filter: blur(18px) saturate(140%) contrast(105%);
    box-shadow:
        inset 0 1px 0 var(--ts-gallery-glass-highlight),
        inset 0 -1px 0 color-mix(in srgb, var(--surface-navigation) 34%, transparent),
        0 10px 26px var(--shadow-color);
    color: var(--text-on-brand);
    direction: ltr;
    display: inline-flex;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-variation-settings: "wght" 600;
    letter-spacing: .02em;
    left: 50%;
    height: 32px !important;
    justify-content: center;
    line-height: 1;
    min-width: 64px;
    padding: 0 12px;
    text-align: center;
    top: auto !important;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 13;
}

.productImageGallery .ts-product-gallery-counter::before {
    position: absolute;
    inset: 1px;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(
        132deg,
        var(--ts-gallery-glass-highlight),
        transparent 46%
    );
    content: "";
    opacity: .7;
    pointer-events: none;
}

.productImageGallery .ts-product-gallery-counter[hidden] {
    display: none;
}

.productImageGallery .ts-product-gallery-counter-current {
    color: var(--ts-gallery-accent);
    min-width: 1.25em;
    text-align: end;
}

.productImageGallery .ts-product-gallery-counter-separator {
    color: color-mix(in srgb, var(--text-on-brand) 48%, transparent);
}

.productImageGallery .ts-product-gallery-counter-total {
    color: var(--text-on-brand);
    min-width: 1.25em;
    text-align: start;
}

.productImageGallery .ts-product-gallery-media-error,
.productImageGallery .ts-product-gallery-thumb-error {
    align-items: center;
    justify-content: center;
    color: var(--ts-gallery-muted);
    text-align: center;
}

.productImageGallery .ts-product-gallery-media-error {
    display: flex;
    box-sizing: border-box;
    width: min(320px, calc(100% - 48px));
    min-height: 120px;
    padding: 20px;
    border: 1px dashed var(--ts-gallery-border);
    border-radius: 16px;
    background: var(--ts-gallery-surface);
    font-size: 13px;
}

.productImageGallery .ts-product-gallery-thumb-error {
    position: absolute;
    inset: 2px;
    display: flex;
    border-radius: 7px;
    background: var(--surface-subtle);
    font-size: 16px;
    font-variation-settings: "wght" 700;
}

.productImageGallery .popup-gallery-prev[aria-disabled="true"],
.productImageGallery .popup-gallery-next[aria-disabled="true"] {
    opacity: .38;
    pointer-events: none;
}

.productImageGallery.is-gallery-fallback .imageGallery .swiper-wrapper {
    display: block;
    transform: none !important;
}

.productImageGallery.is-gallery-fallback .imageGallery .swiper-slide {
    display: none !important;
}

.productImageGallery.is-gallery-fallback .imageGallery .swiper-slide.is-fallback-active {
    display: flex !important;
}

@media (max-width: 782px) {
    body.admin-bar {
        --ts-gallery-admin-offset: 46px;
    }
}

@media (max-width: 767px) {
    .productImageGallery .close-popup {
        height: 42px;
        inset-inline-end: 12px;
        top: 12px;
        width: 42px;
    }

    .productImageGallery .galleryBox {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px;
        padding:
            62px
            max(8px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left)) !important;
    }

    .productImageGallery .imageGalleryBox {
        flex: 1 1 auto;
        height: auto !important;
        max-width: none;
        min-height: 0;
        width: 100% !important;
    }

    .productImageGallery .imageGallery {
        border-radius: 14px;
    }

    .productImageGallery .thumbGallery {
        border-radius: 12px;
        height: 76px !important;
        margin-top: 10px !important;
        padding: 6px !important;
        width: 100% !important;
    }

    .productImageGallery .imageGalleryThumbsBox {
        max-width: 100%;
    }

    .productImageGallery .imageGalleryThumbs {
        padding: 5px;
        border-radius: 12px;
    }

    .productImageGallery .imageGalleryThumbs .swiper-wrapper {
        min-width: 0;
        width: 100%;
    }

    .productImageGallery .imageGalleryThumbs .swiper-slide {
        flex-basis: calc((100% - 16px) / 5);
        width: calc((100% - 16px) / 5) !important;
        height: 60px !important;
        margin-inline: 0;
        border-radius: 8px !important;
    }

    .productImageGallery .imageGalleryThumbs .swiper-slide.ts-product-gallery-thumb-active {
        flex-basis: calc((100% - 16px) / 5);
        width: calc((100% - 16px) / 5) !important;
    }

    .productImageGallery .imageGalleryThumbs .swiper-slide > img,
    .productImageGallery .imageGalleryThumbs .swiper-slide.ts-product-gallery-thumb-active > img {
        padding: 3px !important;
        transform: none;
    }

    .productImageGallery .imageGalleryThumbs .swiper-slide.ts-product-gallery-thumb-active::after {
        border-radius: 0 0 7px 7px;
    }

    .productImageGallery .ts-product-gallery-zoom-hint {
        inset-inline-end: 10px;
        inset-block-start: 10px;
        font-size: 10px;
    }

    .productImageGallery .imageGallery .wbs-product-video-shell,
    .productImageGallery .imageGallery .wbs-product-video-shell.ts-video-player {
        border-radius: 12px !important;
    }

    .productImageGallery .imageGallery .wbs-product-video-play {
        min-height: 56px !important;
        gap: 10px !important;
        padding: 6px 12px 6px 6px !important;
    }

    .productImageGallery .imageGallery .wbs-product-video-play__icon {
        flex-basis: 40px !important;
        width: 40px !important;
        height: 40px !important;
    }

    .productImageGallery .imageGallery .wbs-product-video-play__copy strong {
        font-size: 13px !important;
    }

    .productImageGallery .imageGallery .wbs-product-video-play__copy span {
        font-size: 11px !important;
    }

    .productImageGallery .imageGalleryBox {
        width: 100% !important;
        max-width: none;
    }

    .productImageGallery .popup-gallery-prev,
    .productImageGallery .popup-gallery-next {
        height: 40px !important;
        width: 40px !important;
    }

    .productImageGallery .popup-gallery-prev {
        inset-inline-start: 8px !important;
    }

    .productImageGallery .popup-gallery-next {
        inset-inline-end: 8px !important;
    }

    .productImageGallery .ts-product-gallery-counter {
        bottom: 10px;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .productImageGallery .close-popup {
        top: max(8px, env(safe-area-inset-top));
    }

    .productImageGallery .galleryBox {
        gap: 8px;
        padding:
            52px
            max(8px, env(safe-area-inset-right))
            max(6px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left)) !important;
    }

    .productImageGallery .imageGalleryThumbs .swiper-slide {
        height: 52px !important;
    }
}

/* Poster-first video surfaces outside the fullscreen gallery. */
.product-galleries .wbs-product-video-slide {
    box-sizing: border-box;
    padding: clamp(12px, 4vw, 24px);
    background: var(--ts-gallery-media-canvas, var(--surface-card));
}

.product-galleries .wbs-product-video-shell,
.product-galleries .wbs-product-video-shell.ts-video-player {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: auto;
    aspect-ratio: var(--wbs-video-aspect-ratio, 16 / 9) !important;
    border: 1px solid color-mix(in srgb, var(--text-strong) 14%, transparent);
    border-radius: 18px;
    background: var(--surface-navigation);
    box-shadow: 0 12px 30px var(--shadow-color);
}

.product-galleries .wbs-product-video-shell.is-portrait,
.product-galleries .wbs-product-video-shell.ts-video-player.is-portrait {
    width: auto !important;
    max-width: 100% !important;
    max-height: min(76vw, 520px);
}

.wbs-product-video-shell {
    position: relative;
}

.wbs-product-video-poster {
    position: absolute !important;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: inherit !important;
    background: var(--surface-navigation) !important;
    object-fit: cover !important;
    pointer-events: none;
}

.wbs-product-video-shell::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--surface-overlay) 12%, transparent),
        color-mix(in srgb, var(--surface-overlay) 72%, transparent)
    );
    content: "";
    pointer-events: none;
}

.wbs-product-video-shell.is-loaded::after,
.wbs-product-video-shell.ts-video-player.has-started::after {
    opacity: 0;
}

.wbs-product-video-shell .wbs-product-video-play {
    position: relative;
    z-index: 2;
}

.wbs-product-video-inline-thumb button,
.productImageGallery .imageGalleryThumbs .wbs-product-video-gallery-thumb {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.wbs-product-video-inline-thumb .wbs-product-video-gallery-thumb__image,
.productImageGallery .imageGalleryThumbs .wbs-product-video-gallery-thumb__image {
    position: absolute !important;
    inset: 0;
    z-index: -2;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    border-radius: inherit !important;
    background: var(--surface-navigation) !important;
    object-fit: cover !important;
    transform: none !important;
    opacity: .76 !important;
}

.wbs-product-video-inline-thumb button::after,
.productImageGallery .imageGalleryThumbs .wbs-product-video-gallery-thumb::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: color-mix(in srgb, var(--surface-overlay) 54%, transparent);
    content: "";
    pointer-events: none;
}

.wbs-product-video-inline-thumb__icon,
.wbs-product-video-inline-thumb__label,
.productImageGallery .wbs-product-video-gallery-thumb__icon,
.productImageGallery .wbs-product-video-gallery-thumb__label {
    position: relative;
    z-index: 1;
}

.wbs-product-video-inline-thumb__icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid color-mix(in srgb, var(--theme-accent) 55%, transparent);
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface-overlay) 78%, transparent);
    color: var(--theme-accent);
}

.wbs-product-video-inline-thumb__icon i {
    font-size: 12px !important;
    transform: translateX(1px);
}

body.single-product #productDescription .ts-lazy-embed {
    width: min(100%, 960px);
    min-height: 0;
    margin: 30px auto !important;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--text-strong) 16%, transparent);
    border-radius: 18px;
    background: var(--surface-navigation);
    box-shadow: 0 16px 38px var(--shadow-color);
    color: var(--text-on-brand);
    line-height: 1.4;
    text-align-last: auto;
}

body.single-product #productDescription .ts-lazy-embed.has-poster {
    background: var(--surface-navigation);
}

body.single-product #productDescription .ts-lazy-embed__preview {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    opacity: 1;
}

body.single-product #productDescription .ts-lazy-embed__preview::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--surface-overlay) 16%, transparent),
        color-mix(in srgb, var(--surface-overlay) 76%, transparent)
    );
    content: "";
}

body.single-product #productDescription .ts-lazy-embed__poster {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    border-radius: inherit;
    object-fit: cover;
}

body.single-product #productDescription .ts-lazy-embed__content {
    position: relative;
    z-index: 2;
    gap: 9px;
    padding: clamp(18px, 4vw, 32px);
}

body.single-product #productDescription .ts-lazy-embed__provider {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 0;
    padding: 4px 10px;
    border: 1px solid color-mix(in srgb, var(--text-on-brand) 20%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-overlay) 82%, transparent);
    color: var(--text-on-brand);
    font-size: 11px;
    line-height: 1;
    opacity: 1;
}

body.single-product #productDescription .ts-lazy-embed__content > strong {
    margin: 0 !important;
    color: var(--text-on-brand);
    font-size: clamp(14px, 2vw, 17px);
    font-variation-settings: "wght" 650;
    line-height: 1.35;
}

body.single-product #productDescription .ts-lazy-embed__activate,
body.single-product #productDescription .ts-lazy-embed__retry {
    gap: 9px;
    min-height: 48px;
    margin: 2px 0 0;
    padding: 7px 16px 7px 9px;
    border: 1px solid color-mix(in srgb, var(--text-on-brand) 22%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-overlay) 88%, var(--surface-raised));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-on-brand) 18%, transparent);
    color: var(--text-on-brand);
    font-size: 13px;
    font-variation-settings: "wght" 650;
    line-height: 1;
}

body.single-product #productDescription .ts-lazy-embed__activate > span:first-child {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--theme-accent);
    color: var(--text-on-accent);
    font-size: 12px;
}

body.single-product #productDescription .ts-lazy-embed__activate:hover,
body.single-product #productDescription .ts-lazy-embed__retry:hover {
    border-color: var(--theme-accent);
    background: color-mix(in srgb, var(--surface-overlay) 82%, var(--theme-accent));
    color: var(--text-on-brand);
}

body.single-product #productDescription .ts-lazy-embed__activate:focus-visible,
body.single-product #productDescription .ts-lazy-embed__retry:focus-visible,
body.single-product #productDescription .ts-lazy-embed__direct:focus-visible {
    border-radius: 999px;
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

body.single-product #productDescription .ts-lazy-embed__direct {
    margin: 0;
    color: color-mix(in srgb, var(--text-on-brand) 78%, transparent);
    font-size: 11px;
    line-height: 1.4;
    text-underline-offset: 4px;
}

@media (max-width: 575.98px) {
    .product-galleries .wbs-product-video-slide {
        padding: 10px;
    }

    .product-galleries .wbs-product-video-shell,
    .product-galleries .wbs-product-video-shell.ts-video-player,
    body.single-product #productDescription .ts-lazy-embed {
        border-radius: 14px;
    }

    body.single-product #productDescription .ts-lazy-embed__content {
        gap: 7px;
        padding: 14px;
    }

    body.single-product #productDescription .ts-lazy-embed__provider {
        min-height: 24px;
        padding-inline: 8px;
        font-size: 10px;
    }

    body.single-product #productDescription .ts-lazy-embed__activate,
    body.single-product #productDescription .ts-lazy-embed__retry {
        min-height: 44px;
        padding: 5px 13px 5px 7px;
        font-size: 12px;
    }

    body.single-product #productDescription .ts-lazy-embed__activate > span:first-child {
        width: 32px;
        height: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .desktop-product-gallery-prev,
    .desktop-product-gallery-next,
    .productImageGallery .close-popup,
    .productImageGallery .popup-gallery-prev,
    .productImageGallery .popup-gallery-next,
    .productImageGallery .ts-product-gallery-zoom-hint {
        transition: none;
    }

    .productImageGallery .imageGalleryThumbs .swiper-slide {
        transition: none;
    }

    .productImageGallery .imageGalleryThumbs .swiper-slide > img,
    .productImageGallery .imageGalleryThumbs .wbs-product-video-gallery-thumb,
    .productImageGallery .imageGallery img {
        transition: none;
    }
}

/* Prevent the RTL mobile gallery from shrink-wrapping during variation swaps. */
body.single-product #site-main .product-image-panel > .image,
body.single-product #site-main .product-image-panel .product-galleries-panel,
body.single-product #site-main .product-image-panel .product-galleries {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.product-galleries,
.product-galleries > .swiper-wrapper,
.product-galleries > .swiper-wrapper > .swiper-slide {
    min-width: 0;
    max-width: 100%;
}

.product-galleries > .swiper-wrapper > .swiper-slide {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.product-galleries > .swiper-wrapper > .swiper-slide img,
.product-galleries > .swiper-wrapper > .swiper-slide picture {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.product-galleries > .swiper-wrapper > .wbs-product-image-slide {
    display: grid;
    aspect-ratio: 1 / 1;
    place-items: center;
}

.product-galleries > .swiper-wrapper > .wbs-product-image-slide picture,
.product-galleries > .swiper-wrapper > .wbs-product-image-slide img {
    width: 100%;
    height: 100%;
}

.product-galleries > .swiper-wrapper > .wbs-product-image-slide img {
    object-fit: contain;
}
