/* =========================================================
   Woo Youtube Gallery – Frontend Styles
   ========================================================= */

/* ----- Gallery thumbnail ----- */
.wcyg-gallery-thumb {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 3px;
    overflow: hidden;
    line-height: 0;
    /* Size is set dynamically by JS to match existing gallery thumbs */
    transition: opacity 0.2s ease;
}

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

.wcyg-gallery-thumb:hover { opacity: 0.85; }

.wcyg-gallery-thumb:focus-visible {
    outline: 2px solid #c00;
    outline-offset: 2px;
}

/* Play button overlay */
.wcyg-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.wcyg-play-icon svg {
    width: 36px;
    height: 26px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
    transition: transform 0.15s ease;
}

.wcyg-gallery-thumb:hover .wcyg-play-icon svg { transform: scale(1.12); }

/* ----- In WooCommerce flex strip <li> ----- */
.flex-control-thumbs li.wcyg-flex-item {
    /* Let JS control the size; just remove any conflicting constraints */
    overflow: visible !important;
}

.flex-control-thumbs li.wcyg-flex-item .wcyg-gallery-thumb {
    display: block;
}

/* ----- Standalone strip (no gallery images) ----- */
.wcyg-thumb-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 0 0;
    width: 100%;
}

.et_pb_wc_images + .wcyg-thumb-strip {
    padding: 8px 0 0;
}

/* ----- Lightbox ----- */
.wcyg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.wcyg-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.wcyg-lightbox-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    animation: wcygFadeIn 0.22s ease;
}

@keyframes wcygFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.wcyg-lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(0,0,0,0.55);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    padding: 0;
    transition: background 0.15s;
}

.wcyg-lightbox-close:hover { background: rgba(200,0,0,0.8); }
.wcyg-lightbox-close svg { width: 18px; height: 18px; }

.wcyg-lightbox-title {
    padding: 10px 50px 10px 14px;
    font-size: 14px;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1px;
    font-family: inherit;
}

.wcyg-lightbox-title:empty { display: none; }

.wcyg-video-container {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}

.wcyg-video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 480px) {
    .wcyg-lightbox { padding: 8px; }
    .wcyg-play-icon svg { width: 28px; height: 20px; }
}
