/* ─── Reset e Base ─────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --fg: #1a1a1a;
    --muted: #6b7280;
    --bg: #ffffff;
    --surface: #ffffff;
    --radius: 6px;
    --transition: .25s cubic-bezier(.4, 0, .2, 1);
    --gutter: 6px;
    /* fallback — sobrescrito dinamicamente pelo PHP */
    /* ↓ Variável de fonte do título — fácil de trocar nas configurações de design */
    --gallery-title-font: 'Playfair Display', Georgia, serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100dvh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ─── Stickybar (branding + tabs + botões em uma linha) ──────── */
.g-stickybar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.g-stickybar__inner {
    display: flex;
    align-items: center;
    padding: 0 var(--gutter);
    gap: 1rem;
    text-transform: uppercase;
    min-height: 52px;
}

/* Branding: encolhido/invisível por padrão, desliza ao adicionar .scrolled */
.g-sbar__brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-shrink: 0;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width .35s cubic-bezier(.4, 0, .2, 1), opacity .3s;
    pointer-events: none;
    white-space: nowrap;
}

.g-stickybar.scrolled .g-sbar__brand {
    max-width: 320px;
    opacity: 1;
    pointer-events: auto;
}

.g-sbar__logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.g-sbar__title {
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.g-sbar__studio {
    font-size: .6rem;
    color: var(--muted);
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Centro: tabs de coleção ou contagem */
.g-sbar__center {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.g-sbar__center::-webkit-scrollbar {
    display: none;
}

/* Direita: botões */
.g-sbar__right {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-shrink: 0;
}

/* Rótulo de texto nos botões da barra */
.g-sbar__btn-label {
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.g-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1.25rem;
    background: var(--fg);
    color: #fff;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: opacity var(--transition);
    text-transform: uppercase;
    /* button nao herda fonte: sem isto cai na fonte de formulario do sistema
       (Segoe UI no Windows) e quebra a tipografia escolhida para a galeria. */
    font-family: inherit;
}

.g-btn:hover {
    opacity: .8;
}

.g-btn--outline {
    background: transparent;
    color: var(--fg);
    border: 1.5px solid rgba(0, 0, 0, .15);
}

.g-btn--outline:hover {
    background: rgba(0, 0, 0, .04);
    opacity: 1;
}

.g-btn--accent {
    background: var(--accent);
}

.g-btn--icon {
    padding: .45rem .75rem;
    border-radius: 6px;
    background: transparent;
    color: var(--fg);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    transition: background var(--transition);
    text-transform: uppercase;
    position: relative;
}

.g-btn--icon:hover {
    background: rgba(0, 0, 0, .06);
}

.g-btn--icon.active {
    color: #e11d48;
    background: rgba(225, 29, 72, .08);
}

/* ─── Tabs de Coleção ──────────────────────────────────────────── */
.g-coll-tab {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
    color: var(--muted);
    white-space: nowrap;
    background: none;
    border-left: none;
    border-top: none;
    border-right: none;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.g-coll-tab.active,
.g-coll-tab:hover {
    color: var(--fg);
    border-bottom-color: var(--fg);
}

/* Contagem (sem coleções) */
.g-count {
    font-size: .8rem;
    color: var(--muted);
    padding: 1rem 0;
    white-space: nowrap;
}

/* Select de coleções (mobile) */
.g-coll-select {
    display: none;
    appearance: auto;
    -webkit-appearance: auto;
    background: var(--surface);
    border: 1.5px solid rgba(0, 0, 0, .2);
    border-radius: 6px;
    padding: .4rem .65rem;
    font-size: .75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--fg);
    cursor: pointer;
    outline: none;
    max-width: 160px;
    font-family: inherit;
}

/* Mobile: somente ícone + dropdown para sets */
@media (max-width: 640px) {
    .g-sbar__btn-label {
        display: none;
    }

    .g-sbar__center .g-coll-tab {
        display: none;
    }

    .g-coll-select {
        display: block;
    }

    .g-stickybar.scrolled .g-sbar__brand {
        max-width: 140px;
    }
}

/* ─── Hero / Capa ─── */
.g-hero {
    position: relative;
    height: 100svh;
    /* svh = small viewport: desconta barra do browser */
    min-height: 560px;
    overflow: hidden;
}

/* Fallback para browsers sem suporte a svh */
@supports not (height: 100svh) {
    .g-hero {
        height: 100vh;
    }
}

.g-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.g-hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
    color: #fff;
}

/* Topo: logo + studio */
.g-hero__top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}

.g-hero__logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 50%;
}

.g-hero__studio-name {
    font-size: .7rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    opacity: .7;
}

/* Centro: titulo */
.g-hero__center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.g-hero__name {
    font-family: var(--gallery-title-font);
    font-size: 2rem;
    font-weight: 300;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.g-hero__line {
    width: 60px;
    height: 1px;
    background: rgba(255, 255, 255, .4);
    margin: 1.5rem auto 0;
}

.g-hero__date {
    font-size: .85rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
    margin-top: 1rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}

/* Base: botão "Ver Galeria" — garante espaço acima da barra do browser no mobile */
.g-hero__bottom {
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 1.5rem);
}

.g-hero__view-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 2rem;
    border: 1.5px solid rgba(255, 255, 255, .5);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font-size: .7rem;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .3s, border-color .3s;
}

.g-hero__view-btn:hover {
    background: rgba(255, 255, 255, .15);
    border-color: rgba(255, 255, 255, .8);
}

.g-hero__view-btn svg {
    display: block;
}

/* ─── Botão Topo ───────────────────────────────────────────────── */
.g-btn-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 300;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--fg);
    color: var(--surface);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    transform: translateY(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

.g-btn-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

/* ─── Masonry Grid ─────────────────────────────────────────────── */
.g-main {
    max-width: none;
    margin: 1.25rem 0;
    padding: 0 var(--gutter);
}

/* Mobile: usa o mesmo gutter do editor (sem margin extra) */
@media (max-width: 480px) {
    .g-main {
        padding: 0 var(--gutter);
        margin: 0;
    }
}

/* ─── Chip flutuante de navegação entre sets ───────────────────────
   Aparece só quando o fim da grade entra na tela e some ao voltar para o meio
   do set. Show/hide por display, nunca por opacity: com transição a peça trava
   em 0 quando a classe entra no mesmo frame em que o nó é medido.

   O ancoradouro é sticky, não fixed: fixed gruda no fundo do viewport e cobre o
   rodapé quando a página termina. Sticky flutua enquanto há grade para rolar e
   estaciona no fim do <main>, que acaba antes do <footer>. Altura zero, então
   não soma nada ao documento — o chip é desenhado acima da linha do ancoradouro. */
.gsn-dock {
    position: sticky;
    bottom: 12px;
    height: 0;
    display: flex;
    justify-content: center;
    /* Sem isto o filho estica para a altura zero do ancoradouro e o chip colapsa,
       deixando só as bordas visíveis com o botão transbordando pelas laterais */
    align-items: flex-end;
    /* Abaixo da stickybar (200) e do lightbox (9999+), acima das fotos */
    z-index: 150;
    /* A faixa de altura zero não pode roubar clique das fotos que ficam sob ela */
    pointer-events: none;
}

/* Sem translate: o align-items:flex-end do ancoradouro já assenta o chip acima da
   linha dele. Deslocar de novo empurrava o chip uma altura inteira para cima,
   deixando 53px de vão até o rodapé e 45px do fundo da tela ao flutuar. */
.gsn-chip {
    display: none;
    align-items: center;
    gap: 6px;
    width: max-content;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, .12);
    background: var(--surface);
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .25);
    pointer-events: auto;
}

/* Progressivo: só onde color-mix existe o chip fica translúcido sobre as fotos */
@supports (background: color-mix(in srgb, red 50%, transparent)) {
    .gsn-chip {
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        border-color: color-mix(in srgb, var(--fg) 12%, transparent);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

.gsn-chip.is-visible {
    display: inline-flex;
}

.gsn-chip__prev,
.gsn-chip__next {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: none;
    font: inherit;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    color: var(--fg);
    cursor: pointer;
}

/* Avançar é a ação primária: ganha o peso de fundo cheio */
.gsn-chip__next {
    padding: 8px 14px;
    background: var(--fg);
    color: var(--surface);
}

/* Primeiro e último set têm um botão só. Aí o container não agrupa nada: some o
   padding e o botão assume o raio externo, senão vira botão dentro de botão com
   as pontas do container sobrando nas laterais. */
.gsn-chip--solo {
    padding: 0;
}

.gsn-chip--solo .gsn-chip__prev,
.gsn-chip--solo .gsn-chip__next {
    padding: 9px 14px;
    border-radius: 10px;
}

.gsn-chip__prev:hover,
.gsn-chip__prev:focus-visible {
    background: rgba(0, 0, 0, .08);
}

@supports (background: color-mix(in srgb, red 50%, transparent)) {
    .gsn-chip__prev:hover,
    .gsn-chip__prev:focus-visible {
        background: color-mix(in srgb, var(--fg) 8%, transparent);
    }
}

.gsn-chip__next:hover {
    opacity: .85;
}

.gsn-chip__prev:focus-visible,
.gsn-chip__next:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Sentinela: marca o fim da grade, sem ocupar espaço */
.gsn-sentinela {
    height: 1px;
    margin-top: -1px;
    pointer-events: none;
}

/* ── Masonry real: JS posiciona absolute, container tem altura calculada ── */
.g-masonry {
    position: relative;
    /* âncora para os filhos absolute */
    opacity: 0;
    transition: opacity .3s ease;
}

.g-masonry.grid-ready {
    opacity: 1;
}

.g-photo {
    position: absolute;
    /* top/left/width/height definidos pelo JS */
    overflow: hidden;
    cursor: zoom-in;
    background: #efefef;
}

.g-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity .5s ease, transform .4s ease, filter .3s;
}

.g-photo img.loaded {
    opacity: 1;
}

.g-photo:hover img {
    transform: scale(1.03);
}

.g-photo__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, .4));
    opacity: 0;
    transition: opacity var(--transition);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: .75rem;
    gap: .4rem;
}

.g-photo:hover .g-photo__overlay {
    opacity: 1;
}

.g-like-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .5);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    transition: background var(--transition), transform var(--transition);
    backdrop-filter: blur(6px);
}

.g-like-btn:hover {
    background: rgba(0, 0, 0, .7);
    transform: scale(1.1);
}

.g-like-btn.liked {
    background: #e11d48;
}

.g-like-btn.liked svg {
    fill: #fff;
}

.g-like-badge {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: #e11d48;
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: .7rem;
    font-weight: 600;
    display: none;
}

.g-photo.liked-photo .g-like-badge {
    display: inline-block;
}

/* ─── Lightbox ─────────────────────────────────────────────────── */
.g-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .97);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}

.g-lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.g-lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
    gap: 1rem;
    /* Gradiente suave para garantir legibilidade em fotos claras */
    background: linear-gradient(to bottom, rgba(0, 0, 0, .55) 0%, transparent 100%);
}

.g-lightbox__info {
    color: rgba(255, 255, 255, .75);
    font-size: .85rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}

.g-lightbox__title {
    color: #fff;
    font-size: .95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .9);
}

.g-lightbox__stage {
    cursor: default;
}

.g-lightbox__stage.lb-hd-ready {
    cursor: zoom-in;
}

.g-lightbox__stage.lb-zoomed {
    cursor: crosshair;
}

.g-lb-close__esc {
    font-size: .6rem;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .45);
    display: block;
    text-align: center;
    line-height: 1;
}

@media (max-width: 640px) {
    .g-lb-close__esc {
        display: none;
    }
}

.g-lb-close {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    transition: background var(--transition);
}

.g-lb-close:hover {
    background: rgba(255, 255, 255, .18);
}

.g-lightbox__stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.g-lightbox__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity .2s;
    display: block;
    flex-shrink: 0;
    will-change: transform;
}

.g-lightbox.lb-zoom-active .g-lightbox__stage {
    position: absolute;
    inset: 0;
    z-index: 0;
    flex: none;
    overflow: hidden;
}

.g-lightbox.lb-zoom-active .g-lightbox__header {
    position: relative;
    z-index: 10;
    background: transparent;
}

.g-lightbox.lb-zoom-active .g-lightbox__footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: transparent;
}

.g-lightbox__stage.lb-zoomed .g-lightbox__img {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    object-fit: none;
    transition: none;
}

.g-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
    z-index: 2;
}

.g-lb-nav:hover {
    background: rgba(255, 255, 255, .25);
}

.g-lb-prev {
    left: 1rem;
}

.g-lb-next {
    right: 1rem;
}

/* ── Setas sempre visíveis durante zoom ── */
.g-lightbox.lb-zoom-active .g-lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;
    pointer-events: all;
}

.g-lightbox.lb-zoom-active .g-lb-prev {
    left: 1rem;
}

.g-lightbox.lb-zoom-active .g-lb-next {
    right: 1rem;
}

.g-lightbox__footer {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 1rem;
    /* Gradiente suave para garantir legibilidade em fotos claras */
    background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, transparent 100%);
}

.g-lb-like {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255, 255, 255, .08);
    border-radius: 6px;
    padding: .4rem 1rem;
    cursor: pointer;
    border: none;
    color: #fff;
    font-size: .7rem;
    text-transform: uppercase;
    transition: background var(--transition);
}

.g-lb-like:hover {
    background: rgba(255, 255, 255, .15);
}

.g-lb-like.liked {
    background: rgba(225, 29, 72, .25);
}


/* ─── Panel de Seleção / Prova ─────────────────────────────────── */
.g-prova-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: #ffffff;
    color: var(--fg);
    border-top: 1px solid rgba(0, 0, 0, .1);
    padding: .75rem var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    transform: translateY(100%);
    transition: transform .35s var(--transition);
}

.g-prova-bar.visible {
    transform: none;
}

.g-prova-bar__left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.g-prova-bar__count {
    font-size: .9rem;
}

.g-prova-bar__count strong {
    font-size: 1.3rem;
    font-weight: 700;
}

/* ─── Seletor de Listas (Prova Bar) ───────────────────────────── */
.g-list-selector {
    position: relative;
}

.g-list-selector__btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 6px;
    padding: .4rem .75rem;
    color: var(--fg);
    font-size: .85rem;
    cursor: pointer;
    transition: background .2s;
}

.g-list-selector__btn:hover {
    background: rgba(0, 0, 0, .04);
}

.g-list-selector__btn strong {
    font-size: 1.1rem;
    font-weight: 700;
}

.g-extras-badge {
    display: inline-flex;
    align-items: center;
    font-size: .72rem;
    font-weight: 600;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 20px;
    padding: .15rem .55rem;
    white-space: nowrap;
}

/* Separador "— ou —" no modal de checkout */
.g-ck-ou {
    text-align: center;
    font-size: .75rem;
    color: rgba(255, 255, 255, .4);
    margin: .5rem 0;
    letter-spacing: .05em;
}

/* Opção checkbox estilizada no modal de checkout */
.g-ck-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    cursor: pointer;
    padding: .75rem;
    border: 1.5px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    font-size: .85rem;
    transition: border-color .2s, background .2s;
}

.g-ck-option:hover {
    border-color: rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .04);
}

.g-ck-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
}

.g-list-selector__arrow {
    font-size: .65rem;
    opacity: .6;
    margin-left: .25rem;
}

.g-list-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 260px;
    max-width: 320px;
    background: rgba(20, 20, 20, .96);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 10px;
    padding: .5rem 0;
    backdrop-filter: blur(20px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .4);
    display: none;
    z-index: 310;
}

.g-list-panel.open {
    display: block;
}

.g-list-panel__empty {
    padding: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, .4);
    font-size: .8rem;
}

.g-list-item {
    display: flex;
    align-items: center;
    padding: .5rem .75rem;
    cursor: pointer;
    transition: background .15s;
}

.g-list-item:hover {
    background: rgba(255, 255, 255, .08);
}

.g-list-item.active {
    background: rgba(255, 255, 255, .12);
}

.g-list-item.active::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
    background: var(--accent, #fff);
    border-radius: 2px;
    margin-right: .5rem;
    flex-shrink: 0;
}

.g-list-item__info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.g-list-item__name {
    font-size: .82rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.g-list-item__count {
    font-size: .72rem;
    color: rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .1);
    border-radius: 10px;
    padding: .1rem .45rem;
    flex-shrink: 0;
}

.g-list-item__actions {
    display: flex;
    gap: .25rem;
    opacity: 0;
    transition: opacity .15s;
    margin-left: .5rem;
}

.g-list-item:hover .g-list-item__actions {
    opacity: 1;
}

.g-list-item__actions button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .5);
    font-size: .75rem;
    cursor: pointer;
    padding: .15rem .3rem;
    border-radius: 4px;
}

.g-list-item__actions button:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.g-list-panel__new {
    display: flex;
    gap: .35rem;
    padding: .5rem .75rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    margin-top: .25rem;
}

.g-list-panel__new input {
    flex: 1;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 6px;
    padding: .3rem .5rem;
    color: #fff;
    font-size: .8rem;
    outline: none;
}

.g-list-panel__new input::placeholder {
    color: rgba(255, 255, 255, .3);
}

.g-list-panel__new input:focus {
    border-color: var(--accent, rgba(255, 255, 255, .4));
}

.g-list-panel__new button {
    background: var(--accent, rgba(255, 255, 255, .2));
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.g-list-panel__new button:hover {
    opacity: .85;
}



/* ─── Tela de Senha ────────────────────────────────────────────── */
.g-gate {
    position: relative;
    overflow: hidden;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
}

/* Capa borrada ao fundo (apenas no gate de e-mail — ver layout_publico.php).
   O scale compensa a franja transparente que o blur cria nas bordas. */
.g-gate__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(5px) saturate(1.15);
    transform: scale(1.03);
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

/* Véu escuro: com blur baixo a capa fica legível como imagem, e escurecer é o
   que impede a foto de competir com o formulário. Valor calibrado no staging. */
.g-gate--bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 0;
    pointer-events: none;
}

/* Título e rodapé ficam direto sobre a foto (a caixa do form é branca sólida).
   O halo branco garante o contraste que o véu deixou de dar. */
.g-gate--bg .g-gate__title,
.g-gate--bg .g-gate__footer {
    text-shadow: 0 1px 16px rgba(255, 255, 255, .9), 0 0 4px rgba(255, 255, 255, .8);
}

.g-gate > *:not(.g-gate__bg) {
    position: relative;
    z-index: 1;
}

.g-gate--bg .g-gate__box {
    box-shadow: 0 12px 48px rgba(0, 0, 0, .18);
}

.g-gate__logo {
    width: 60px;
    border-radius: 8px;
}

.g-gate__title {
    font-family: var(--gallery-title-font);
    font-size: 1.75rem;
    text-align: center;
}

.g-gate__desc {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1.25rem;
}

.g-gate__footer {
    font-size: .8rem;
    color: var(--muted);
}

.g-gate__box {
    background: var(--surface);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .08);
}

.g-gate__input {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: .75rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color var(--transition);
    outline: none;
    font-family: inherit;
}

.g-gate__input:focus {
    border-color: var(--fg);
}

.g-error {
    color: #e11d48;
    font-size: .85rem;
    margin-bottom: 1rem;
}

/* ─── Download Modal ───────────────────────────────────────────── */
.g-modal-wrap {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.g-modal-wrap.open {
    opacity: 1;
    pointer-events: all;
}

.g-modal {
    background: var(--surface);
    border-radius: 8px;
    padding: 2.5rem;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
    transform: scale(.95);
    transition: transform .2s;
}

.g-modal-wrap.open .g-modal {
    transform: none;
}

.g-modal__title {
    font-family: var(--gallery-title-font);
    font-size: 1.4rem;
    margin-bottom: .5rem;
    font-weight: 300;
}

.g-modal__sub {
    color: var(--muted);
    font-size: .875rem;
    margin-bottom: 1.5rem;
}

.g-modal__row {
    display: flex;
    gap: .75rem;
}

.g-modal__input {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
    transition: border-color var(--transition);
}

.g-modal__input:focus {
    border-color: var(--fg);
}

.g-modal__error {
    color: #e11d48;
    font-size: .85rem;
    margin-bottom: 1rem;
    display: none;
}

.g-modal__field {
    margin-bottom: 1rem;
}

.g-modal__label {
    font-size: .8rem;
    color: var(--muted);
    display: block;
    margin-bottom: .3rem;
}

.g-modal__actions {
    display: flex;
    gap: .75rem;
}

.g-modal__actions-bottom {
    margin-top: 1.5rem;
}

.g-modal__text {
    color: var(--muted);
    font-size: .875rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.g-modal__text--sm {
    font-size: .8rem;
}

.g-modal__state {
    display: none;
    text-align: center;
    padding: 1rem 0;
}

.g-modal__icon-wrap {
    margin-bottom: 1.25rem;
}

.g-modal__icon--success circle {
    fill: #f0fdf4;
}

.g-modal__icon--success path {
    stroke: #22c55e;
}

.g-modal__icon--success {
    stroke: #22c55e;
}

.g-modal__icon--error circle {
    fill: #fef2f2;
}

.g-modal__icon--error path {
    stroke: #ef4444;
}

.g-modal__icon--error {
    stroke: #ef4444;
}

.g-modal__spinner {
    animation: spin 1.2s linear infinite;
}

.g-modal-wrap--top {
    z-index: 10000;
}

.g-btn--full {
    width: 100%;
    justify-content: center;
    text-decoration: none;
}

.g-btn--flex1 {
    flex: 1;
    justify-content: center;
}

.g-btn--flex2 {
    flex: 2;
    justify-content: center;
}

.g-btn--dl-link {
    margin-bottom: .75rem;
}

/* ─── Footer ───────────────────────────────────────────────────── */
.g-footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    font-size: .8rem;
}

.g-footer a {
    color: var(--muted);
    text-decoration: underline;
}

/* ─── Loader ───────────────────────────────────────────────────── */
.g-skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.g-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #f59e0b;
    color: #000;
    padding: .75rem 1.25rem;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
    max-width: 90vw;
    text-align: center;
}
.g-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ── Read-Only Mode ────────────────────────────────────────────────────── */
.g-readonly .g-like-btn {
    pointer-events: none;
    opacity: .5;
}
.g-readonly-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #10b981;
    color: #fff;
    text-align: center;
    padding: .5rem;
    font-size: .85rem;
    font-weight: 500;
    z-index: 9999;
}

/* ── Badge no coração do topo ───────────────────────────────────────────── */
.g-prova-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    background: #10b981;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    border-radius: 999px;
    min-width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
    line-height: 1;
}

/* ── Overlay Favoritos ──────────────────────────────────────────────────── */
.g-favoritos-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg, #0a0a0a);
    z-index: 5000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
    overflow: hidden;
}
.g-favoritos-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.g-fav__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    flex-shrink: 0;
}
.g-fav__title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin: 0;
}
.g-fav__back,
.g-fav__new {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    opacity: .75;
    padding: .4rem .6rem;
    border-radius: 6px;
    transition: opacity .2s, background .2s;
}
.g-fav__back:hover,
.g-fav__new:hover {
    opacity: 1;
    background: rgba(255, 255, 255, .07);
}
.g-fav__body {
    flex: 1;
    overflow-y: auto;
    padding-top: 1rem;
}
.g-fav__new-input {
    flex: 1;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 6px;
    color: inherit;
    padding: .5rem .75rem;
    font-size: .875rem;
    outline: none;
}
.g-fav__new-input:focus {
    border-color: rgba(255, 255, 255, .35);
}
.g-fav__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    padding: 0 1.5rem 1.5rem;
}
.g-fav__card {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, .04);
    border: 2px solid transparent;
    transition: transform .2s, border-color .2s;
}
.g-fav__card:hover {
    transform: translateY(-2px);
}
.g-fav__card--active {
    border-color: #10b981;
}
.g-fav__cover {
    aspect-ratio: 3 / 2;
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, .05);
    position: relative;
}
.g-fav__active-badge {
    position: absolute;
    top: .5rem;
    left: .5rem;
    background: #10b981;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: .2rem .5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.g-fav__info {
    padding: .7rem .9rem;
}
.g-fav__name {
    display: block;
    font-weight: 600;
    font-size: .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.g-fav__count {
    font-size: .75rem;
    opacity: .5;
    margin-top: .15rem;
    display: block;
}
.g-fav__empty {
    text-align: center;
    padding: 3rem 1.5rem;
    opacity: .45;
    font-size: .9rem;
    line-height: 1.8;
}

/* ── Painel B: fotos da lista ───────────────────────────────────────────── */
.g-fav__photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .5rem;
    padding: 0 1.5rem 1.5rem;
}
.g-fav__photo {
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, .05);
    border-radius: 6px;
    cursor: pointer;
    transition: opacity .2s, transform .2s;
}
.g-fav__photo:hover {
    opacity: .85;
    transform: scale(1.02);
}

/* ── Fechar barra ───────────────────────────────────────────────────────── */
.g-bar-close {
    background: none;
    border: none;
    color: rgba(0, 0, 0, .4);
    cursor: pointer;
    font-size: 1rem;
    padding: .25rem .5rem;
    border-radius: 4px;
    line-height: 1;
    transition: color .2s;
    flex-shrink: 0;
}
.g-bar-close:hover {
    color: var(--fg);
}

/* Botões padrão na barra de prova */
.g-prova-btn {
    background: var(--fg) !important;
    color: #fff !important;
    border: none !important;
}

.g-prova-btn:hover {
    opacity: .8 !important;
}

.g-btn--outline.g-prova-btn {
    background: transparent !important;
    color: var(--fg) !important;
    border: 1.5px solid rgba(0, 0, 0, .15) !important;
}

.g-btn--outline.g-prova-btn:hover {
    background: rgba(0, 0, 0, .04) !important;
}

.g-btn--accent.g-prova-btn {
    background: var(--accent) !important;
    color: #fff !important;
}

/* ── Utilities fase 5 (CSP style-src) ──────────────────────────────────── */

/* Visibilidade — sem !important para JS poder sobrescrever */
.g-hidden { display: none; }

/* Gallery empty state */
.g-gallery-empty      { text-align: center; padding: 5rem 1rem; color: var(--muted); }
.g-gallery-empty__icon { font-size: 3rem; margin-bottom: 1rem; }

/* Lightbox footer — grupo de controles */
.g-lb-footer__controls { display: flex; gap: .5rem; align-items: center; }

/* Checkout / Concluir modal — interior */
.g-ck-summary   { margin: 1rem 0; font-size: .9rem; line-height: 1.7; }
.g-ck-hr        { border-color: rgba(255,255,255,.1); margin: .75rem 0; }
.g-ck-total-el  { font-size: 1.1rem; font-weight: 600; text-align: center; margin: .75rem 0; }
.g-ck-wrap      { margin: .75rem 0; }
.g-ck-todas-title { font-size: .8rem; font-weight: 600; margin-bottom: .15rem; }
.g-ck-todas-price { font-size: .85rem; }
.g-ck-pix-btn-wrap { text-align: center; margin: .75rem 0; }
.g-ck-pix-area  { text-align: center; margin: 1rem 0; }
.g-ck-pix-margin { margin-top: .5rem; }
.g-ck-wa-area   { margin: .75rem 0; }

/* Concluir modal — aviso amarelo */
.g-cm-warn { margin: .75rem 0; padding: .75rem; background: rgba(255,200,0,.08); border: 1px solid rgba(255,200,0,.2); border-radius: 8px; font-size: .82rem; color: #fbbf24; }

/* Concluir modal — sucesso */
.g-cm-emoji { font-size: 3rem; margin: 1rem 0; }
.g-cm-sub   { font-size: .9rem; opacity: .7; margin: .5rem 0 1rem; }

/* Botão azul (confirmar/enviar) */
.g-btn--blue { background: #3b82f6 !important; color: #fff !important; }

/* Favoritos — nova lista */
.g-fav-new-list-wrap { padding: 0 1.5rem 1rem; }
.g-fav-new-list-row  { display: flex; gap: .5rem; }
.g-fav-btn-sm  { padding: .5rem 1rem !important; font-size: .85rem !important; }
.g-fav-btn-xs  { padding: .5rem .75rem !important; font-size: .85rem !important; }

/* Hero sem cover */
.g-hero--no-cover { background: #1a1a1a; }
.g-hero--no-cover .g-hero__overlay { background: rgba(0,0,0,.7); }

/* Lightbox footer row */
.g-lb-footer__row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Barra de prova — botões */
.g-prova-bar__buttons { display: flex; gap: .5rem; align-items: center; }

/* Modal pequeno */
.g-modal--sm { max-width: 420px; }

/* Modal — label opcional */
.g-modal__label-opt { font-weight: 400; color: var(--muted); font-size: .8em; }

/* Modal — texto explicativo no estado de erro */
.g-modal__err-text { font-size: .875rem; color: var(--muted); margin-bottom: 1.5rem; }

/* Modal actions com margin-top */
.g-modal__actions--mt { margin-top: 1rem; }

/* Modal com largura máxima reduzida */
.g-modal--sm { max-width: 420px; }

/* Checkout — aviso de limite */
.g-ck-warn { font-size: .82rem; color: var(--muted); margin-top: .5rem; }

/* Checkout — total line */
.g-ck-total-line { margin-top: .5rem; font-weight: 600; }

/* Checkout — seção */
.g-ck-section { border-top: 1px solid rgba(255,255,255,.1); padding-top: .75rem; margin-top: .75rem; }

/* Checkout — foto extra row */
.g-ck-extra-row { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: .3rem; }

/* Checkout — preço grande */
.g-ck-price-big { font-size: 1.4rem; font-weight: 700; }

/* Checkout — QR container */
.g-ck-qr-wrap { background: #fff; padding: .5rem; border-radius: 8px; display: inline-block; }

/* Checkout — QR fallback text */
.g-qr-fallback { font-size: .75rem; color: #666; }

/* Checkout — estado de sucesso */
.g-ck-success { text-align: center; }

/* Botão WhatsApp */
.g-btn--wa { background: #25d366 !important; color: #fff !important; border: none !important; }
.g-btn--wa:hover { background: #1ebe5d !important; }

/* Botões com fonte pequena */
.g-btn--sm-fz { font-size: .78rem !important; }
.g-btn--xs-fz { font-size: .72rem !important; }

/* Botão confirmar (destaque) */
.g-btn--confirm { background: var(--accent) !important; color: #fff !important; }

/* Concluir modal — estado de sucesso interno */
.g-cm-success-inner { text-align: center; padding: .5rem 0; }

/* Favoritos — overlay items */
.g-fav-new-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; border-radius: 6px; opacity: 0; transition: opacity .2s; }
.g-fav__photo:hover .g-fav-new-overlay { opacity: 1; }
.g-fav-new-btn { background: rgba(255,255,255,.9); border: none; border-radius: 4px; padding: .3rem .6rem; font-size: .75rem; cursor: pointer; }

/* Favoritos — cover vazio */
.g-fav__cover--empty { background: rgba(255,255,255,.05); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.3); font-size: 2rem; aspect-ratio: 1; border-radius: 8px; }

/* Flex-shrink-0 utility */
.g-flex-shrink-0 { flex-shrink: 0; }

/* Alinhamento vertical + margem direita */
.g-va-mid-mr { vertical-align: middle; margin-right: .35rem; }