.product-gallery {
    width: 100%;
    /* max-width: 600px; */
    background-color: #00000000;
    /* border: 1px solid #ddd; */
    /* border-radius: 8px; */
    overflow: hidden;
    margin-bottom: 20px;
}

.product-gallery .main-media {
    width: 100%;
    position: relative;
    display: flex;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    background: transparent;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    touch-action: pan-x;
    /* Explicit touch handle */
    transition: height 0.3s ease-out;
}

.product-gallery .main-media::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.product-gallery .main-media .media-item {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: center;
    display: flex;
    /* align-items: center; */
    /* justify-content: center; */
    box-sizing: border-box;
    position: relative;
}

.wmg-media-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
}

.product-gallery .main-media img,
.product-gallery .main-media video {
    width: 100%;
    object-fit: cover;
    display: block;
}

.product-gallery .wmg-extend-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    border: none;
    border-radius: 4px;
    width: 38px;
    height: 38px;
    padding: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.product-gallery .wmg-extend-button:hover {
    background: #fff;
}

.product-gallery .wmg-extend-button img {
    width: 28px;
    height: 28px;
}

/* Lightbox Styles */
.wmg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wmg-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.wmg-lightbox-content {
    position: relative;
    width: 90%;
    height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.wmg-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    line-height: 40px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.wmg-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wmg-lightbox-main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.wmg-lightbox-main img,
.wmg-lightbox-main video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    outline: none;
}

.wmg-lightbox-thumbnails {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    /* Hide for Firefox */
    -ms-overflow-style: none;
    /* Hide for IE/Edge */
}

.wmg-lightbox-thumbnails::-webkit-scrollbar {
    display: none;
    /* Hide for Chrome/Safari */
}

.wmg-lightbox-thumbnails .thumbnail {
    width: 60px;
    height: 60px;
    opacity: 0.4;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s;
    overflow: hidden;
    flex-shrink: 0;
}

.wmg-lightbox-thumbnails .thumbnail.active {
    opacity: 1;
    border-color: #fff;
    transform: scale(1.1);
}

.product-gallery .main-media video::-webkit-media-controls {
    display: none !important;
}

.product-gallery .main-media video::-webkit-media-controls-enclosure {
    display: none !important;
}

.product-gallery .main-media video::-webkit-media-controls-panel {
    display: none !important;
}

.product-gallery .main-media video::-webkit-media-controls-play-button {
    display: none !important;
}

.product-gallery .main-media video::-webkit-media-controls-current-time-display {
    display: none !important;
}

.product-gallery .main-media video::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

.product-gallery .main-media video::-webkit-media-controls-timeline {
    display: none !important;
}

.product-gallery .main-media video::-webkit-media-controls-volume-slider {
    display: none !important;
}

.product-gallery .main-media video::-webkit-media-controls-mute-button {
    display: none !important;
}

.product-gallery .main-media video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

.product-gallery .wmg-video-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    /* Let clicks pass through to video/button */
}

.product-gallery .wmg-video-controls button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    pointer-events: auto;
}

.product-gallery .wmg-video-controls button img {
    width: 50px;
    height: 50px;
}

.product-gallery .wmg-video-controls button:hover img {
    transform: scale(1.1);
}

.product-gallery .thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px;
    background-color: #00000000;
    justify-content: start;
}

.product-gallery .thumbnail {
    width: 80px;
    height: 80px;
    margin: 0px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.3s;
    position: relative;
    overflow: hidden;
}

.product-gallery .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-gallery .thumbnail:hover {
    border-color: #ccc;
}

.product-gallery .thumbnail.active {
    border-color: #ea232a;
}

.product-gallery .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    transition: opacity 0.3s;
}

.product-gallery .play-icon img {
    width: 40px;
    height: 40px;
}

.product-gallery .thumbnail:hover .play-icon {
    opacity: 0.8;
}