:root {
    --amarelo: #f8c807;
    --amarelo-escuro: #d9ac00;
    --preto: #141414;
    --cinza-escuro: #2a2a2a;
    --cinza-claro: #f0f0f0;
    --branco: #ffffff;
    --sombra: 0 4px 16px rgba(0, 0, 0, 0.15);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--cinza-claro);
    color: var(--preto);
}

a { color: inherit; }

/* ---------- topo ---------- */
header.topo {
    background: var(--preto);
    color: var(--branco);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--sombra);
}

header.topo img.logo {
    height: 46px;
    width: 46px;
    border-radius: 50%;
}

header.topo .nome-loja {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

header.topo .nome-loja span { color: var(--amarelo); }

header.topo .subtitulo {
    font-size: 0.78rem;
    color: #bbb;
    margin-top: 2px;
}

/* ---------- hero ---------- */
.hero {
    text-align: center;
    padding: 22px 16px;
    background: var(--amarelo);
}

.hero h1 {
    font-size: 1.7rem;
    margin: 0 0 6px;
    color: var(--preto);
    font-weight: 800;
}

.mobile-br { display: none; }
@media (max-width: 600px) { .mobile-br { display: inline; } }

.hero p {
    color: var(--preto);
    opacity: .82;
    margin: 0;
    font-size: 0.95rem;
}

/* ---------- grid de produtos ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    padding: 10px 24px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--branco);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--sombra);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease;
    cursor: pointer;
}

.card:hover { transform: translateY(-3px); }

.card .imagem-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--cinza-claro);
    overflow: hidden;
}

.card .imagem-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card .btn-video {
    background: var(--preto);
    color: var(--branco);
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease;
}

.card .btn-video:hover { background: #333; }

.card .corpo {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.card .nome {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    min-height: 2.6em;
}

.card .nome-link {
    color: inherit;
    text-decoration: none;
}

.card .nome-link:hover {
    text-decoration: underline;
}

.card .specs {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.78rem;
    color: var(--cinza-escuro);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.card .specs li::before { content: "✓ "; color: var(--amarelo-escuro); font-weight: 700; }

.card .preco-wrap {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.card .preco-original {
    font-size: 0.78rem;
    color: var(--cinza-escuro);
    text-decoration: line-through;
}

.card .preco-atual {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1a8917;
}

.card .desconto-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: #1a8917;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
}

.card .btn-comprar {
    margin-top: auto;
    background: var(--amarelo);
    color: var(--preto);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.card .btn-comprar:hover { background: var(--amarelo-escuro); }

/* ---------- modal genérico ---------- */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 20, 0.78);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.overlay.aberto { display: flex; }

.modal {
    background: var(--branco);
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.modal .fechar {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--cinza-claro);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 2;
}

/* modal de vídeo */
#modal-video .modal {
    max-width: 420px;
    background: var(--preto);
}

#modal-video .modal-video-inner {
    padding: 10px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* modal de cupom */
#modal-cupom .modal { padding: 18px 20px 16px; }

#modal-cupom .produto-nome {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--preto);
    margin: 4px 0 8px;
    text-align: center;
}

.cupom-video-wrap {
    display: none;
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    position: relative;
    z-index: 0;
}
.cupom-video-wrap iframe {
    border-radius: 8px;
    aspect-ratio: 9 / 16;
    height: min(500px, 60vh);
    width: auto;
}

.cupom-video-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    aspect-ratio: 9 / 16;
    height: min(500px, 60vh);
    width: auto;
    z-index: 1;
    cursor: pointer;
}

.cupom-video-controles {
    position: absolute;
    top: 48px;
    right: 8px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-mute {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.btn-mute svg {
    width: 22px;
    height: 22px;
}

.btn-mute:hover {
    opacity: 0.7;
}

.caixa-cupom {
    background: var(--preto);
    color: var(--amarelo);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
    animation: cupom-flutua 8s ease-in-out infinite;
}

@keyframes cupom-flutua {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.caixa-cupom .codigo {
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.caixa-cupom .desconto {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25d366;
    color: var(--branco);
    font-size: 0.95rem;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 999px;
    margin-top: 6px;
}

.btn-copiar {
    width: 100%;
    background: var(--cinza-claro);
    border: 2px dashed var(--amarelo-escuro);
    border-radius: 10px;
    padding: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    margin-bottom: 10px;
    color: var(--preto);
}

.btn-copiar.copiado {
    border-style: solid;
    background: var(--amarelo);
}

.instrucoes {
    background: #fff9e0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--cinza-escuro);
    margin-bottom: 10px;
}

.instrucoes b { color: var(--preto); }

.disclaimer-cupom {
    font-size: 0.65rem;
    color: #999;
    line-height: 1.4;
    margin-top: 4px;
}

.btn-ir-loja {
    display: block;
    text-align: center;
    text-decoration: none;
    background: var(--amarelo);
    color: var(--preto);
    border-radius: 10px;
    padding: 13px;
    font-weight: 800;
    font-size: 0.95rem;
}

.btn-ir-loja:hover { background: var(--amarelo-escuro); }

/* ---------- gate de cadastro (cupom borrado pra não-membro) ---------- */
.cupom-blur {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
}

.cadastro-gate {
    margin-top: 14px;
    text-align: center;
}

.cadastro-titulo {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--amarelo);
    margin-bottom: 10px;
}

.cadastro-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cadastro-nome,
.cadastro-email {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #0f0f0f;
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.cadastro-nome:focus,
.cadastro-email:focus {
    border-color: var(--amarelo);
}

.cadastro-nome::placeholder,
.cadastro-email::placeholder {
    color: #777;
}

.cadastro-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: var(--amarelo);
    color: var(--preto);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.cadastro-btn:hover { background: var(--amarelo-escuro); }
.cadastro-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.cadastro-msg {
    font-size: 0.78rem;
    color: #ff6b6b;
    margin-top: 6px;
    min-height: 1em;
}

.cadastro-sucesso {
    margin-top: 12px;
    text-align: center;
}

.cadastro-ok {
    font-size: 0.9rem;
    font-weight: 700;
    color: #22c55e;
    margin-bottom: 10px;
}

.cadastro-whatsapp {
    display: inline-block;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
}

.cadastro-whatsapp:hover { background: #1da851; }

.convite-whatsapp {
    margin-top: 16px;
    background: #0a1f12;
    border: 1px solid #25d366;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}
.convite-whatsapp-icone { margin-bottom: 10px; }
.convite-whatsapp-texto strong {
    display: block;
    font-size: 0.95rem;
    color: #25d366;
    margin-bottom: 6px;
}
.convite-whatsapp-texto p {
    font-size: 0.82rem;
    color: #bbb;
    margin: 0 0 14px;
    line-height: 1.4;
}
.convite-whatsapp-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.convite-whatsapp-sim {
    display: inline-block;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
}
.convite-whatsapp-sim:hover { background: #1da851; }
.convite-whatsapp-nao {
    background: transparent;
    border: 1px solid #555;
    color: #999;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
}
.convite-whatsapp-nao:hover { border-color: #888; color: #ccc; }

.aviso-cupom {
    font-size: 0.72rem;
    color: #999;
    text-align: center;
    margin-top: 10px;
}

/* popup "todos os cupons" */
.carregando-cupons {
    text-align: center;
    color: var(--cinza-escuro);
    font-size: .85rem;
    padding: 20px 0;
}

.linha-cupom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--cinza-claro);
}

.linha-cupom:last-child { border-bottom: none; }

.linha-cupom-codigo {
    font-family: monospace;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .5px;
}

.linha-cupom-desconto {
    font-size: .75rem;
    color: var(--cinza-escuro);
    margin-top: 2px;
}

.linha-cupom-btn {
    flex-shrink: 0;
    background: var(--amarelo);
    color: var(--preto);
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 700;
    font-size: .78rem;
    cursor: pointer;
}

.linha-cupom-btn.copiado {
    background: var(--cinza-claro);
}

#modal-lista-cupons .modal {
    max-width: 400px;
    padding: 26px 22px 22px;
    text-align: center;
}

.logo-modal {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
    margin: 0 auto 4px;
}

#modal-lista-cupons h2 {
    margin: 6px 0 4px;
    font-size: 1.2rem;
}

#modal-lista-cupons .produto-nome {
    margin-bottom: 10px;
}

#lista-cupons-corpo {
    text-align: left;
    max-height: 340px;
    overflow-y: auto;
}

.paginacao {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 24px 30px;
}

.paginacao a {
    text-decoration: none;
    color: var(--preto);
    background: var(--branco);
    border-radius: 8px;
    padding: 8px 13px;
    font-size: .85rem;
    font-weight: 700;
    box-shadow: var(--sombra);
}

.paginacao a.ativa {
    background: var(--amarelo);
}

footer {
    text-align: center;
    padding: 24px 16px 40px;
    color: var(--cinza-escuro);
    font-size: 0.78rem;
}

.logo-rodape {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 2px;
    position: relative;
    top: -1px;
}

.footer-afiliado {
    font-size: 0.68rem;
    color: #999;
    margin-top: 6px;
}

/* ---------- barra inferior fixa (estilo app), só mobile ---------- */
.tab-bar {
    display: none;
}

/* ---------- mobile: grid de 2 colunas + cards compactos, estilo app ---------- */
@media (max-width: 640px) {
    body {
        padding-bottom: 62px; /* espaço pra tab-bar fixa não cobrir conteúdo */
    }

    header.topo {
        padding: 10px 14px;
    }

    header.topo .subtitulo {
        display: none; /* economiza espaço vertical, igual apps enxutos */
    }

    .hero {
        padding: 18px 14px 14px;
    }

    .hero h1 {
        font-size: 1.15rem;
    }

    .hero p {
        font-size: .82rem;
    }

    .grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 6px 10px 20px;
    }

    .card .corpo {
        padding: 8px 9px 9px;
        gap: 6px;
    }

    .card .nome {
        font-size: .78rem;
        min-height: 2.2em;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .card .specs {
        display: none; /* denso demais em 2 colunas, corta pra caber mais itens na tela */
    }

    /* botão de vídeo vira ícone circular sobre a imagem, igual o carrinho do ML */
    .card .btn-video {
        position: absolute;
        bottom: 6px;
        right: 6px;
        width: 32px;
        height: 32px;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .card .btn-video::before {
        content: "▶";
        font-size: .8rem;
        color: var(--branco);
    }

    .card .btn-comprar {
        padding: 8px;
        font-size: .74rem;
        border-radius: 8px;
    }

    .paginacao {
        padding: 0 10px 20px;
    }

    footer {
        padding-bottom: 20px;
    }

    .tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--branco);
        border-top: 1px solid #e5e5e5;
        z-index: 60;
        padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    }

    .tab-bar a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        text-decoration: none;
        color: var(--cinza-escuro);
        font-size: .64rem;
        font-weight: 600;
    }

    .tab-bar a .icone {
        width: 20px;
        height: 20px;
    }

    .tab-bar a:active {
        color: var(--preto);
    }

    .oferta-relampago {
        bottom: 68px; /* fica acima da tab-bar fixa */
        width: calc(100% - 24px);
        left: 12px;
        transform: translateY(0) translateX(0);
    }

    .oferta-relampago:not(.aberta) {
        transform: translateY(140%);
    }
}

/* ---------- card de oferta relâmpago, estilo ingresso de cinema ---------- */
:root {
    --vermelho-relampago: #e0392b;
}

.oferta-relampago {
    position: fixed;
    bottom: 24px;
    left: 50%;
    width: 340px;
    max-width: calc(100% - 32px);
    z-index: 70;
    transform: translateY(140%) translateX(-50%);
    transition: transform .45s cubic-bezier(.2, .8, .3, 1.2);
}

.oferta-relampago.aberta {
    transform: translateY(0) translateX(-50%);
}

.oferta-relampago-fechar {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--branco);
    color: var(--preto);
    border: 2px solid var(--vermelho-relampago);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: .8rem;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}

.oferta-relampago-ticket {
    position: relative;
    display: flex;
    background: #000;
    border: 2px solid var(--vermelho-relampago);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* canhoto -- lado esquerdo, logo, separado por picote (linha tracejada).
   arredondamento aplicado aqui em vez de overflow:hidden no ticket, pra
   não cortar o botão fechar (que fica com posição negativa, pra fora do
   card) -- achado 07/ago/2026, "o botao fechar ficou cortado". */
.oferta-relampago-canhoto {
    flex-shrink: 0;
    width: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    border-right: 2px dashed var(--vermelho-relampago);
    border-radius: 12px 0 0 12px;
    background: repeating-linear-gradient(135deg, #000, #000 8px, #1a0d0c 8px, #1a0d0c 16px);
}

.oferta-relampago-canhoto img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--amarelo);
}

.oferta-relampago-corpo {
    flex: 1;
    min-width: 0;
    padding: 12px 14px 14px;
}

.oferta-relampago-selo {
    color: var(--vermelho-relampago);
    background: var(--branco);
    display: inline-block;
    text-align: center;
    width: 100%;
    font-weight: 900;
    font-size: 1.35rem;
    letter-spacing: .5px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .15);
    margin-bottom: 6px;
    animation: pulso-relampago 1s ease-in-out infinite;
}

@keyframes pulso-relampago {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}

.oferta-relampago-urgencia {
    font-weight: 800;
    font-size: 1rem;
    color: var(--amarelo);
    margin-top: 2px;
    margin-bottom: 10px;
}

.oferta-relampago-produto {
    display: flex;
    gap: 10px;
    align-items: center;
}

.oferta-relampago-produto img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    border: 1px solid #333;
}

.oferta-relampago-info {
    flex: 1;
    min-width: 0;
}

.oferta-relampago-nome {
    font-size: .8rem;
    font-weight: 700;
    color: var(--branco);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.oferta-relampago-btn {
    width: 100%;
    background: var(--amarelo);
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-weight: 800;
    font-size: .78rem;
    cursor: pointer;
}

.oferta-relampago-btn:hover {
    background: var(--amarelo-escuro);
}

/* ---------- banner whatsapp ---------- */
.banner-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s;
}

.banner-whatsapp:hover {
    background: #1da851;
}

.banner-whatsapp-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .banner-whatsapp {
        font-size: 0.8rem;
        padding: 10px 14px;
    }
    .banner-whatsapp-icon {
        width: 18px;
        height: 18px;
    }
}

/* ---------- favoritos ---------- */
.link-favoritos-desktop {
    margin-left: auto;
    color: var(--amarelo);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.link-favoritos-desktop:hover {
    color: var(--branco);
}

@media (max-width: 640px) {
    .link-favoritos-desktop { display: none; }
}

.btn-favorito {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
    transition: background 0.15s, transform 0.15s;
}

.btn-favorito:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.1);
}

.btn-favorito.ativo {
    color: #e74c3c;
    background: rgba(255,255,255,0.9);
}

.btn-favorito-produto {
    background: none;
    border: 2px solid #ccc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.15s;
}

.btn-favorito-produto:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.btn-favorito-produto.ativo {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fef2f2;
}

.favoritos-vazio {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 0.95rem;
}

.favoritos-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0 0;
}

.favoritos-header .btn-voltar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--branco);
    color: var(--preto);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: var(--sombra);
    text-decoration: none;
}

.favoritos-header .btn-voltar:hover {
    background: var(--amarelo);
}

.modal-cadastro-favoritos {
    text-align: center;
    padding: 30px 20px;
}

.modal-cadastro-favoritos .cadastro-titulo {
    margin-bottom: 14px;
}

.modal-cadastro-favoritos .cadastro-form {
    max-width: 320px;
    margin: 0 auto;
}

/* ---------- busca, chips e ordenação (02/set/2026) ----------
   Desenhado mobile-first: o público é majoritariamente celular, então tudo
   aqui é pensado pro polegar — alvos grandes, chips que rolam na horizontal
   e o seletor nativo do sistema pra ordenar. */
.busca-barra {
    position: sticky;
    top: 74px;                     /* logo abaixo do header, que também é sticky */
    z-index: 40;
    background: rgba(240, 240, 240, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    padding: 10px 16px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.busca-form { max-width: 1200px; margin: 0 auto; }

.busca-campo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--branco);
    border-radius: 14px;
    padding: 0 6px 0 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
    transition: box-shadow .18s ease;
}

.busca-campo:focus-within {
    box-shadow: 0 0 0 2.5px var(--amarelo), 0 4px 16px rgba(0, 0, 0, 0.12);
}

.busca-icone { width: 19px; height: 19px; flex: 0 0 auto; color: #9a9a9a; }

.busca-campo input[type="search"] {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    /* 16px evita o zoom automático do iOS ao focar o campo */
    font-size: 16px;
    font-family: inherit;
    color: var(--preto);
    padding: 14px 0;
    -webkit-appearance: none;
}

.busca-campo input[type="search"]::-webkit-search-cancel-button { display: none; }
.busca-campo input::placeholder { color: #a8a8a8; }

.busca-limpar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-right: 2px;
    border-radius: 50%;
    background: var(--cinza-claro);
    color: #777;
    text-decoration: none;
    font-size: 0.78rem;
}

.busca-limpar:active { transform: scale(0.9); }

/* ----- sugestões (autocomplete) ----- */
.busca-sugestoes {
    position: absolute;
    z-index: 70;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--branco);
    border-radius: 14px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.2);
    max-height: min(52vh, 380px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.busca-sugestao {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    /* 48px de altura: alvo de toque confortável */
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.3;
    cursor: pointer;
}

.busca-sugestao.ativa, .busca-sugestao:hover { background: var(--cinza-claro); }
.busca-sugestao:active { background: #e6e6e6; }
.busca-sugestao.e-categoria { font-weight: 700; }

.busca-sugestao-tag {
    flex: 0 0 auto;
    background: var(--amarelo);
    border-radius: 20px;
    padding: 3px 9px;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ----- chips de categoria ----- */
.chips-linha {
    display: flex;
    gap: 8px;
    margin: 9px auto 0;
    max-width: 1200px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* sangra até a borda da tela pra deixar claro que a fila rola */
    padding: 2px 16px 2px 0;
    margin-right: -16px;
}

.chips-linha::-webkit-scrollbar { display: none; }

.chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 15px;
    border-radius: 20px;
    background: var(--branco);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.09);
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--cinza-escuro);
    text-decoration: none;
    white-space: nowrap;
    transition: transform .12s ease, background .15s ease;
}

.chip:active { transform: scale(0.94); }

.chip.ativo {
    background: var(--preto);
    color: var(--branco);
}

/* ----- rodapé da barra: contagem + ordenar ----- */
.busca-rodape {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1200px;
    margin: 9px auto 0;
}

.busca-resultado {
    font-size: 0.79rem;
    color: #6d6d6d;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.busca-resultado b { color: var(--preto); font-weight: 800; }

.busca-reset {
    margin-left: 6px;
    color: #6d6d6d;
    text-decoration: underline;
}

.ordenar-chip {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 13px;
    border-radius: 20px;
    background: var(--branco);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.09);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--preto);
    cursor: pointer;
}

.ordenar-chip:active { transform: scale(0.96); }
.ordenar-chip svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* o select cobre o chip inteiro e fica invisível: o toque abre o seletor
   nativo do sistema, mas quem aparece é o chip estilizado */
.ordenar-chip select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    border: 0;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.busca-vazio {
    grid-column: 1 / -1;
    text-align: center;
    padding: 44px 18px;
    color: var(--cinza-escuro);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* selo de nota do produto */
.nota-selo {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--cinza-claro);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--cinza-escuro);
}

.nota-selo .estrela { color: #f5a623; }

@media (max-width: 600px) {
    .busca-barra { top: 66px; padding: 9px 14px 8px; }
    .chips-linha { margin-right: -14px; padding-right: 14px; }
}

@media (min-width: 900px) {
    .busca-barra { padding: 14px 24px 12px; }
    .chips-linha { margin-right: 0; padding-right: 0; flex-wrap: wrap; overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
    .chip, .ordenar-chip, .busca-limpar, .busca-campo { transition: none; }
    .chip:active, .ordenar-chip:active, .busca-limpar:active { transform: none; }
}

/* Compartilhar produto */
.btn-compartilhar {
    position: absolute;
    top: 48px;
    right: 8px;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.15s, transform 0.15s;
}
.btn-compartilhar:hover { background: rgba(0,0,0,0.7); transform: scale(1.1); }
.btn-compartilhar svg, .btn-compartilhar-produto svg, .btn-compartilhar-modal svg {
    width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}
.btn-compartilhar-produto {
    background: none;
    border: 2px solid #ccc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}
.btn-compartilhar-produto:hover { border-color: #25d366; color: #128c4f; }
.btn-compartilhar-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 11px 14px;
    background: #fff;
    border: 2px solid var(--preto);
    border-radius: 10px;
    color: var(--preto);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.btn-compartilhar-modal:hover { background: var(--cinza-claro); }
.toast-compartilhar {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    background: var(--preto);
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: var(--sombra);
    z-index: 10000;
    transition: opacity 0.3s;
}
.toast-compartilhar.some { opacity: 0; }
