/* Woo Gallery Widget — wgw.css v1.0.0 | Author: Ido Levi */

/* ── Reset ─────────────────────────────────────────────────── */
.wgw-wrap { width: 100%; box-sizing: border-box; display: block; }
.wgw-wrap * { box-sizing: border-box; }

/* Placeholder */
.wgw-placeholder {
    padding: 50px 20px;
    text-align: center;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 8px;
    color: #aaa;
}
.wgw-placeholder p { margin: 12px 0 0; font-size: 14px; }

/* ── Spinner / Loader ────────────────────────────────────────── */
.wgw-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.6);
    z-index: 20;
    border-radius: inherit;
    transition: opacity 0.25s;
    pointer-events: none;
}
.wgw-lb-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
}
.wgw-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0,0,0,0.12);
    border-top-color: #555;
    border-radius: 50%;
    animation: wgw-spin 0.7s linear infinite;
    flex-shrink: 0;
}
.wgw-spinner-white { border-color: rgba(255,255,255,0.25); border-top-color: #fff; }
@keyframes wgw-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════
   MAIN IMAGE
══════════════════════════════════════════════════════════════ */
.wgw-main-img {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    display: block !important;
    flex-shrink: 0;
}
.wgw-main-img img {
    display: block !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    max-height: none !important;
    max-width: none !important;
    margin: 0;
    padding: 0;
}

/* ══════════════════════════════════════════════════════════════
   THUMBNAILS
══════════════════════════════════════════════════════════════ */
.wgw-thumb {
    display: block;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.55;
    position: relative;
    transition: opacity 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}
.wgw-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}
.wgw-thumb.active               { opacity: 1; }
.wgw-thumb:not(.active):hover   { opacity: 0.85; transform: scale(1.04); }

/* ══════════════════════════════════════════════════════════════
   1. THUMBS SIDE
══════════════════════════════════════════════════════════════ */
.wgw-layout-side {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}
.wgw-layout-side.pos-right { flex-direction: row; }
.wgw-layout-side.pos-left  { flex-direction: row-reverse; }

/* תמונה ראשית בסגנון 1 — תופסת את כל הרוחב שנשאר */
.wgw-layout-side .wgw-main-img {
    flex: 1 1 auto;
    width: 0;           /* חשוב: מאפשר ל-flex לחשב רוחב */
    min-width: 0;
}

.wgw-thumbs-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   2. THUMBS BOTTOM
══════════════════════════════════════════════════════════════ */
.wgw-layout-bottom {
    display: block;
    width: 100%;
}
.wgw-layout-bottom .wgw-main-img {
    display: block !important;
    width: 100%;
    height: 500px;
    margin-bottom: 10px;
    flex: none;
}
.wgw-thumbs-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
    width: 100%;
}
.wgw-thumbs-row .wgw-thumb { scroll-snap-align: start; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   3. GRID
══════════════════════════════════════════════════════════════ */
.wgw-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}
.wgw-grid-img {
    display: block;
    overflow: hidden;
    height: 240px;
    position: relative;
    cursor: zoom-in;
}
.wgw-grid-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.35s ease;
}
.wgw-grid-img:hover img         { transform: scale(1.04); }
.wgw-grid-img.first-full        { grid-column: 1 / -1; height: 360px; }

/* ══════════════════════════════════════════════════════════════
   4. ZOOM
══════════════════════════════════════════════════════════════ */
.wgw-layout-zoom {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.wgw-zoom-wrap {
    position: relative;
    width: 100%;
    height: 500px;        /* Elementor ידרוס */
    overflow: hidden;
    display: block;
    flex-shrink: 0;
    cursor: crosshair;
}
.wgw-zoom-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    will-change: transform;
}
.wgw-zoom-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 2;
}
.wgw-zoom-wrap:hover .wgw-zoom-hint { opacity: 0; }

/* ══════════════════════════════════════════════════════════════
   5. SLIDER
══════════════════════════════════════════════════════════════ */
.wgw-slider-outer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.wgw-slider-wrap {
    position: relative;
    width: 100%;
    height: 500px;        /* Elementor ידרוס */
    overflow: hidden;
    display: block;
    flex-shrink: 0;
}
.wgw-slider-track {
    position: relative;
    width: 100%;
    height: 100%;
}
.wgw-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}
.wgw-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
/* Arrows */
.wgw-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    padding: 0;
    color: #333;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.wgw-arrow:hover { background: #fff; }
.wgw-arrow.prev  { left: 12px; }
.wgw-arrow.next  { right: 12px; }
/* Dots */
.wgw-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 8px 0 4px;
    flex-shrink: 0;
}
.wgw-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0,0,0,0.2);
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background 0.25s, transform 0.25s, width 0.25s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.wgw-dot:hover { background: rgba(0,0,0,0.4); }
.wgw-dot.active {
    background: #333;
    width: 20px;
    border-radius: 3px;
    transform: none;
}

/* ══════════════════════════════════════════════════════════════
   6. STACKED
══════════════════════════════════════════════════════════════ */
.wgw-stacked {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.wgw-stack-img {
    display: block;
    width: 100%;
    height: 500px;        /* Elementor ידרוס */
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.wgw-stack-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.35s ease;
}
.wgw-stack-img:hover img { transform: scale(1.03); }

/* ══════════════════════════════════════════════════════════════
   LIGHTBOX OVERLAY
══════════════════════════════════════════════════════════════ */
.wgw-lb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.93);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
    -webkit-tap-highlight-color: transparent;
}
.wgw-lb-overlay.open { opacity: 1; }
.wgw-lb-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 60px;
    min-height: 60px;
    cursor: default;
}
.wgw-lb-close {
    position: fixed;
    top: 14px; right: 18px;
    background: rgba(255,255,255,0.15);
    border: none; border-radius: 50%;
    width: 42px; height: 42px;
    color: #fff; font-size: 24px;
    cursor: pointer; z-index: 1000000;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    padding: 0;
}
.wgw-lb-close:hover { background: rgba(255,255,255,0.28); }
.wgw-lb-nav {
    position: fixed;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none; color: #fff;
    font-size: 34px; padding: 10px 18px;
    cursor: pointer; z-index: 1000000;
    border-radius: 6px;
    transition: background 0.2s;
    line-height: 1;
}
.wgw-lb-nav:hover { background: rgba(255,255,255,0.25); }
.wgw-lb-nav.prev  { left: 12px; }
.wgw-lb-nav.next  { right: 12px; }
.wgw-lb-counter {
    position: fixed;
    bottom: 16px; left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 13px; z-index: 1000000;
    background: rgba(0,0,0,0.4);
    padding: 4px 12px;
    border-radius: 20px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    /* סגנון 1: הופך לעמודה — תמונה ראשית מעל, מוקטנות מתחת */
    .wgw-layout-side {
        flex-direction: column !important;
        width: 100%;
        overflow: hidden;
    }
    .wgw-layout-side .wgw-main-img {
        width: 100% !important;
        flex: none !important;
        min-width: 0 !important;
    }
    .wgw-wrap,
    .wgw-layout-side,
    .wgw-layout-bottom,
    .wgw-layout-zoom {
        max-width: 100%;
        overflow: hidden;
    }
    .wgw-thumbs-col {
        flex-direction: row !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        padding-bottom: 4px;
    }
    .wgw-thumbs-col .wgw-thumb,
    .wgw-thumbs-row .wgw-thumb {
        width: 60px !important;
        height: 60px !important;
        flex-shrink: 0;
    }

    /* Grid — עמודה אחת */
    .wgw-grid { grid-template-columns: 1fr !important; }
    .wgw-grid-img.first-full { height: 240px; }

    /* Slider */
    .wgw-arrow { width: 36px; height: 36px; font-size: 18px; }
    .wgw-arrow.prev { left: 8px; }
    .wgw-arrow.next { right: 8px; }

    /* Lightbox nav */
    .wgw-lb-nav { font-size: 26px; padding: 8px 12px; }
    .wgw-lb-nav.prev { left: 4px; }
    .wgw-lb-nav.next { right: 4px; }

    /* Zoom hint נעלם במובייל */
    .wgw-zoom-hint { display: none; }

    /* Slider — גובה קטן יותר במובייל */
    .wgw-slider-wrap { height: 260px !important; }
    .wgw-slide       { height: 260px !important; }

    /* Stacked — גובה קטן יותר לכל תמונה */
    .wgw-stack-img { height: 260px !important; }

    /* Zoom wrap */
    .wgw-zoom-wrap { height: 260px !important; }

    /* תמונה ראשית */
    .wgw-main-img { height: 260px !important; }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .wgw-thumb { width: 68px; height: 68px; }
}
