/* ============================================================
   Visual Editor by Edge Technologies – Product Gallery Widget
   ============================================================ */

/* ── Wrapper ──────────────────────────────────────────────────── */
.edd-product-gallery {
    width: 100%;
    --edd-active-color: #000;
}

/* ── FOUC Prevention: hide slides until Swiper initialises ────── */
/*
 * Before Swiper adds `.swiper-initialized`, the wrapper is invisible.
 * This prevents slides stacking vertically during JS load (1-5 s flash).
 */
.edd-main-swiper:not(.swiper-initialized) .swiper-wrapper,
.edd-thumbs-swiper:not(.swiper-initialized) .swiper-wrapper {
    display: flex;
    overflow: hidden;
    height: 0;
    visibility: hidden;
}

/*
 * While the main swiper is not yet initialised, show a sized placeholder
 * so the page doesn't collapse / jump. The aspect-ratio holds the space.
 */
.edd-main-swiper:not(.swiper-initialized) {
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    border-radius: 8px;
}

.edd-thumbs-swiper:not(.swiper-initialized) {
    height: 0;          /* will be invisible – no flash */
    overflow: hidden;
}

/* ── Main Swiper ──────────────────────────────────────────────── */
.edd-main-swiper {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.edd-main-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    background: #f5f5f5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edd-main-stage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Lightbox trigger & zoom icon ──────────────────────────────── */
.edd-lightbox-trigger {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    cursor: zoom-in;
}

.edd-zoom-icon {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 20px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.edd-main-stage:hover .edd-zoom-icon {
    opacity: 1;
}

/* ── Video stages ──────────────────────────────────────────────── */
.edd-video-stage .edd-lightbox-trigger {
    cursor: pointer;
}

.edd-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    pointer-events: none;
}

.edd-video-stage:hover .edd-play-btn {
    background: rgba(0,0,0,0.75);
    transform: translate(-50%, -50%) scale(1.1);
}

/* ── Main Swiper Arrows ────────────────────────────────────────── */
.edd-main-prev,
.edd-main-next {
    width: 40px !important;
    height: 40px !important;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    transition: background 0.2s;
}

.edd-main-prev:after,
.edd-main-next:after {
    font-size: 14px !important;
    font-weight: 700;
    color: #fff;
}

.edd-main-prev:hover,
.edd-main-next:hover {
    background: rgba(0,0,0,0.7);
}

/* ── Thumbnail Swiper ──────────────────────────────────────────── */
.edd-thumbs-swiper {
    width: 100%;
}

.edd-thumbs-swiper .swiper-slide {
    opacity: 0.55;
    transition: opacity 0.2s;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
}

.edd-thumbs-swiper .swiper-slide:hover {
    opacity: 0.85;
}

.edd-thumb-slide.edd-active {
    opacity: 1;
    outline: 2px solid var(--edd-active-color, #000);
    outline-offset: 2px;
}

.edd-thumb-inner {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: inherit;
}

.edd-thumb-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.edd-thumb-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ── Thumbnail Arrows ──────────────────────────────────────────── */
.edd-thumb-prev,
.edd-thumb-next {
    width: 26px !important;
    height: 26px !important;
    background: rgba(0,0,0,0.35) !important;
    border-radius: 50% !important;
    transition: background 0.2s !important;
}

.edd-thumb-prev:after,
.edd-thumb-next:after {
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #fff !important;
}

.edd-thumb-prev:hover,
.edd-thumb-next:hover {
    background: rgba(0,0,0,0.65) !important;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .edd-play-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}
