/* Shared product gallery for T25C, T4, T11 and T14. */
.product-main-grid,
.product-main-grid > *,
.product-gallery,
.gallery-main {
    min-width: 0;
}

.product-gallery {
    display: flex;
    width: 100%;
    max-width: 100%;
    gap: 20px;
    overflow: hidden;
}

.gallery-thumbs {
    display: flex;
    flex: 0 0 80px;
    flex-direction: column;
    gap: 12px;
    width: 80px;
    max-width: 80px;
    max-height: 552px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    cursor: grab;
    scroll-behavior: smooth;
    scrollbar-width: none;
    touch-action: pan-y;
    user-select: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.gallery-thumbs.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.gallery-thumb-item {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    padding: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
}

.gallery-thumb-item:is(.active, :hover, :focus-visible) {
    border-color: var(--primary-color);
}

.gallery-thumb-item img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.gallery-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--white);
}

.gallery-main img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .product-gallery {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .gallery-thumbs {
        flex: 0 0 auto;
        flex-direction: row;
        width: 100%;
        max-width: 100%;
        max-height: none;
        padding-bottom: 4px;
        overflow-x: auto;
        overflow-y: hidden;
        touch-action: pan-x;
    }

    .gallery-thumb-item {
        flex: 0 0 64px;
        width: 64px;
        height: 64px;
    }

    .gallery-main {
        width: 100%;
        padding: 14px;
    }

    .gallery-main img {
        max-height: 340px;
    }
}
