.gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 16px 28px;

    background: radial-gradient(ellipse at center, rgba(4, 28, 18, 0.62) 0%, rgba(0, 6, 4, 0.86) 100%);
    -webkit-backdrop-filter: blur(16px) saturate(1);
    backdrop-filter: blur(16px) saturate(1);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overscroll-behavior: contain;
    touch-action: none;

    transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.gallery-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.45s ease, visibility 0s;
}

.gallery-close {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 3;

    width: 46px;
    height: 46px;
    padding: 0;

    font-size: 28px;
    line-height: 1;
    color: #ffffff;

    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;

    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.gallery-close:hover {
    border-color: #28ff9f;
    box-shadow: 0 0 14px rgba(40, 255, 159, 0.7);
    transform: scale(1.06);
}

.gallery-window {
    position: relative;
    top: auto;
    left: auto;
    transform: none;

    width: fit-content;
    max-width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;

    will-change: transform, opacity;
}

.gallery-image-wrapper {
    position: relative;
    width: auto;
    max-width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-image-wrapper img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(92vw, 1100px);
    max-height: calc(100vh - 300px);
    max-height: max(220px, calc(100dvh - 300px));

    object-fit: contain;
    border: 1px solid rgba(170, 120, 220, 0.18);
    border-radius: 6px;

    transition: opacity 0.25s ease;
    user-select: none;
    -webkit-user-drag: none;
}

/* Cantos neon (HUD) em volta da foto */

.gallery-corner {
    position: absolute;
    z-index: 1;
    width: 26px;
    height: 26px;

    border: 2px solid #b98cf0;
    filter: drop-shadow(0 0 5px rgba(185, 140, 240, 0.6));
    pointer-events: none;
}

.gc-tl { top: -10px;    left: -10px;  border-right: 0; border-bottom: 0; }
.gc-tr { top: -10px;    right: -10px; border-left: 0;  border-bottom: 0; }
.gc-bl { bottom: -10px; left: -10px;  border-right: 0; border-top: 0; }
.gc-br { bottom: -10px; right: -10px; border-left: 0;  border-top: 0; }

/* Setas */

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;

    width: 48px;
    height: 48px;
    padding: 0;

    font-family: "Chakra Petch", Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;

    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(170, 120, 220, 0.5);
    border-radius: 50%;

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.gallery-arrow:hover {
    background: rgba(150, 100, 210, 0.12);
    box-shadow: 0 0 10px rgba(150, 100, 210, 0.4);
}

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

/* O contador "1 / 6" fica só para leitores de tela (a barra de progresso o substitui) */

.gallery-counter {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Barra de progresso */

.gallery-progress {
    display: flex;
    gap: 6px;
    margin-top: 20px;
}

.gallery-progress i {
    display: block;
    width: 30px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.gallery-progress i.on {
    background: #28ff9f;
    box-shadow: 0 0 8px rgba(40, 255, 159, 0.8);
}

/* Miniaturas */

.gallery-thumbs {
    display: flex;
    gap: 8px;
    max-width: 100%;
    margin-top: 14px;
    padding: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.gallery-thumbs button {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    padding: 0;
    overflow: hidden;

    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;

    opacity: 0.55;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.gallery-thumbs button:hover {
    opacity: 0.9;
}

.gallery-thumbs button.on {
    opacity: 1;
    border-color: #b98cf0;
    box-shadow: 0 0 10px rgba(185, 140, 240, 0.55);
}

.gallery-thumbs img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botão "Quero uma tattoo assim" */

.gallery-cta {
    margin-top: 18px;
}

.gallery-neon {
    display: inline-block;
    padding: 2px;
    border-radius: 4px;
    background: #28ff9f;
    box-shadow: 0 0 14px rgba(40, 255, 159, 0.45);
    transition: box-shadow 0.3s ease;
}

.gallery-neon:hover {
    box-shadow: 0 0 22px rgba(40, 255, 159, 0.75);
}

.gallery-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 12px 26px;

    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    color: #ffffff;

    background: #050505;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.gallery-cta-btn:hover {
    background: #0c1f17;
}

/* Celular */

@media (max-width: 600px) {

    .gallery-overlay {
        padding: 60px 12px 20px;
    }

    .gallery-close {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
    }

    .gallery-image-wrapper img {
        max-height: calc(100vh - 230px);
        max-height: max(220px, calc(100dvh - 230px));
    }

    .gallery-arrow {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    .gallery-prev { left: 6px; }
    .gallery-next { right: 6px; }

    .gallery-thumbs {
        display: none !important;
    }

    .gallery-cta {
        margin-top: 16px;
    }
}

/* Celular deitado ou telas muito baixas */

@media (max-height: 560px) {

    .gallery-overlay {
        padding: 48px 12px 10px;
    }

    .gallery-image-wrapper img {
        max-height: calc(100vh - 190px);
        max-height: max(120px, calc(100dvh - 190px));
    }

    .gallery-thumbs {
        display: none !important;
    }

    .gallery-progress {
        margin-top: 12px;
    }

    .gallery-cta {
        margin-top: 10px;
    }

    .gallery-cta-btn {
        padding: 9px 18px;
    }
}