/* ══════════════════════════════════════════════════════════
   VWG GALERIA PRODUKTU — Frontend
   ══════════════════════════════════════════════════════════ */

.adr-gallery {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 24px;
    font-family: inherit;
    -webkit-user-select: none;
    user-select: none;
}

/* ── Główny slajder — KWADRAT ────────────────────────────── */
.adr-gal-main {
    position: relative;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

@supports not (aspect-ratio: 1/1) {
    .adr-gal-main::before { content: ""; display: block; padding-top: 100%; }
    .adr-gal-slides  { position: absolute; inset: 0; }
}

.adr-gal-slides {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* ── Slajd ───────────────────────────────────────────────── */
.adr-gal-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    opacity: 0;
    transition: opacity 0.32s ease;
    pointer-events: none;
    z-index: 1;
}

.adr-gal-slide--active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.adr-gal-slide--next-leave,
.adr-gal-slide--prev-leave {
    opacity: 0;
    z-index: 1;
    transition: opacity 0.32s ease;
}

/* ── Zdjęcie w slajdzie ─────────────────────────────────── */
.adr-gal-slide-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

/* ── Przycisk lupy — prawy górny róg zdjęcia ────────────── */
.adr-gal-zoom-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #000;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    font-size: 16px;
    transition: background .2s, transform .15s;
    pointer-events: auto;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
    padding: 0;
}
.adr-gal-zoom-btn:hover { background: #333; transform: scale(1.1); }
.adr-gal-zoom-icon { font-size: 16px; line-height: 1; }

/* Tooltip tekst — ukryty na stałe (nie używamy) */
.adr-gal-zoom-tooltip { display: none; }

/* ── Wideo — wygląda identycznie jak zdjęcie ────────────── */
.adr-gal-slide-poster {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.adr-gal-slide-poster-blank {
    width: 100%;
    height: 100%;
    background: #e8e8e8;
}

.adr-gal-video-el {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f5f5f5;
    z-index: 5;
    pointer-events: none;
}

/* Overlay "dotknij aby odtworzyć" */
.adr-gal-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
}

.adr-gal-big-play-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,.55);
    border: 2px solid rgba(255,255,255,.8);
    border-radius: 50px;
    padding: 14px 28px;
    cursor: pointer;
    color: #fff;
    transition: background .2s, transform .15s;
}
.adr-gal-big-play-btn:hover { background: rgba(0,0,0,.8); transform: scale(1.05); }
.adr-gal-big-play-icon  { font-size: 36px; line-height: 1; }
.adr-gal-big-play-label { font-size: 15px; font-weight: 600; white-space: nowrap; }

/* ── Strzałki nawigacji ──────────────────────────────────── */
.adr-gal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: rgba(255,255,255,.82);
    border: none;
    color: #222;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    border-radius: 4px;
    transition: background .2s, opacity .2s;
    opacity: 0.85;
    min-width: 44px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.adr-gal-nav:hover    { background: #fff; opacity: 1; }
.adr-gal-nav:disabled { opacity: 0.18; cursor: default; }
.adr-gal-nav--prev    { left: 6px; }
.adr-gal-nav--next    { right: 6px; }

.adr-gal-nav-arrow { font-size: 28px; line-height: 1; font-weight: 300; }
.adr-gal-nav-label { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }

@keyframes adr-gal-pulse {
    0%,100% { opacity: .85; }
    50%     { opacity: 1; box-shadow: 0 0 0 4px rgba(0,0,0,.12); }
}
.adr-gal-nav--pulse { animation: adr-gal-pulse .7s ease-in-out 3; }


/* ── Miniatury ───────────────────────────────────────────── */
.adr-gal-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0 4px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.adr-gal-thumbs::-webkit-scrollbar       { height: 3px; }
.adr-gal-thumbs::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.adr-gal-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity .2s, border-color .15s;
    position: relative;
    background: #e8e8e8;
    padding: 0;
    aspect-ratio: 1 / 1;
}
.adr-gal-thumb:hover     { opacity: .9; border-color: rgba(0,0,0,.4); }
.adr-gal-thumb--active   { opacity: 1; border: 2px solid #000; }
.adr-gal-thumb img       { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.adr-gal-thumb-blank     { width: 100%; height: 100%; background: #ddd; }

.adr-gal-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    background: rgba(0,0,0,.28);
    pointer-events: none;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* ══════════════════════════════════════════════════════════
   LIGHTBOX
   Lightbox jest przenoszony przez JS do <body> — stoi zawsze
   na wierzchu ponad nagłówkiem motywu.
   ══════════════════════════════════════════════════════════ */
.adr-gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483647; /* max int32 — nad wszystkim */
    display: flex;
    align-items: center;
    justify-content: center;
}
.adr-gal-lightbox[hidden] { display: none !important; }

.adr-gal-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.92);
    cursor: pointer;
    z-index: 0;
}

/* ── Czerwony X — zawsze w prawym górnym rogu ───────────── */
.adr-gal-lb-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    background: #d32f2f;
    border: 3px solid rgba(255,255,255,.25);
    color: #fff;
    border-radius: 10px;
    padding: 12px 26px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .15s, transform .1s;
    box-shadow: 0 4px 18px rgba(0,0,0,.55);
    letter-spacing: .03em;
    white-space: nowrap;
    line-height: 1;
}
.adr-gal-lb-close:hover  { background: #b71c1c; transform: scale(1.05); }
.adr-gal-lb-close:active { transform: scale(.97); }
.adr-gal-lb-close span:first-child { font-size: 20px; font-weight: 900; line-height: 1; }
.adr-gal-lb-close-label  { font-size: 15px; }

/* ── Zawartość (wyśrodkowane medium) ────────────────────── */
.adr-gal-lb-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* clip zoomed content do ekranu */
}

/* Medium container — tu aplikujemy transform zoom/pan */
.adr-gal-lb-media {
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    will-change: transform;
}

/* Zdjęcie w lightboxie */
.adr-gal-lb-img {
    display: block;
    max-width: 88vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 3px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Wideo w lightboxie — identyczne wymiary jak zdjęcie */
.adr-gal-lb-video {
    display: block;
    max-width: 88vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 3px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    background: #000;
    pointer-events: none;
    user-select: none;
}

/* ── Strzałki lightboxa ─────────────────────────────────── */
.adr-gal-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: rgba(255,255,255,.15);
    border: 2px solid rgba(255,255,255,.5);
    color: #fff;
    font-size: 40px;
    line-height: 1;
    padding: 14px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s;
}
.adr-gal-lb-nav:hover    { background: rgba(255,255,255,.3); }
.adr-gal-lb-nav:disabled { opacity: .2; cursor: default; }
.adr-gal-lb-prev { left:  12px; }
.adr-gal-lb-next { right: 12px; }


/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .adr-gal-nav-label { display: none; }
    .adr-gal-nav       { padding: 10px 6px; min-width: 36px; }
    .adr-gal-nav-arrow { font-size: 24px; }
    .adr-gal-thumb     { width: 64px; height: 64px; }
    .adr-gal-lb-close  { padding: 10px 18px; font-size: 15px; top: 10px; right: 10px; }
    .adr-gal-lb-nav    { font-size: 32px; padding: 10px 12px; }
}
