/* =============================================================================
 *  Wulks Gallery  —  gallery.css  v1.0.0
 * ============================================================================= */

/* ── Editor placeholder ──────────────────────────────────────────────────────*/
.wg-editor-placeholder {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 200px; gap: 12px;
    background: #f3f4f6; border: 2px dashed #d1d5db;
    border-radius: 12px; color: #9ca3af;
    font-size: 14px; text-align: center; padding: 24px;
}
.wg-editor-placeholder .eicon-gallery-justified {
    font-size: 40px; color: #d1d5db;
}
.wg-no-image {
    display: flex; align-items: center; justify-content: center;
    min-height: 200px; background: #f9fafb;
    border-radius: 12px; color: #9ca3af; font-size: 14px;
}

/* ── Outer wrap ──────────────────────────────────────────────────────────────*/
/*
 * The wrap background should fill the full row width including the card column.
 * We use a negative right margin + right padding trick so the dark background
 * bleeds behind the adjacent card column while content stays left-aligned.
 * The values here are intentionally large (9999px) to guarantee full coverage
 * regardless of viewport width.
 */
.wg-wrap {
    background: #0e0e0e;
    padding: 20px 20px 16px;
    width: 100%;
    box-sizing: border-box;
}

.elementor-section:has(.wg-wrap),
.e-con:has(.wg-wrap) {
    overflow: hidden;
    background: #0e0e0e;
}

/* Force the Elementor widget container to not collapse */
.elementor-widget-wulks-gallery .elementor-widget-container {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    width: 100%;
}

/* ── Main gallery stage ──────────────────────────────────────────────────────*/
.wg-gallery-sizer {
    position: relative;
    width: 100%;
    height: 520px;
    border-radius: 14px;
    overflow: hidden;
    background: #f5f0ea;
    cursor: zoom-in;
}

.wg-gallery {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 14px;
    background: #f5f0ea;
}

/* Slides */
.wg-slide {
    position: absolute; inset: 0;
    opacity: 0;
    transition: opacity 0.45s ease;
    display: flex; align-items: center; justify-content: center;
    background: #f5f0ea;
}
.wg-slide.is-active { opacity: 1; }

.wg-slide img {
    width: 100%; height: 100%;
    object-fit: contain;    /* show full product, no cropping */
    object-position: center;
    padding: 12px;
    box-sizing: border-box;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}
.wg-prev, .wg-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.18);
    color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10; font-size: 22px; line-height: 1;
    transition: background 0.2s, border-color 0.2s;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.wg-prev:hover, .wg-next:hover {
    background: #e8730a; border-color: #e8730a;
}
.wg-prev { left: 14px; }
.wg-next { right: 14px; }

/* ── Thumbnail strip ─────────────────────────────────────────────────────────*/
.wg-thumbs {
    display: flex; gap: 8px;
    padding: 12px 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.wg-thumbs::-webkit-scrollbar { display: none; }

.wg-thumb {
    flex-shrink: 0;
    width: 64px; height: 64px;
    border-radius: 7px; overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    background: #f5f0ea;
    transition: border-color 0.18s, transform 0.18s;
    outline: none;
}
.wg-thumb:focus-visible { outline: 2px solid #e8730a; outline-offset: 2px; }
.wg-thumb.is-active { border-color: #e8730a; }
.wg-thumb:hover:not(.is-active) {
    border-color: rgba(232,115,10,0.45);
    transform: scale(1.06);
}
/* Thumbnails: cover fills the frame, rounded corners clip edges cleanly */
.wg-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* ── Lightbox ────────────────────────────────────────────────────────────────*/
.wg-lightbox {
    display: none;
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,0.94);
    flex-direction: column; align-items: center; justify-content: center;
    padding: 24px 16px 16px;
}
.wg-lightbox.is-open { display: flex; }

.wg-lb-close {
    position: absolute; top: 16px; right: 20px;
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 22px; z-index: 2;
    transition: background 0.2s;
}
.wg-lb-close:hover { background: rgba(255,255,255,0.2); }

.wg-lb-stage {
    position: relative; flex: 1;
    width: 100%; max-width: 960px;
    display: flex; align-items: center; justify-content: center;
    min-height: 0;
}
.wg-lb-img {
    max-width: 100%; max-height: 100%;
    object-fit: contain; display: block;
    border-radius: 4px;
}
.wg-lb-prev, .wg-lb-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 24px; transition: background 0.2s;
}
.wg-lb-prev:hover, .wg-lb-next:hover { background: #e8730a; border-color: #e8730a; }
.wg-lb-prev { left: -56px; }
.wg-lb-next { right: -56px; }

.wg-lb-thumbs {
    flex-shrink: 0; display: flex; gap: 8px;
    margin-top: 20px; overflow-x: auto;
    max-width: 960px; width: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.wg-lb-thumb {
    flex-shrink: 0; width: 72px; height: 72px;
    border-radius: 6px; overflow: hidden;
    border: 2px solid transparent; cursor: pointer;
    background: #1a1a1a;
    transition: border-color 0.18s, transform 0.18s;
    outline: none;
}
.wg-lb-thumb:focus-visible { outline: 2px solid #e8730a; }
.wg-lb-thumb.is-active     { border-color: #e8730a; }
.wg-lb-thumb:hover:not(.is-active) { border-color: rgba(232,115,10,0.5); }
.wg-lb-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; box-sizing: border-box; display: block; }

.wg-lb-counter {
    position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%);
    font-size: 12px; color: rgba(255,255,255,0.4);
    letter-spacing: 0.06em; white-space: nowrap;
    font-family: system-ui, sans-serif;
}

.wg-lb-backdrop {
    display: none; position: fixed; inset: 0;
    background: transparent; z-index: 99998;
}
.wg-lightbox.is-open ~ .wg-lb-backdrop { display: block; }

/* ── Responsive ──────────────────────────────────────────────────────────────*/
@media (max-width: 768px) {
    .wg-wrap { padding: 12px 12px 12px; margin-right: 0; padding-right: 12px; }
    .wg-gallery { border-radius: 10px; cursor: default; min-height: 240px; }
    .wg-thumb { width: 52px; height: 52px; }
    .wg-lb-prev { left: 4px; }
    .wg-lb-next { right: 4px; }
    .wg-lb-thumb { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .wg-slide { transition: none; }
    .wg-thumb, .wg-lb-thumb { transition: none; }
}
