/* WooCommerce Product Gallery – Elementor Widget | v1.0.0 */

/* ── Grid ── */
.wge-wrapper { width: 100%; box-sizing: border-box; }

.wge-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Item card ── */
.wge-item {
    position: relative;
    background: #111;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    display: block;
}

/* Ratio box */
.wge-img-ratio {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    overflow: hidden;
}

.wge-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

/* Auto height image */
.wge-img-auto {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.35s ease;
}

/* Zoom on hover */
.wge-zoom:hover .wge-img,
.wge-zoom:hover .wge-img-auto {
    transform: scale(1.07);
}

/* Hover overlay */
.wge-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 2;
}
.wge-item:hover .wge-overlay,
.wge-item:focus .wge-overlay { opacity: 1; }
.wge-overlay svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* Focus ring for keyboard */
.wge-item:focus { outline: 2px solid #fff; outline-offset: 2px; }

/* Empty state */
.wge-empty {
    padding: 24px;
    background: rgba(255,255,255,0.05);
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 6px;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
}

/* ────────────────────────────────────────
   LIGHTBOX
──────────────────────────────────────── */
.wge-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wgeFadeIn 0.2s ease;
}
@keyframes wgeFadeIn { from { opacity: 0; } to { opacity: 1; } }

.wge-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
}

.wge-lb-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 80px;
    box-sizing: border-box;
}

.wge-lb-img-wrap {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.wge-lb-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    animation: wgeSlideIn 0.22s ease;
    display: block;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
@keyframes wgeSlideIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* Close button */
.wge-lb-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    z-index: 2;
    transition: background 0.15s;
    padding: 0;
}
.wge-lb-close:hover { background: rgba(255,255,255,0.3); }

/* Prev / Next arrows */
.wge-lb-prev,
.wge-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.15s;
    z-index: 2;
    padding: 0;
}
.wge-lb-prev { left: 16px; }
.wge-lb-next { right: 16px; }
.wge-lb-prev:hover,
.wge-lb-next:hover { background: rgba(255,255,255,0.3); }
.wge-lb-prev svg,
.wge-lb-next svg { width: 22px; height: 22px; display: block; }

/* Counter */
.wge-lb-counter {
    margin-top: 14px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    letter-spacing: 1px;
    flex-shrink: 0;
}

/* Hide arrows when only 1 image */
.wge-lightbox[data-total="1"] .wge-lb-prev,
.wge-lightbox[data-total="1"] .wge-lb-next { display: none; }

/* ── Responsive defaults ── */
@media (max-width: 767px) {
    .wge-grid { grid-template-columns: repeat(2, 1fr); }
    .wge-lb-inner { padding: 56px 16px 16px; }
    .wge-lb-prev { left: 8px; }
    .wge-lb-next { right: 8px; }
    .wge-lb-img  { max-height: 70vh; }
}
@media (max-width: 1024px) and (min-width: 768px) {
    .wge-grid { grid-template-columns: repeat(3, 1fr); }
}
