/* =========================================================
   Base — cores, tipografia e peças usadas em todo o site
   ========================================================= */

:root {
    color-scheme: dark;

    /* Fundo e superfícies */
    --fundo: #0c0e1a;
    --superficie: #151829;
    --superficieAlta: #1e2238;
    --linha: #2a2f4a;
    --linhaForte: #3d4366;

    /* Texto */
    --texto: #eef0fb;
    --textoSuave: #a9aeca;
    --textoFraco: #737896;
    --tinta: #1b1f3b;

    /* Marca */
    --cobalto: #4b5cff;
    --cobaltoEscuro: #3a4af0;
    --cobaltoBrilho: rgba(75, 92, 255, 0.3);
    --amarelo: #ffd84d;
    --rosa: #ff6b98;

    /* Estados */
    --erro: #ff5c7a;
    --erroFundo: rgba(255, 92, 122, 0.12);
    --sucesso: #2fd39a;

    /* Tipografia */
    --fonte: "Bricolage Grotesque", system-ui, sans-serif;
    --texto13: 0.8125rem;
    --texto15: 0.9375rem;
    --texto16: 1rem;
    --texto20: 1.25rem;
    --texto32: 2rem;
    --texto44: 2.75rem;

    /* Espaço (base 4) */
    --e1: 4px;
    --e2: 8px;
    --e3: 12px;
    --e4: 16px;
    --e5: 24px;
    --e6: 32px;
    --e7: 48px;
    --e8: 64px;

    /* Raios */
    --raioCampo: 14px;
    --raioCard: 20px;

    /* Movimento */
    --rapido: 140ms;
    --medio: 260ms;
    --curva: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--fonte);
    font-size: var(--texto16);
    line-height: 1.5;
    color: var(--texto);
    background: var(--fundo);
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
}

body.menuAberto {
    overflow: hidden;
}

img,
video {
    display: block;
    max-width: 100%;
}

a {
    color: var(--amarelo);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

:focus-visible {
    outline: 3px solid var(--amarelo);
    outline-offset: 2px;
    border-radius: 6px;
}

.somenteLeitor {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.conteiner {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 var(--e5);
}

/* ---------- Marca ---------- */

.marca {
    display: inline-flex;
    align-items: center;
    gap: var(--e2);
    font-size: var(--texto20);
    font-weight: 750;
    font-stretch: 85%;
    letter-spacing: -0.02em;
    color: var(--texto);
    text-decoration: none;
}

.marcaIcone {
    width: 30px;
    height: 30px;
    flex: none;
}

/* ---------- Botões ---------- */

.botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--e2);
    min-height: 50px;
    padding: 0 var(--e5);
    font: inherit;
    font-size: var(--texto16);
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    background: var(--cobalto);
    border: 0;
    border-radius: var(--raioCampo);
    cursor: pointer;
    transition: background var(--rapido) ease, transform var(--rapido) ease, box-shadow var(--rapido) ease;
}

.botao:hover {
    background: var(--cobaltoEscuro);
}

.botao:active {
    transform: translateY(1px) scale(0.99);
}

.botao:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.botao svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.botaoCheio {
    width: 100%;
}

.botaoSecundario {
    color: var(--texto);
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--linhaForte);
}

.botaoSecundario:hover {
    background: var(--superficieAlta);
    box-shadow: inset 0 0 0 1.5px var(--textoFraco);
}

.botaoPerigo {
    color: var(--erro);
    background: transparent;
    box-shadow: inset 0 0 0 1.5px rgba(255, 92, 122, 0.45);
}

.botaoPerigo:hover {
    color: #fff;
    background: var(--erro);
}

.botaoPequeno {
    min-height: 40px;
    padding: 0 var(--e4);
    font-size: var(--texto15);
    border-radius: 12px;
}

.botaoGiro {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: girar 700ms linear infinite;
}

.botao.carregando .botaoGiro {
    display: block;
}

@keyframes girar {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Campos ---------- */

.campo {
    margin-bottom: var(--e5);
}

.campoRotulo {
    display: block;
    margin-bottom: var(--e2);
    font-size: var(--texto15);
    font-weight: 650;
}

.campoCaixa {
    position: relative;
}

.campoEntrada {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 var(--e4);
    font: inherit;
    font-size: var(--texto16);
    color: var(--texto);
    background: var(--superficie);
    border: 1.5px solid var(--linha);
    border-radius: var(--raioCampo);
    transition: border-color var(--rapido) ease, box-shadow var(--rapido) ease;
    appearance: none;
}

textarea.campoEntrada {
    height: auto;
    min-height: 180px;
    padding: var(--e3) var(--e4);
    line-height: 1.5;
    resize: vertical;
}

.campoEntrada::placeholder {
    color: var(--textoFraco);
}

.campoEntrada:hover {
    border-color: var(--linhaForte);
}

.campoEntrada:focus {
    outline: none;
    border-color: var(--cobalto);
    box-shadow: 0 0 0 4px var(--cobaltoBrilho);
}

.campoEntrada:disabled {
    color: var(--textoFraco);
    background: var(--fundo);
    cursor: not-allowed;
}

/* O preenchimento automático do Chrome pinta o campo de branco: mantém escuro. */
.campoEntrada:-webkit-autofill {
    -webkit-text-fill-color: var(--texto);
    box-shadow: 0 0 0 100px var(--superficie) inset;
    caret-color: var(--texto);
}

.campoEntrada.comBotao {
    padding-right: 56px;
}

.campo.temErro .campoEntrada {
    border-color: var(--erro);
}

.campo.temErro .campoEntrada:focus {
    box-shadow: 0 0 0 4px var(--erroFundo);
}

.campo.estaCerto .campoEntrada {
    border-color: var(--sucesso);
}

.campoErro {
    display: flex;
    gap: var(--e2);
    align-items: flex-start;
    margin: var(--e2) 0 0;
    font-size: var(--texto15);
    line-height: 1.35;
    color: var(--erro);
}

.campoErro svg {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.campoDica {
    margin: var(--e2) 0 0;
    font-size: var(--texto13);
    color: var(--textoFraco);
}

.botaoOlho {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-top: -21px;
    padding: 0;
    color: var(--textoFraco);
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: color var(--rapido) ease, background var(--rapido) ease;
}

.botaoOlho:hover {
    color: var(--texto);
    background: var(--superficieAlta);
}

.botaoOlho svg {
    width: 22px;
    height: 22px;
}

.botaoOlho .olhoFechado,
.botaoOlho[aria-pressed="true"] .olhoAberto {
    display: none;
}

.botaoOlho[aria-pressed="true"] .olhoFechado {
    display: block;
}

/* ---------- Campo de dinheiro e caixa de marcar ---------- */

.campoDinheiro {
    position: relative;
}

.campoDinheiro span {
    position: absolute;
    top: 50%;
    left: var(--e4);
    transform: translateY(-50%);
    font-weight: 650;
    color: var(--textoSuave);
    pointer-events: none;
}

.campoDinheiro .campoEntrada {
    padding-left: 48px;
    font-variant-numeric: tabular-nums;
}

.marcar {
    display: inline-flex;
    align-items: flex-start;
    gap: var(--e2);
    margin-top: var(--e3);
    font-size: var(--texto15);
    line-height: 1.4;
    color: var(--textoSuave);
    cursor: pointer;
}

.marcar input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--amarelo);
}

/* ---------- Avisos ---------- */

.alerta {
    display: flex;
    gap: var(--e3);
    align-items: flex-start;
    margin-bottom: var(--e5);
    padding: var(--e4);
    font-size: var(--texto15);
    line-height: 1.4;
    color: #ffc2cd;
    background: var(--erroFundo);
    border: 1px solid rgba(255, 92, 122, 0.3);
    border-radius: var(--raioCampo);
}

.alerta svg {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: var(--erro);
}

.alerta p {
    margin: 0;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: var(--e5);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: var(--e3);
    max-width: calc(100% - 32px);
    padding: var(--e3) var(--e4) var(--e3) var(--e3);
    color: var(--texto);
    background: var(--superficieAlta);
    border: 1px solid var(--linhaForte);
    border-radius: 16px;
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
    transform: translateX(-50%);
    animation: toastEntrar 420ms var(--curva) both;
}

.toast.saindo {
    animation: toastSair 260ms ease-in both;
}

.toastIcone {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    color: var(--tinta);
    background: var(--amarelo);
    border-radius: 10px;
}

.toastIcone svg {
    width: 18px;
    height: 18px;
}

.toast p {
    margin: 0;
    font-size: var(--texto15);
    font-weight: 600;
}

.toastErro .toastIcone {
    color: #fff;
    background: var(--erro);
}

@keyframes toastEntrar {
    from {
        opacity: 0;
        transform: translate(-50%, 16px);
    }
}

@keyframes toastSair {
    to {
        opacity: 0;
        transform: translate(-50%, 16px);
    }
}

/* ---------- Cabeçalho ---------- */

.cabecalho {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--fundo);
    border-bottom: 1px solid var(--linha);
}

.cabecalhoLinha {
    display: flex;
    align-items: center;
    gap: var(--e4);
    min-height: 68px;
}

.cabecalhoAcoes {
    display: flex;
    align-items: center;
    gap: var(--e3);
    margin-left: auto;
}

.saudacao {
    font-size: var(--texto15);
    color: var(--textoSuave);
}

.saudacao strong {
    color: var(--texto);
}

.formSair {
    margin: 0;
}

.botaoCarrinho {
    position: relative;
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    color: var(--texto);
    text-decoration: none;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1.5px var(--linhaForte);
    transition: background var(--rapido) ease;
}

.botaoCarrinho:hover {
    background: var(--superficieAlta);
}

.botaoCarrinho svg {
    width: 22px;
    height: 22px;
}

.contadorCarrinho {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 800;
    line-height: 21px;
    text-align: center;
    color: var(--tinta);
    background: var(--amarelo);
    border-radius: 99px;
    box-shadow: 0 0 0 2px var(--fundo);
}

.contadorCarrinho.pulou {
    animation: pular 420ms var(--curva);
}

@keyframes pular {
    40% {
        transform: scale(1.35);
    }
}

/* ---------- Menu (horizontal no computador, gaveta no celular) ---------- */

.botaoMenu {
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-left: -10px;
    padding: 0;
    color: var(--texto);
    background: transparent;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
}

.botaoMenu:hover {
    background: var(--superficieAlta);
}

.botaoMenu svg {
    width: 24px;
    height: 24px;
}

.menuTopo {
    display: none;
}

.menuLista {
    display: flex;
    gap: var(--e2);
    margin: 0 auto;
    list-style: none;
}

.menuItem {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 var(--e3);
    font-size: var(--texto15);
    font-weight: 650;
    color: var(--textoSuave);
    text-decoration: none;
    border-radius: 10px;
    transition: color var(--rapido) ease;
}

.menuItem:hover {
    color: var(--texto);
}

.menuItem.ativo {
    color: var(--texto);
}

.menuItem.ativo::after {
    content: "";
    position: absolute;
    left: var(--e3);
    right: var(--e3);
    bottom: 0;
    height: 3px;
    background: var(--amarelo);
    border-radius: 3px 3px 0 0;
}

.menuSombra {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(5, 6, 14, 0.65);
}

/* ---------- Vazio e paginação ---------- */

.vazio {
    display: grid;
    justify-items: center;
    gap: var(--e3);
    margin-bottom: var(--e8);
    padding: var(--e8) var(--e5);
    text-align: center;
    background: var(--superficie);
    border: 1.5px dashed var(--linha);
    border-radius: var(--raioCard);
}

.vazioTitulo {
    margin: 0;
    font-size: var(--texto20);
    font-weight: 720;
}

.vazioTexto {
    margin: 0;
    max-width: 26rem;
    color: var(--textoSuave);
}

.paginacao {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--e2);
    margin: var(--e6) 0 var(--e8);
}

.paginacaoItem {
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 var(--e3);
    font-size: var(--texto15);
    font-weight: 650;
    color: var(--textoSuave);
    text-decoration: none;
    background: var(--superficie);
    border: 1px solid var(--linha);
    border-radius: 12px;
}

a.paginacaoItem:hover {
    color: var(--texto);
    border-color: var(--linhaForte);
}

.paginacaoItem.atual {
    color: var(--tinta);
    background: var(--amarelo);
    border-color: var(--amarelo);
}

.paginacaoItem.desligado {
    opacity: 0.4;
}

/* ---------- Página de erro ---------- */

.erroPagina {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--e5);
    text-align: center;
}

.erroCodigo {
    display: inline-block;
    margin-bottom: var(--e5);
    padding: var(--e2) var(--e5);
    font-size: var(--texto32);
    font-weight: 800;
    font-stretch: 75%;
    color: var(--tinta);
    background: var(--amarelo);
    border-radius: 99px;
}

.erroTitulo {
    margin: 0 0 var(--e3);
    font-size: var(--texto32);
    line-height: 1.1;
    font-weight: 760;
}

.erroTexto {
    max-width: 28rem;
    margin: 0 auto var(--e5);
    color: var(--textoSuave);
}

/* ---------- Celular ---------- */

@media (max-width: 760px) {
    .conteiner {
        padding: 0 var(--e4);
    }

    .saudacao,
    .esconderCelular {
        display: none;
    }

    .botaoMenu {
        display: grid;
    }

    /* O menu vira uma gaveta que desliza da esquerda, com os itens empilhados */
    .menu {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 50;
        width: min(82vw, 320px);
        padding: var(--e4);
        background: var(--superficie);
        border-right: 1px solid var(--linha);
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform var(--medio) var(--curva), visibility 0s linear var(--medio);
    }

    .menu.aberto {
        transform: translateX(0);
        visibility: visible;
        transition: transform var(--medio) var(--curva), visibility 0s;
    }

    .menuTopo {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: var(--e4);
        padding-left: var(--e3);
    }

    .menuTitulo {
        font-size: var(--texto13);
        font-weight: 650;
        color: var(--textoFraco);
    }

    .menuLista {
        flex-direction: column;
        gap: var(--e1);
        padding: 0;
    }

    .menuItem {
        min-height: 52px;
        font-size: var(--texto16);
    }

    .menuItem.ativo {
        background: var(--superficieAlta);
    }

    .menuItem.ativo::after {
        top: 12px;
        bottom: 12px;
        left: 0;
        right: auto;
        width: 3px;
        height: auto;
        border-radius: 0 3px 3px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }

    .botaoGiro {
        animation: girar 1.4s linear infinite !important;
    }
}