/* Anúncios do banner (anuncios.js). Carregado só quando há anúncio, depois que
   a página já apareceu. Os mesmos estilos servem à prévia do painel.

   O anúncio se ajusta à moldura (container queries), não à tela: a moldura
   larga do computador mostra texto e produto lado a lado; a quadrada do
   celular reorganiza tudo para caber sem cortar. */

.hero-anuncio {
    position: absolute;
    inset: 0;
    overflow: hidden;
    container-type: size;
    container-name: anuncio;
    color: #fff;
    font-family: 'Manrope', system-ui, sans-serif;
    isolation: isolate;
}

/* O site pinta todo p/span/small com a cor do tema (regra global sem classe).
   Aqui dentro o texto herda o branco do anúncio; as classes abaixo, que vêm
   depois e têm o mesmo peso, continuam escolhendo as cores de cada parte. */
.hero-anuncio :where(p, span, small, s, b, strong, li, label) { color: inherit; }

/* ── Paletas ─────────────────────────────────────────────────────────────── */

.an-estilo-bird {
    --an-bg1: #10708c;
    --an-bg2: #041d26;
    --an-luz: rgba(84, 214, 255, 0.55);
    --an-acento: #74e4ff;
    --an-preco: #ffffff;
    --an-selo-bg: linear-gradient(135deg, #8ff1ff, #2fb6df);
    --an-selo-fg: #03222b;
    --an-cta-bg: linear-gradient(135deg, #ffffff, #d9f6ff);
    --an-cta-fg: #062f3c;
}

.an-estilo-noite {
    --an-bg1: #12282a;
    --an-bg2: #020607;
    --an-luz: rgba(64, 222, 190, 0.42);
    --an-acento: #59e8c9;
    --an-preco: #59e8c9;
    --an-selo-bg: linear-gradient(135deg, #6ff3d6, #1fae90);
    --an-selo-fg: #022019;
    --an-cta-bg: linear-gradient(135deg, #6ff3d6, #1fae90);
    --an-cta-fg: #022019;
}

.an-estilo-ouro {
    --an-bg1: #2a2114;
    --an-bg2: #060504;
    --an-luz: rgba(236, 196, 106, 0.4);
    --an-acento: #f2d68f;
    --an-preco: #f2d68f;
    --an-selo-bg: linear-gradient(135deg, #fbe7ae, #c8963a);
    --an-selo-fg: #2a1c04;
    --an-cta-bg: linear-gradient(135deg, #fbe7ae, #c8963a);
    --an-cta-fg: #241803;
}

/* ── Fundo ───────────────────────────────────────────────────────────────── */

.an-fundo {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(70% 90% at 76% 48%, color-mix(in srgb, var(--an-bg1) 85%, #fff 15%) 0%, transparent 62%),
        linear-gradient(135deg, var(--an-bg1) 0%, var(--an-bg2) 78%);
}

.an-brilho {
    position: absolute;
    width: 62cqh;
    height: 62cqh;
    left: 72%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--an-luz);
    filter: blur(60px);
    opacity: 0.8;
}

.an-grade {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(75% 80% at 70% 50%, #000 0%, transparent 75%);
            mask-image: radial-gradient(75% 80% at 70% 50%, #000 0%, transparent 75%);
}

/* Faixa de luz que atravessa o anúncio quando ele entra. */
.an-feixe {
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: 0;
    width: 28%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent);
    transform: translateX(-120%) skewX(-18deg);
}

.hero-anuncio.active .an-feixe { animation: an-feixe 1.6s 0.5s cubic-bezier(0.3, 0.6, 0.3, 1) both; }

@keyframes an-feixe {
    to { transform: translateX(480%) skewX(-18deg); }
}

/* ── Anúncio de produto ──────────────────────────────────────────────────── */

.an-palco {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas:
        "topo    foto"
        "titulo  foto"
        "chamada foto"
        "precos  foto"
        "acoes   foto";
    align-content: center;
    column-gap: 4cqw;
    padding: 6cqh 6.5cqw 12cqh;
}

.an-topo {
    grid-area: topo;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.an-marca {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}

.hero-anuncio .an-marca img,
#home .hero-anuncio .an-marca img {
    width: 28px;
    height: 28px;
    border-radius: 8px !important;
    object-fit: cover;
    background: transparent !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.an-selo {
    position: relative;
    overflow: hidden;
    display: inline-block;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    background: var(--an-selo-bg);
    color: var(--an-selo-fg);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 6px 18px -8px var(--an-luz);
}

.an-selo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.65) 50%, transparent 70%);
    transform: translateX(-100%);
}

.hero-anuncio.active .an-selo::after { animation: an-reflexo 3.2s 1.2s ease-in-out infinite; }

@keyframes an-reflexo {
    0%, 55% { transform: translateX(-100%); }
    85%, 100% { transform: translateX(100%); }
}

.an-titulo {
    grid-area: titulo;
    margin: 1rem 0 0.55rem;
    font-family: 'Sora', 'Manrope', sans-serif;
    font-size: clamp(1.25rem, 5.2cqw, 2.6rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.025em;
    color: #fff;
    text-wrap: balance;
    background: linear-gradient(180deg, #ffffff 30%, color-mix(in srgb, var(--an-acento) 40%, #fff 60%));
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
}

.an-chamada {
    grid-area: chamada;
    margin: 0 0 1rem;
    max-width: 44ch;
    font-size: clamp(0.82rem, 1.9cqw, 0.98rem);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.74);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.an-precos {
    grid-area: precos;
    margin: 0 0 1.1rem;
}

.an-preco-de {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.15rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.an-desconto {
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: #ff4d5e;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.an-preco {
    display: flex;
    align-items: flex-start;
    margin: 0;
    font-family: 'Sora', 'Manrope', sans-serif;
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: var(--an-preco);
    text-shadow: 0 10px 40px var(--an-luz);
}

.an-preco-moeda {
    margin: 0.35em 0.3em 0 0;
    font-size: clamp(0.85rem, 2.2cqw, 1.15rem);
    letter-spacing: 0;
    opacity: 0.85;
}

.an-preco-inteiro { font-size: clamp(2.6rem, 10.5cqw, 5rem); }

.an-preco-centavos {
    margin-top: 0.16em;
    font-size: clamp(1.1rem, 4.2cqw, 2rem);
}

.an-prazo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.55rem 0 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--an-acento);
}

.an-acoes {
    grid-area: acoes;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.an-cta,
.an-cta-sec {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.an-cta {
    background: var(--an-cta-bg);
    color: var(--an-cta-fg);
    box-shadow: 0 14px 34px -14px var(--an-luz), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.an-cta i { font-size: 1.1em; }

.an-cta-sec {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
}

.an-cta:hover,
.an-cta-sec:hover { transform: translateY(-2px); }
.an-cta-sec:hover { background: rgba(255, 255, 255, 0.14); }

.an-cta:focus-visible,
.an-cta-sec:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* Produto em destaque: a arte Bird Tech flutuando sobre um pedestal de luz. */
.an-vitrine {
    grid-area: foto;
    position: relative;
    display: grid;
    place-items: center;
    align-self: stretch;
    margin: 0;
    min-height: 0;
    perspective: 1000px;
}

.an-vitrine-moldura {
    position: relative;
    width: min(100%, 74cqh);
    aspect-ratio: 940 / 908;
    border-radius: 7%;
    overflow: hidden;
    transform: rotateY(-10deg) rotateX(4deg) rotateZ(1.5deg);
    box-shadow:
        0 40px 70px -30px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(255, 255, 255, 0.16),
        0 0 90px -20px var(--an-luz);
}

/* Reflexo de vitrine. */
.an-vitrine-moldura::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.05) 32%, transparent 48%);
    pointer-events: none;
}

.hero-anuncio .an-vitrine img,
#home .hero-anuncio .an-vitrine img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 !important;
    background: transparent !important;
}

.an-pedestal {
    position: absolute;
    left: 50%;
    bottom: 4%;
    width: 70%;
    height: 9%;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent);
    filter: blur(6px);
}

/* Entrada: texto sobe em sequência, produto chega flutuando. */
.hero-anuncio.active .an-topo,
.hero-anuncio.active .an-titulo,
.hero-anuncio.active .an-chamada,
.hero-anuncio.active .an-precos,
.hero-anuncio.active .an-acoes,
.hero-anuncio.active .an-painel {
    animation: an-subir 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-anuncio.active .an-titulo { animation-delay: 0.08s; }
.hero-anuncio.active .an-chamada { animation-delay: 0.16s; }
.hero-anuncio.active .an-precos { animation-delay: 0.24s; }
.hero-anuncio.active .an-acoes { animation-delay: 0.32s; }

.hero-anuncio.active .an-vitrine-moldura {
    animation:
        an-chegar 0.9s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) both,
        an-flutuar 6s 1s ease-in-out infinite;
}

@keyframes an-subir {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes an-chegar {
    from { opacity: 0; transform: translateY(24px) rotateY(-22deg) rotateX(4deg) scale(0.92); }
    to { opacity: 1; transform: rotateY(-10deg) rotateX(4deg) rotateZ(1.5deg); }
}

@keyframes an-flutuar {
    0%, 100% { transform: rotateY(-10deg) rotateX(4deg) rotateZ(1.5deg) translateY(0); }
    50% { transform: rotateY(-6deg) rotateX(2deg) rotateZ(0.5deg) translateY(-8px); }
}

/* Moldura quadrada (celular): título e preço ao lado do produto, botões embaixo. */
@container anuncio (max-width: 600px) {
    .an-palco {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr);
        grid-template-rows: auto 1fr auto auto;
        grid-template-areas:
            "topo   topo"
            "titulo foto"
            "precos foto"
            "acoes  acoes";
        align-content: stretch;
        column-gap: 3cqw;
        padding: 5cqw 5cqw 15cqh;
    }

    .an-titulo {
        align-self: end;
        margin: 0 0 0.5rem;
        font-size: clamp(1.15rem, 6.6cqw, 1.9rem);
    }

    .an-chamada { display: none; }

    .an-precos {
        align-self: start;
        margin: 0;
    }

    .an-preco-inteiro { font-size: clamp(2.3rem, 14cqw, 3.6rem); }
    .an-preco-centavos { font-size: clamp(1rem, 5.6cqw, 1.5rem); }
    .an-preco-moeda { font-size: clamp(0.8rem, 3.4cqw, 1rem); }

    .an-vitrine-moldura { width: 100%; }

    .an-brilho {
        left: 72%;
        width: 70cqw;
        height: 70cqw;
    }

    .an-acoes {
        flex-wrap: nowrap;
        margin-top: 4cqw;
    }

    .an-cta { flex: 1 1 auto; }

    .an-cta,
    .an-cta-sec {
        min-height: 42px;
        padding: 0.65rem 0.95rem;
        font-size: 0.84rem;
    }
}

/* Moldura bem baixa (computador com janela achatada): sem a chamada. */
@container anuncio (max-height: 380px) and (min-width: 601px) {
    .an-chamada { display: none; }
    .an-palco { padding-top: 4cqh; }
}

/* ── Anúncio de arte própria ─────────────────────────────────────────────── */

.an-arte-fundo,
.an-arte {
    position: absolute;
    inset: 0;
}

.hero-anuncio .an-arte-fundo img,
#home .hero-anuncio .an-arte-fundo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(28px) brightness(0.55) saturate(1.2);
    transform: scale(1.2);
    background: transparent !important;
}

.hero-anuncio .an-arte img,
#home .hero-anuncio .an-arte img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0 !important;
    background: transparent !important;
    filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.5));
}

.an-painel {
    position: absolute;
    left: 5cqw;
    bottom: 13cqh;
    max-width: min(46cqw, 420px);
    padding: 1rem 1.15rem;
    border-radius: 18px;
    background: rgba(4, 12, 14, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
            backdrop-filter: blur(14px) saturate(1.2);
    box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.8);
}

.an-painel .an-titulo {
    margin: 0.55rem 0 0.35rem;
    font-size: clamp(1.1rem, 3.6cqw, 1.8rem);
}

.an-painel .an-selo + .an-titulo { margin-top: 0.6rem; }
.an-painel > .an-titulo:first-child { margin-top: 0; }

.an-painel .an-chamada {
    margin: 0 0 0.8rem;
    font-size: 0.86rem;
}

.an-painel .an-cta { margin-top: 0.2rem; }

/* Só o botão, sem texto: fica num canto, sem cobrir a arte. */
.an-painel:has(> .an-cta:only-child) {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
}

@container anuncio (max-width: 600px) {
    .an-painel {
        left: 4cqw;
        right: 4cqw;
        bottom: 15cqh;
        max-width: none;
        padding: 0.8rem 0.9rem;
    }

    .an-painel .an-chamada { display: none; }
}

/* ── Integração com o banner da página principal ─────────────────────────── */

/* Enquanto o anúncio está na tela, o título do site sai de cima (celular).
   As setas ficam sempre no mesmo lugar (refinements.css, seção 16). */
#home .hero-titulo {
    transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
}

@media (max-width: 899px) {
    #home.em-anuncio .hero-titulo {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-anuncio *,
    .hero-anuncio *::after {
        animation: none !important;
        transition: none !important;
    }
}
