/*
 * Black Friday das empresas (include/teste-ab-black-friday.php): faixa na busca, topo da tela de planos e cartões em dobro.
 * Preto e dourado, "BLACK FRIDAY" grande em Anton, objetos 3D (img/black-friday/), glitter caindo, facho de luz,
 * contagem que vira e etiqueta "2×" balançando nos cartões. Sem movimento para quem pede menos animação.
 */

@property --bf-ang {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes bf-giro { to { --bf-ang: 360deg; } }
@keyframes bf-ouro { to { background-position: -250% 0; } }
@keyframes bf-aurora {
    0% { transform: translate(-6%, -4%) rotate(0deg) scale(1); }
    100% { transform: translate(6%, 5%) rotate(10deg) scale(1.1); }
}
@keyframes bf-cai {
    0% { transform: translate3d(0, -20px, 0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    85% { opacity: 0.9; }
    100% { transform: translate3d(18px, 260px, 0) rotate(540deg); opacity: 0; }
}
@keyframes bf-feixe {
    0%, 40% { transform: translateX(-140%) skewX(-24deg); opacity: 0; }
    50% { opacity: 1; }
    80%, 100% { transform: translateX(340%) skewX(-24deg); opacity: 0; }
}
@keyframes bf-reflexo {
    0%, 55% { transform: translateX(-120%) skewX(-20deg); }
    100% { transform: translateX(260%) skewX(-20deg); }
}
@keyframes bf-balanca-balao {
    0%, 100% { transform: translate(calc(var(--bf-px, 0) * -14px), calc(var(--bf-py, 0) * -10px)) rotate(-4deg) translateY(0); }
    50% { transform: translate(calc(var(--bf-px, 0) * -14px), calc(var(--bf-py, 0) * -10px)) rotate(3deg) translateY(-8px); }
}
@keyframes bf-flutua-objetos {
    0%, 100% { transform: translate(calc(var(--bf-px, 0) * 18px), calc(var(--bf-py, 0) * 12px)) translateY(0); }
    50% { transform: translate(calc(var(--bf-px, 0) * 18px), calc(var(--bf-py, 0) * 12px)) translateY(-7px); }
}
@keyframes bf-entra-balao {
    0% { transform: translateY(40px) scale(0.6) rotate(-14deg); opacity: 0; }
    60% { transform: translateY(-8px) scale(1.06) rotate(4deg); opacity: 1; }
    100% { transform: none; opacity: 1; }
}
@keyframes bf-entra-marca {
    0% { transform: translateY(28px) skewY(6deg); opacity: 0; clip-path: inset(0 0 100% 0); }
    100% { transform: none; opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes bf-sobe {
    from { transform: translateY(14px); opacity: 0; }
    to { transform: none; opacity: 1; }
}
@keyframes bf-vira {
    0% { transform: translateY(-55%) rotateX(70deg); opacity: 0; }
    60% { opacity: 1; }
    100% { transform: none; opacity: 1; }
}
@keyframes bf-pendulo {
    0%, 100% { transform: rotate(-9deg); }
    50% { transform: rotate(7deg); }
}
@keyframes bf-etiqueta-entra {
    0% { transform: translateY(-60px) rotate(-40deg); opacity: 0; }
    55% { transform: translateY(6px) rotate(14deg); opacity: 1; }
    75% { transform: rotate(-8deg); }
    100% { transform: rotate(-9deg); }
}
@keyframes bf-risco { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bf-estoura {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 196, 81, 0.65); }
    35% { transform: scale(1.16); }
    100% { transform: scale(1); box-shadow: 0 0 0 16px rgba(245, 196, 81, 0); }
}
@keyframes bf-pulsa-cta {
    0%, 100% { box-shadow: 0 6px 18px rgba(76, 180, 118, 0.35), 0 0 0 0 rgba(76, 180, 118, 0.45); }
    50% { box-shadow: 0 6px 18px rgba(76, 180, 118, 0.35), 0 0 0 8px rgba(76, 180, 118, 0); }
}

/* ---------- Bloco escuro (faixa e topo) ---------- */

.bf-hero {
    --bf-px: 0;
    --bf-py: 0;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "arte texto lado";
    align-items: center;
    gap: 14px 20px;
    padding: 18px 26px 18px 14px;
    border-radius: 20px;
    background:
        radial-gradient(120% 140% at 0% 0%, #1b1712 0%, rgba(27, 23, 18, 0) 55%),
        linear-gradient(115deg, #0c0c0f 0%, #050506 60%, #0d0b08 100%);
    color: #fff;
    box-shadow: 0 22px 50px rgba(5, 5, 6, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-align: left;
}

/* Borda dourada que gira */
.bf-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 6;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(from var(--bf-ang),
        rgba(245, 196, 81, 0.14) 0%, #f5c451 8%, rgba(245, 196, 81, 0.14) 22%,
        rgba(245, 196, 81, 0.14) 50%, #fde68a 58%, rgba(245, 196, 81, 0.14) 72%, rgba(245, 196, 81, 0.14) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: bf-giro 6s linear infinite;
    pointer-events: none;
}

/* Textura de pontos bem leve */
.bf-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.2px);
    background-size: 14px 14px;
    -webkit-mask: linear-gradient(90deg, transparent 0%, #000 45%, transparent 100%);
    mask: linear-gradient(90deg, transparent 0%, #000 45%, transparent 100%);
    pointer-events: none;
}

.bf-aurora {
    position: absolute;
    inset: -70% -25%;
    z-index: -2;
    background:
        radial-gradient(closest-side at 16% 55%, rgba(245, 196, 81, 0.34), transparent 75%),
        radial-gradient(closest-side at 72% 30%, rgba(212, 149, 15, 0.18), transparent 75%),
        radial-gradient(closest-side at 48% 95%, rgba(253, 230, 138, 0.10), transparent 75%);
    animation: bf-aurora 10s ease-in-out infinite alternate;
    pointer-events: none;
}

.bf-feixe {
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: 0;
    z-index: 4;
    width: 22%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 246, 209, 0.10) 40%, rgba(255, 246, 209, 0.22) 50%, rgba(255, 246, 209, 0.10) 60%, transparent 100%);
    mix-blend-mode: screen;
    animation: bf-feixe 7s ease-in-out 1.2s infinite;
    pointer-events: none;
}

.bf-glitter {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.bf-glitter i {
    position: absolute;
    top: -10px;
    left: var(--x);
    width: var(--s);
    height: calc(var(--s) * 1.6);
    border-radius: 1px;
    background: linear-gradient(180deg, #fff6d1, #f5c451 60%, #b7791f);
    box-shadow: 0 0 6px rgba(253, 230, 138, 0.8);
    opacity: 0;
    animation: bf-cai var(--t) linear var(--d) infinite;
}

.bf-glitter i:nth-child(3n) {
    border-radius: 50%;
    height: var(--s);
}

/* Cartões de perfil 3D: dentro do .bf-lado, à esquerda da contagem e atrás do texto */
.bf-objetos {
    position: absolute;
    right: calc(100% - 14px);
    top: calc(50% - 78px);
    z-index: -1;
    height: 156px;
    width: auto;
    opacity: 0.95;
    -webkit-mask: radial-gradient(closest-side, #000 62%, transparent 100%);
    mask: radial-gradient(closest-side, #000 62%, transparent 100%);
    animation: bf-flutua-objetos 6s ease-in-out infinite;
    pointer-events: none;
}

.bf-hero > .bf-arte,
.bf-hero > .bf-texto,
.bf-hero > .bf-lado {
    position: relative;
    z-index: 5;
}

/* O lado fica um degrau abaixo do texto: os cartões que ele leva passam por trás das letras */
.bf-hero > .bf-lado {
    z-index: 4;
}

/* Marca do site, para não parecer anúncio de outra loja */
.bf-hero .bf-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
}

.bf-hero .bf-logo img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    box-shadow: 0 0 0 1.5px rgba(245, 196, 81, 0.55);
}

.bf-hero .bf-logo span {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.2px;
    opacity: 0.92;
}

/* Balão "2×" */
.bf-arte {
    grid-area: arte;
    width: 150px;
    height: 132px;
    margin: -14px -6px -18px 0;
}

.bf-balao {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 22px rgba(245, 196, 81, 0.35));
    animation: bf-balanca-balao 4.5s ease-in-out infinite;
    transform-origin: 50% 90%;
}

.bf-texto {
    grid-area: texto;
    min-width: 0;
}

.bf-marca {
    display: block;
    font-family: 'Anton', 'Impact', 'Arial Narrow Bold', sans-serif;
    font-size: 54px;
    line-height: 0.95;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
}

.bf-hero .bf-marca span {
    font-family: inherit;
    font-size: inherit;
    color: #fff;
}

.bf-hero .bf-marca span + span {
    background: linear-gradient(100deg, #e9ac2f 0%, #f7cd5c 20%, #fff8dc 32%, #f7cd5c 44%, #e4a52a 68%, #f7cd5c 84%, #e9ac2f 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: bf-ouro 3.8s linear infinite;
}

.bf-titulo {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.3px;
    color: #fff;
}

.bf-hero .bf-titulo em {
    font-style: normal;
    background: linear-gradient(100deg, #e9ac2f 0%, #f7cd5c 20%, #fff8dc 32%, #f7cd5c 44%, #e4a52a 68%, #f7cd5c 84%, #e9ac2f 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: bf-ouro 3.8s linear infinite;
}

.bf-lado {
    grid-area: lado;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

/* Contagem regressiva (os números viram como placas) */
.bf-hero .bf-contagem-rotulo {
    display: block;
    margin-bottom: 6px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #f5c451;
    text-align: center;
}

.bf-hero .bf-blocos {
    display: flex;
    gap: 6px;
    perspective: 300px;
}

.bf-hero .bf-bloco {
    position: relative;
    display: block;
    min-width: 50px;
    overflow: hidden;
    perspective: 200px;
    padding: 8px 4px 6px;
    border-radius: 10px;
    border: 1px solid rgba(245, 196, 81, 0.28);
    background: linear-gradient(180deg, #22222a 0%, #141418 50%, #0d0d10 50.5%, #17171c 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 6px 14px rgba(0, 0, 0, 0.35);
    text-align: center;
    transform-style: preserve-3d;
}

.bf-hero .bf-bloco.bf-vira b {
    animation: bf-vira 0.45s cubic-bezier(.2, .8, .3, 1.2);
}

.bf-hero .bf-bloco b {
    display: block;
    font-family: 'Anton', 'Impact', sans-serif;
    font-size: 26px;
    line-height: 1.05;
    font-weight: 400;
    background: linear-gradient(180deg, #f7cd5c 0%, #e9ac2f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
    filter: drop-shadow(0 0 8px rgba(233, 172, 47, 0.35));
}

.bf-hero .bf-bloco small {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #a1a1aa;
}

/* ---------- Faixa na busca ---------- */

.bf-hero-faixa {
    min-height: 150px;
    margin: 0 0 22px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: bf-sobe 0.6s ease-out both;
}

.bf-hero-faixa:hover {
    transform: translateY(-2px);
    box-shadow: 0 26px 56px rgba(5, 5, 6, 0.34);
}

.bf-hero-faixa .bf-cta {
    padding: 10px 16px;
    font-size: 15px;
}

.bf-hero-faixa .bf-balao {
    animation: bf-entra-balao 0.9s cubic-bezier(0.2, 1.2, 0.4, 1) 0.1s both, bf-balanca-balao 4.5s ease-in-out 1s infinite;
}

.bf-hero-faixa .bf-marca {
    animation: bf-entra-marca 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) 0.2s both;
}

.bf-cta {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4cb476 0%, #3ba164 100%);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    white-space: nowrap;
    animation: bf-pulsa-cta 2.4s ease-in-out infinite;
}

.bf-hero .bf-cta-texto {
    color: #fff;
    font-size: inherit;
}

.bf-cta svg {
    width: 17px;
    height: 17px;
    transition: transform 0.2s ease;
}

.bf-hero-faixa:hover .bf-cta svg {
    transform: translateX(3px);
}

.bf-cta::after,
#modalPagamento.bf-ativa .plan-card-bf .btn-pix-card::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    animation: bf-reflexo 3.2s ease-in-out infinite;
    pointer-events: none;
}

/* ---------- Topo da tela de planos (só com .bf-ativa) ---------- */

.bf-hero-topo {
    display: none;
    clear: both;
    margin: 6px 0 34px;
    min-height: 150px;
}

#modalPagamento.bf-ativa .bf-hero-topo {
    display: grid;
}

#modalPagamento.bf-ativa .planos-subtitulo {
    display: none;
}

#modalPagamento.bf-animar .bf-hero-topo .bf-balao {
    animation: bf-entra-balao 0.9s cubic-bezier(0.2, 1.2, 0.4, 1) 0.05s both, bf-balanca-balao 4.5s ease-in-out 1s infinite;
}

#modalPagamento.bf-animar .bf-hero-topo .bf-marca {
    animation: bf-entra-marca 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) 0.15s both;
}

#modalPagamento.bf-animar .bf-hero-topo .bf-titulo {
    animation: bf-sobe 0.5s ease-out 0.35s both;
}

#modalPagamento.bf-animar .bf-hero-topo .bf-lado {
    animation: bf-sobe 0.5s ease-out 0.45s both;
}

#modalPagamento.bf-animar .bf-hero-topo .bf-objetos {
    animation: bf-sobe 0.8s ease-out 0.3s both, bf-flutua-objetos 6s ease-in-out 1.1s infinite;
}

/* ---------- Cartões do Avançado e do Estratégico ---------- */

.plan-card .plan-info-bf,
.plan-card .bf-selo {
    display: none;
}

#modalPagamento.bf-ativa .plan-card-bf,
#modalPagamento.bf-ativa .plan-card-bf:hover,
#modalPagamento.bf-ativa .plan-card-bf.selected {
    border: 2px solid transparent;
    background:
        radial-gradient(120% 60% at 100% 0%, rgba(245, 196, 81, 0.10) 0%, rgba(245, 196, 81, 0) 60%) padding-box,
        linear-gradient(#fff, #fff) padding-box,
        conic-gradient(from var(--bf-ang), #f5c451 0%, #17171b 14%, #17171b 36%, #fde68a 50%, #17171b 64%, #17171b 86%, #f5c451 100%) border-box;
    animation: bf-giro 5s linear infinite;
    box-shadow: 0 18px 40px rgba(183, 121, 31, 0.16);
}

#modalPagamento.bf-ativa .plan-card-bf:hover {
    box-shadow: 0 24px 50px rgba(183, 121, 31, 0.26);
}

#modalPagamento.bf-ativa .plan-card-bf .plan-info-normal {
    display: none;
}

#modalPagamento.bf-ativa .plan-card-bf .plan-info-bf {
    display: inline;
}

#modalPagamento.bf-ativa .plan-card-bf .bf-selo {
    display: block;
}

/* A fita ("Mais escolhido", "Menor custo") fica por cima do cordão da etiqueta, que parece passar por dentro dela */
#modalPagamento.bf-ativa .plan-card-bf .ribbon {
    z-index: 6;
}

#modalPagamento.bf-ativa .plan-card-bf .btn-pix-card {
    overflow: hidden;
}

.plan-info-bf .bf-antigo {
    position: relative;
    display: inline-block;
    margin-right: 3px;
    color: #94a3b8;
    font-weight: 700;
}

.plan-info-bf .bf-antigo::after {
    content: "";
    position: absolute;
    left: -2px;
    right: -2px;
    top: 52%;
    height: 2px;
    border-radius: 2px;
    background: #ef4444;
    transform-origin: left center;
}

.plan-info-bf .bf-novo {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-top: -3px;
    padding: 3px 9px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1d1d22 0%, #0a0a0c 100%);
    color: #fde68a;
    font-weight: 900;
    overflow: hidden;
}

.plan-info-bf .bf-novo b {
    font-weight: 900;
    color: #fde68a;
    font-variant-numeric: tabular-nums;
}

.plan-info-bf .bf-novo::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 45%;
    background: linear-gradient(90deg, transparent, rgba(253, 230, 138, 0.35), transparent);
    animation: bf-reflexo 3.6s ease-in-out 1.6s infinite;
    pointer-events: none;
}

#modalPagamento.bf-animar .plan-info-bf .bf-antigo::after {
    animation: bf-risco 0.35s ease-out 0.3s both;
}

#modalPagamento.bf-animar .plan-info-bf .bf-novo {
    animation: bf-estoura 0.7s ease-out 1.55s both;
}

/* Etiqueta dourada "2×" pendurada, balançando */
.bf-selo {
    position: absolute;
    top: 34px;
    right: 8px;
    z-index: 4;
    width: 80px;
    height: 78px;
    transform-origin: 19% -6px;
    animation: bf-pendulo 3.4s ease-in-out infinite;
    pointer-events: none;
}

/* Cordão que sobe do laço da etiqueta e passa por trás da fita */
.bf-selo::before {
    content: "";
    position: absolute;
    left: calc(19% - 1.5px);
    top: -8px;
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: linear-gradient(90deg, #050505 0%, #3a3a3a 50%, #0a0a0a 100%);
}

.bf-selo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(154, 100, 24, 0.35));
}

#modalPagamento.bf-animar .plan-card-bf .bf-selo {
    animation: bf-etiqueta-entra 1s cubic-bezier(0.3, 1.2, 0.4, 1) 0.25s both, bf-pendulo 3.4s ease-in-out 1.25s infinite;
}

/* Confete (js/black-friday.js) */
.bf-confete-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000;
    pointer-events: none;
}

/* ---------- Celular ---------- */

@media (max-width: 700px) {
    .bf-hero,
    .bf-hero-faixa {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "arte texto"
            "lado lado";
        gap: 10px 8px;
        padding: 14px 14px 16px 6px;
    }

    .bf-arte {
        width: 94px;
        height: 88px;
        margin: -8px -4px -6px 0;
    }

    .bf-marca {
        font-size: 33px;
    }

    .bf-titulo {
        font-size: 18px;
        margin-top: 4px;
    }

    .bf-lado,
    .bf-hero-faixa .bf-lado {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 10px;
        padding-left: 8px;
    }

    .bf-hero-topo .bf-lado {
        justify-content: flex-start;
    }

    .bf-hero .bf-contagem-rotulo {
        text-align: left;
    }

    .bf-hero-topo .bf-contagem-rotulo {
        text-align: left;
    }

    .bf-hero .bf-bloco {
        min-width: 44px;
        padding: 6px 3px 5px;
    }

    .bf-hero .bf-bloco b {
        font-size: 22px;
    }

    .bf-objetos {
        right: -30px;
        top: auto;
        bottom: -26px;
        height: 104px;
        opacity: 0.75;
    }

    .bf-hero-faixa .bf-objetos {
        right: 30px;
        opacity: 0.5;
    }

    .bf-hero .bf-logo {
        margin-bottom: 4px;
    }

    .bf-hero .bf-logo img {
        width: 20px;
        height: 20px;
    }

    .bf-hero .bf-logo span {
        font-size: 12.5px;
    }

    .bf-hero-faixa {
        min-height: 0;
        padding: 14px 14px 16px 6px;
    }

    .bf-hero-faixa .bf-cta {
        padding: 0;
    }

    .bf-cta {
        flex-shrink: 0;
        width: 52px;
        height: 52px;
        padding: 0;
        border-radius: 50%;
    }

    .bf-hero .bf-cta-texto {
        display: none;
    }

    .bf-cta svg {
        width: 22px;
        height: 22px;
        margin-left: 2px;
    }

    .bf-hero-topo {
        min-height: 0;
        margin: 4px 0 30px;
    }

    .bf-selo {
        width: 66px;
        height: 66px;
        right: 8px;
    }
}

@media (max-width: 370px) {
    .bf-marca {
        font-size: 29px;
    }

    .bf-hero .bf-bloco {
        min-width: 38px;
    }

    .bf-cta {
        width: 46px;
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bf-hero *,
    .bf-hero::before,
    .bf-hero-faixa,
    .bf-cta::after,
    .bf-selo,
    .plan-info-bf .bf-novo::after,
    #modalPagamento.bf-ativa .plan-card-bf,
    #modalPagamento.bf-ativa .plan-card-bf .btn-pix-card::after,
    #modalPagamento.bf-animar * {
        animation: none !important;
    }

    .bf-glitter,
    .bf-feixe {
        display: none;
    }

    .bf-selo { transform: rotate(-9deg); }
}
