:root {
    --brand-yellow: #f5c400;
    --brand-yellow-dark: #e4b600;
    --text-dark: #222;
    --muted: #6b7280;
    --bg: #f5f6f8;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-dark);
    overflow-x: hidden;
}

.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: calc(60px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: var(--brand-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    z-index: 1000;
}

.header-logo img { height: 42px; display: block; }

/* Menu sanduíche: na mesma linha do logo, à esquerda. */
.btn-menu {
    position: absolute;
    left: 10px;
    bottom: 8px;
    width: 44px; height: 44px;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
}
.btn-menu span { display: block; height: 3px; border-radius: 2px; background: var(--text-dark); }

.menu-fundo {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1100;
}

.menu-lateral {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 280px; max-width: 85vw;
    padding-top: env(safe-area-inset-top);
    background: #fff;
    box-shadow: 2px 0 12px rgba(0,0,0,.2);
    transform: translateX(-105%);
    transition: transform .2s ease;
    z-index: 1200;
    display: flex;
    flex-direction: column;
}
.menu-lateral.aberto { transform: translateX(0); }

.menu-topo {
    display: flex; align-items: center; justify-content: space-between;
    height: 60px; padding: 0 12px 0 16px;
    background: var(--brand-yellow);
}
.menu-topo img { height: 38px; }
.btn-fechar { border: none; background: transparent; font-size: 1.3rem; width: 44px; height: 44px; }

.menu-lateral a, .menu-sair button, .menu-lateral .menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 18px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1.05rem;
    border-bottom: 1px solid #f0f1f4;
    background: none; border-left: none; border-right: none; border-top: none;
    width: 100%; text-align: left;
}
.menu-lateral a.ativo { background: #fff7d1; font-weight: bold; }
.menu-lateral .ic { width: 24px; text-align: center; }
.menu-sair { margin: auto 0 env(safe-area-inset-bottom); }
.menu-sair button { border-top: 1px solid #f0f1f4; color: var(--muted); }

body.sem-rolagem { overflow: hidden; }

.app-wrapper {
    width: 100%;
    max-width: 480px;
    margin: auto;
    padding: 76px 14px 28px;
}

.card-app {
    background: #fff;
    border-radius: 14px;
    padding: 22px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    margin-bottom: 14px;
}

.logo { width: 130px; display: block; margin: 0 auto 16px; }

.btn-brand {
    background: var(--brand-yellow);
    color: var(--text-dark);
    border: none;
    font-weight: bold;
}
.btn-brand:hover, .btn-brand:focus { background: var(--brand-yellow-dark); color: var(--text-dark); }

.campo-codigo {
    font-size: 2rem;
    letter-spacing: .5rem;
    text-align: center;
    font-weight: bold;
}

.codigo-dev {
    background: #fff7d1;
    border: 1px dashed var(--brand-yellow-dark);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-size: .9rem;
}
.codigo-dev strong { font-size: 1.6rem; letter-spacing: .3rem; }

.beneficio-pct {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
}

.rotulo { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }

.barra { height: 12px; background: #eceef2; border-radius: 6px; overflow: hidden; }
.barra > span { display: block; height: 100%; background: var(--brand-yellow); }

.niveis { display: flex; gap: 4px; margin-top: 8px; }
.niveis span { flex: 1; height: 8px; border-radius: 4px; background: #eceef2; }
.niveis span.ativo { background: var(--brand-yellow); }

.compra { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f1f4; }
.compra:last-child { border-bottom: none; }
.compra .valor { font-weight: bold; white-space: nowrap; }
.compra small { color: var(--muted); }

.mes-titulo { margin: 18px 4px 6px; }
.compra-detalhe summary { list-style: none; cursor: pointer; }
.compra-detalhe summary::-webkit-details-marker { display: none; }
.compra-detalhe .itens { font-size: .9rem; color: var(--muted); padding: 0 0 10px; }
.compra-detalhe .itens div { display: flex; justify-content: space-between; gap: 8px; }

.loja h5 { margin: 0 0 4px; font-weight: bold; }
.loja .distancia { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.loja .acoes { display: flex; gap: 8px; margin-top: 12px; }
.loja .acoes .btn { flex: 1; }

.regulamento summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.regulamento summary::-webkit-details-marker { display: none; }
.regulamento summary::after { content: '+'; font-size: 1.4rem; color: var(--muted); }
.regulamento[open] summary::after { content: '−'; }
.regulamento h5 { font-weight: bold; margin: 0; font-size: 1.05rem; }
.regulamento > ul, .regulamento > ol, .regulamento > p { margin-top: 10px; }
.regulamento p:last-child, .regulamento ul:last-child { margin-bottom: 0; }

/* Instalar app (aviso na Minha conta, item do menu e janela do passo a passo) */
.instalar-app { position: relative; background: #fff7d1; border: 1px solid var(--brand-yellow); border-radius: 14px; padding: 14px 40px 14px 14px; margin-bottom: 14px; }
.instalar-topo { display: flex; gap: 12px; align-items: center; }
.instalar-topo img { width: 44px; height: 44px; border-radius: 10px; }
.instalar-sub { font-size: .85rem; color: var(--muted); }
.instalar-botao { margin-top: 12px; width: 100%; border: none; border-radius: 10px; padding: 11px; background: var(--brand-yellow); font-weight: bold; font-size: 1rem; color: var(--text-dark); }
.instalar-passos { margin-top: 10px; font-size: .95rem; }
.instalar-passos svg { vertical-align: -3px; }
.instalar-fechar { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border: none; background: transparent; font-size: 1rem; color: var(--muted); }
.instalar-dialogo { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1300; display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.instalar-dialogo[hidden] { display: none; }
.instalar-caixa { position: relative; background: #fff; border-radius: 16px; padding: 18px 44px 20px 18px; width: 100%; max-width: 440px; margin-bottom: env(safe-area-inset-bottom); }
.menu-lateral .menu-item[hidden] { display: none; }

/* Logo da bandeira do posto no "Encontre uma loja". */
.logo-bandeira { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
