/* ═══════════════════════════════════════════════════════════
   LUMIWALL PRODUCT GALLERY — Premium Dark Theme v1.0
   Design: Cinematic gallery, dark luxury, wall-art focused
   Palette: transparent → #111D2A → #4ECDC4 → #2C7BE5
   ═══════════════════════════════════════════════════════════ */

:root {
    --lwg-bg:              transparent;
    --lwg-bg-card:         #111D2A;
    --lwg-teal:            #4ECDC4;
    --lwg-blue:            #2C7BE5;
    --lwg-white:           #FFFFFF;
    --lwg-muted:           #6B7F94;
    --lwg-border:          rgba(78, 205, 196, 0.08);
    --lwg-border-active:   rgba(78, 205, 196, 0.5);
    --lwg-border-hover:    rgba(78, 205, 196, 0.22);
    --lwg-glow:            rgba(78, 205, 196, 0.12);
    --lwg-gradient:        linear-gradient(135deg, #4ECDC4, #2C7BE5);
    --lwg-radius:          16px;
    --lwg-radius-sm:       10px;
    --lwg-ease:            cubic-bezier(0.23, 1, 0.32, 1);
    --lwg-font:            'Sora', sans-serif;
    --lwg-thumb-gap:       10px;
}


/* ═══ LAYOUT — Wrapper ═══ */
.lwg {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    background: var(--lwg-bg);
}

/* Thumbs left */
.lwg--thumbs-left {
    flex-direction: row-reverse;
}
.lwg--thumbs-left .lwg-main {
    flex: 1;
    min-width: 0;
}
.lwg--thumbs-left .lwg-thumbs {
    width: 80px;
    flex-shrink: 0;
}

/* Thumbs right */
.lwg--thumbs-right {
    flex-direction: row;
}
.lwg--thumbs-right .lwg-main {
    flex: 1;
    min-width: 0;
}
.lwg--thumbs-right .lwg-thumbs {
    width: 80px;
    flex-shrink: 0;
}


/* ═══ MAIN IMAGE ═══ */
.lwg-main {
    position: relative;
    overflow: hidden;
    border-radius: var(--lwg-radius);
    border: 1px solid var(--lwg-border);
    background: transparent;
    transition:
        border-color 0.4s var(--lwg-ease),
        box-shadow 0.4s var(--lwg-ease);
}

.lwg-main:hover {
    border-color: var(--lwg-border-hover);
    box-shadow: 0 0 40px var(--lwg-glow);
}

.lwg-main__swiper {
    width: 100%;
    height: 100%;
}

.lwg-main .swiper-slide {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}


/* ─── Slide / Image ─── */
.lwg-slide {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    background: transparent;
}

.lwg-slide img,
.lwg-slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.6s var(--lwg-ease);
    background: transparent;
}

.lwg-slide video {
    pointer-events: none;
}

/* Zoom mode: contain → cover on hover for dramatic effect */
.lwg--zoom .lwg-slide:hover img {
    cursor: zoom-in;
}


/* ─── Aspect Ratios ─── */
.lwg-aspect--1-1  .lwg-main__swiper { aspect-ratio: 1 / 1; }
.lwg-aspect--4-3  .lwg-main__swiper { aspect-ratio: 4 / 3; }
.lwg-aspect--3-4  .lwg-main__swiper { aspect-ratio: 3 / 4; }
.lwg-aspect--2-3  .lwg-main__swiper { aspect-ratio: 2 / 3; }
.lwg-aspect--9-16 .lwg-main__swiper { aspect-ratio: 9 / 16; }
.lwg-aspect--auto .lwg-main__swiper { aspect-ratio: auto; }

/* Auto: wysokość z naturalnych proporcji grafiki — bez upscalingu, bez letterboksa.
   max-height to wyłącznie zabezpieczenie przed skrajnie wysokim portretem. */
.lwg-aspect--auto .lwg-main__swiper,
.lwg-aspect--auto .lwg-main .swiper-slide,
.lwg-aspect--auto .lwg-slide {
    height: auto;
}
.lwg-aspect--auto .lwg-slide img,
.lwg-aspect--auto .lwg-slide video {
    height: auto;
    max-height: 85vh;
    object-fit: contain;
}


/* ─── Zoom Lens (magnifier overlay) ─── */
.lwg-zoom-lens {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: 200%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 2;
    cursor: zoom-in;
}

.lwg-slide:hover .lwg-zoom-lens {
    opacity: 1;
    pointer-events: none;
}


/* ─── Navigation Arrows ─── */
.lwg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(78, 205, 196, 0.15);
    background: rgba(10, 18, 25, 0.7);
    color: var(--lwg-teal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition:
        background 0.3s var(--lwg-ease),
        border-color 0.3s var(--lwg-ease),
        box-shadow 0.3s var(--lwg-ease),
        opacity 0.3s var(--lwg-ease),
        transform 0.3s var(--lwg-ease);
    padding: 0;
    outline: none;
    opacity: 0;
}

.lwg-main:hover .lwg-arrow {
    opacity: 1;
}

.lwg-arrow:hover {
    background: rgba(78, 205, 196, 0.15);
    border-color: rgba(78, 205, 196, 0.35);
    box-shadow: 0 0 24px var(--lwg-glow);
    transform: translateY(-50%) scale(1.08);
}

.lwg-arrow--prev { left: 12px; }
.lwg-arrow--next { right: 12px; }

.lwg-arrow svg {
    stroke: var(--lwg-teal);
}

.lwg-arrow.swiper-button-disabled {
    opacity: 0 !important;
    pointer-events: none;
}


/* ─── Counter Badge ─── */
.lwg-counter {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 4;
    background: rgba(10, 18, 25, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(78, 205, 196, 0.12);
    border-radius: 100px;
    padding: 6px 14px;
    font-family: var(--lwg-font);
    font-size: 11px;
    font-weight: 600;
    color: var(--lwg-teal);
    letter-spacing: 1px;
    line-height: 1;
    pointer-events: none;
}

.lwg-counter__sep {
    opacity: 0.4;
    margin: 0 3px;
}


/* ─── Sale Badge ─── */
.lwg-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 4;
    background: rgba(78, 205, 196, 0.12);
    color: var(--lwg-teal);
    border: 1px solid rgba(78, 205, 196, 0.28);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 100px;
    font-family: var(--lwg-font);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 7px 16px;
    line-height: 1;
    pointer-events: none;
}


/* ─── Expand / Fullscreen Button ─── */
.lwg-expand {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(78, 205, 196, 0.12);
    background: rgba(10, 18, 25, 0.7);
    color: var(--lwg-teal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition:
        background 0.3s var(--lwg-ease),
        border-color 0.3s var(--lwg-ease),
        box-shadow 0.3s var(--lwg-ease),
        opacity 0.3s var(--lwg-ease);
    padding: 0;
    outline: none;
    opacity: 0;
}

.lwg-main:hover .lwg-expand {
    opacity: 1;
}

.lwg-expand:hover {
    background: rgba(78, 205, 196, 0.15);
    border-color: rgba(78, 205, 196, 0.35);
    box-shadow: 0 0 20px var(--lwg-glow);
}

.lwg-expand svg {
    stroke: var(--lwg-teal);
}


/* ═══ THUMBNAILS ═══ */
.lwg-thumbs {
    width: 100%;
}

.lwg-thumbs__swiper {
    width: 100%;
    overflow: hidden;
}

.lwg-thumbs .swiper-wrapper {
    display: flex;
    gap: 0; /* spacing is controlled by Swiper spaceBetween */
}

.lwg-thumbs .swiper-slide {
    width: auto !important;
    flex-shrink: 0;
}


/* ─── Thumbnail Button ─── */
.lwg-thumb {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: var(--lwg-radius-sm);
    border: 2px solid transparent;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    outline: none;
    position: relative;
    transition:
        border-color 0.3s var(--lwg-ease),
        box-shadow 0.3s var(--lwg-ease),
        transform 0.3s var(--lwg-ease);
}

.lwg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: calc(var(--lwg-radius-sm) - 2px);
    transition: opacity 0.3s ease;
    background: transparent;
}

/* Inactive dimming */
.lwg-thumb:not(.is-active) {
    opacity: 0.45;
}

.lwg-thumb:not(.is-active):hover {
    opacity: 0.75;
    border-color: rgba(78, 205, 196, 0.15);
}

/* Active state */
.lwg-thumb.is-active {
    border-color: var(--lwg-teal);
    opacity: 1;
    box-shadow: 0 0 16px rgba(78, 205, 196, 0.2);
}


/* ─── Vertical Thumbnails (Left / Right) ─── */
.lwg--thumbs-left .lwg-thumbs,
.lwg--thumbs-right .lwg-thumbs {
    width: 80px;
}

.lwg--thumbs-left .lwg-thumbs__swiper,
.lwg--thumbs-right .lwg-thumbs__swiper {
    height: 100%;
}

.lwg--thumbs-left .lwg-thumbs .swiper-wrapper,
.lwg--thumbs-right .lwg-thumbs .swiper-wrapper {
    flex-direction: column;
}

.lwg--thumbs-left .lwg-thumb,
.lwg--thumbs-right .lwg-thumb {
    width: 72px;
    height: 72px;
}


/* ═══ GLIGHTBOX DARK THEME ═══ */
.glightbox-clean .goverlay {
    background: rgba(10, 18, 25, 0.95) !important;
}

.glightbox-clean .gclose,
.glightbox-clean .gnext,
.glightbox-clean .gprev {
    background: rgba(78, 205, 196, 0.08) !important;
    border: 1px solid rgba(78, 205, 196, 0.15) !important;
    border-radius: 50% !important;
    color: var(--lwg-teal) !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s var(--lwg-ease) !important;
}

.glightbox-clean .gclose:hover,
.glightbox-clean .gnext:hover,
.glightbox-clean .gprev:hover {
    background: rgba(78, 205, 196, 0.15) !important;
    border-color: rgba(78, 205, 196, 0.35) !important;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.15) !important;
}

.glightbox-clean .gclose svg,
.glightbox-clean .gnext svg,
.glightbox-clean .gprev svg {
    fill: var(--lwg-teal) !important;
}

.glightbox-clean .gslide-image img {
    background: transparent !important;
}

/* Lightbox counter */
.glightbox-clean .gslide-description {
    background: transparent !important;
}




/* ═══ VIDEO SUPPORT ═══ */
.lwg-slide--video {
    cursor: pointer;
}

.lwg-play {
    position: absolute;
    inset: auto auto 18px 18px;
    z-index: 3;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 18, 25, 0.72);
    color: var(--lwg-teal);
    border: 1px solid rgba(78, 205, 196, 0.2);
    box-shadow: 0 0 28px rgba(78, 205, 196, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition:
        transform 0.3s var(--lwg-ease),
        background 0.3s var(--lwg-ease),
        border-color 0.3s var(--lwg-ease);
}

.lwg-slide--video:hover .lwg-play {
    transform: scale(1.08);
    background: rgba(78, 205, 196, 0.14);
    border-color: rgba(78, 205, 196, 0.38);
}

.lwg-video-placeholder {
    width: 100%;
    height: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 45%, rgba(78, 205, 196, 0.12), transparent 44%),
        linear-gradient(135deg, rgba(17, 29, 42, 0.96), rgba(15, 25, 35, 0.96));
    color: var(--lwg-teal);
    font-family: var(--lwg-font);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
}

.lwg-thumb--video::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0,0,0,0.08), rgba(0,0,0,0.35));
    pointer-events: none;
}

.lwg-thumb__play {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    color: var(--lwg-teal);
    background: rgba(10, 18, 25, 0.72);
    border: 1px solid rgba(78, 205, 196, 0.22);
}

.lwg-thumb__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--lwg-font);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--lwg-teal);
    background: rgba(17, 29, 42, 0.9);
}

.glightbox-clean .gslide-video video {
    max-height: 82vh;
    background: #000 !important;
}


/* ═══ RESPONSIVE ═══ */

/* Tablet */
@media (max-width: 1024px) {
    .lwg--thumbs-left,
    .lwg--thumbs-right {
        flex-direction: column;
    }
    .lwg--thumbs-left .lwg-thumbs,
    .lwg--thumbs-right .lwg-thumbs {
        width: 100%;
    }
    .lwg--thumbs-left .lwg-thumbs .swiper-wrapper,
    .lwg--thumbs-right .lwg-thumbs .swiper-wrapper {
        flex-direction: row;
    }
    .lwg--thumbs-left .lwg-thumb,
    .lwg--thumbs-right .lwg-thumb {
        width: 64px;
        height: 64px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .lwg {
        gap: 10px;
    }

    .lwg-main {
        border-radius: 12px;
    }

    .lwg-arrow {
        width: 36px;
        height: 36px;
        opacity: 1;
    }
    .lwg-arrow--prev { left: 8px; }
    .lwg-arrow--next { right: 8px; }

    .lwg-thumb {
        width: 56px;
        height: 56px;
        border-radius: 8px;
    }

    .lwg-counter {
        bottom: 10px;
        right: 10px;
        font-size: 10px;
        padding: 5px 11px;
    }

    .lwg-badge {
        top: 10px;
        left: 10px;
        font-size: 8px;
        padding: 5px 12px;
    }

    .lwg-expand {
        top: 10px;
        right: 10px;
        width: 34px;
        height: 34px;
        opacity: 1;
    }
}

@media (max-width: 380px) {
    .lwg-thumb {
        width: 48px;
        height: 48px;
    }
}
