/* WYG – Frontend styles */

/* ── Standalone thumb list (fallback when no Flexslider nav found) ── */
.wyg-standalone-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.wyg-standalone-thumbs .wyg-thumb-item {
    width: calc(25% - 6px);
    min-width: 80px;
}

/* ── Individual thumb (used in both Flexslider li and standalone) ─── */
.wyg-thumb-item {
    list-style: none;
}

.wyg-thumb {
    position: relative;
    display: block;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 3px;
    overflow: hidden;
    transition: border-color 0.2s;
    background: #000;
    aspect-ratio: 16 / 9;
    width: 100%;
}

/* Match WooCommerce active thumbnail style */
.wyg-thumb:hover,
.wyg-thumb:focus,
.wyg-thumb.wyg-active {
    border-color: #ff0000;
    outline: none;
}

.wyg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.wyg-thumb:hover img {
    opacity: 0.82;
}

/* ── Play overlay icon ──────────────────────────────────────────── */
.wyg-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,.55));
    transition: transform 0.15s;
}

.wyg-thumb:hover .wyg-play-icon {
    transform: translate(-50%, -50%) scale(1.15);
}

.wyg-play-bg {
    fill: rgba(20, 20, 20, 0.80);
    transition: fill 0.15s;
}

.wyg-thumb:hover .wyg-play-bg {
    fill: #ff0000;
}

.wyg-play-arrow {
    fill: #fff;
}

/* ── Lightbox overlay ───────────────────────────────────────────── */
#wyg-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.90);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

#wyg-lightbox.wyg-open {
    display: flex;
}

#wyg-lightbox-inner {
    position: relative;
    width: 90vw;
    max-width: 960px;
}

#wyg-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.15s, transform 0.15s;
}

#wyg-lightbox-close:hover {
    color: #ff0000;
    transform: scale(1.15);
}

#wyg-iframe-wrap {
    position: relative;
    padding-top: 56.25%;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 8px 48px rgba(0,0,0,.7);
}

#wyg-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Flexslider li context – match WC thumb size ────────────────── */
.flex-control-nav .wyg-thumb-item {
    width: 100%;
}

@media (max-width: 600px) {
    #wyg-lightbox-inner { width: 96vw; }

    .wyg-standalone-thumbs .wyg-thumb-item {
        width: calc(33.333% - 6px);
    }
}
