/* =====================================================
   VGD Product Gallery – gallery.css
   ===================================================== */

/* ── Container ── */
.vgd-gallery {
    width: 100%;
    max-width: 520px;
    margin: 0 0 16px;       /* flush left, minimal bottom gap */
    font-size: 0;
}

/* Kill WooCommerce's extra spacing around the gallery column */
.woocommerce div.product div.images {
    margin-bottom: 0 !important;
}

/* ── Stage (main big image) ── */
.vgd-stage-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
}

.vgd-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;   /* portrait – ideal for apparel; swap to 1/1 for square products */
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 6px;
}

.vgd-slide {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
}

.vgd-slide.active {
    display: flex;
}

.vgd-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ── Prev / Next arrows on stage ── */
.vgd-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.82);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    transition: background .15s, opacity .15s;
    padding: 0;
    opacity: 0.85;
}

.vgd-arrow:hover { background: #fff; opacity: 1; }
.vgd-arrow:disabled { opacity: 0.25; cursor: default; }

.vgd-prev { left: 8px; }
.vgd-next { right: 8px; }

/* ── VIDEO poster & play button ── */
.vgd-video-poster {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vgd-play-btn {
    width: 72px;
    height: 72px;
    transition: transform .2s;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}

.vgd-video-poster:hover .vgd-play-btn {
    transform: scale(1.12);
}

.vgd-play-btn svg { width: 100%; height: 100%; }

/* iframe that replaces the poster after click */
.vgd-video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.vgd-video-frame {
    position: absolute;
    inset: 0;
}

/* ── Thumbnail strip ── */
.vgd-thumbs-outer {
    display: flex;
    align-items: center;
    margin-top: 10px;
    gap: 4px;
}

.vgd-thumb-scroll {
    background: rgba(255,255,255,0.82);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s;
}

.vgd-thumb-scroll:hover { background: #fff; }
.vgd-thumb-scroll:disabled { opacity: 0.25; cursor: default; }

.vgd-thumbs-viewport {
    flex: 1;
    overflow: hidden;   /* we scroll the inner track via JS */
}

.vgd-thumbs-track {
    display: flex;
    gap: 8px;
    transition: transform .3s ease;
    will-change: transform;
}

/* Each thumb is 1/4 of the viewport minus gaps */
.vgd-thumb {
    flex: 0 0 calc(25% - 6px);
    aspect-ratio: 1 / 1;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: #f0f0f0;
    position: relative;
    transition: border-color .15s;
    font-size: 0;
}

.vgd-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vgd-thumb.active {
    border-color: #2c2c2c; /* adapt to your brand colour */
}

.vgd-thumb:hover:not(.active) {
    border-color: #999;
}

/* Video badge on thumbnail */
.vgd-thumb-video-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.35);
    color: #fff;
    font-size: 20px;
    z-index: 2;
    pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .vgd-play-btn { width: 54px; height: 54px; }
    .vgd-arrow { width: 30px; height: 30px; font-size: 18px; }
}
