/* Barra de afiliados: faixa escura acima do cabeçalho da loja, na cor da loja só na ação.
 * Ação na cor da loja (Compartilhar); selo COMISSÃO / COMISSÃO EXTRA. Painel ancorado no botão.
 * Escopo: .afb */
.afb { --afb-fundo: #1b1b1b; --afb-txt: #fff; --afb-azul: var(--ap-accent, #1e3370); --afb-fio: #e3e3e8; --afb-t3: #6e6e73;
  background: var(--afb-fundo); color: var(--afb-txt); font-family: var(--ap-body, system-ui, -apple-system, sans-serif); font-size: 14px; line-height: 1.3; position: relative; z-index: 1200; }
.afb *, .afb *::before, .afb *::after { box-sizing: border-box; }
.afb :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.afb-in { max-width: 1260px; margin: 0 auto; padding: 0 16px; min-height: 44px; display: flex; align-items: center; gap: 4px; }
.afb a { color: inherit; text-decoration: none; }
.afb svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.afb-marca { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; min-height: 44px; padding-right: 8px; }
.afb-marca svg { width: 22px; height: 22px; }
.afb-div { width: 1px; height: 18px; background: rgba(255,255,255,.55); margin: 0 14px 0 10px; }
.afb-lk { background: none; border: 0; color: inherit; font: inherit; font-weight: 500; cursor: pointer; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 6px; }
.afb-lk:hover { background: rgba(255,255,255,.08); }
.afb-lk svg { width: 12px; height: 12px; stroke-width: 1.8; }
.afb-esp { flex: 1; }
.afb-drop { position: relative; }
.afb-menu { position: absolute; left: 0; top: calc(100% + 2px); min-width: 230px; background: #fff; color: #1d1d1f; border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 6px 0; margin: 0; list-style: none; z-index: 5; }
.afb-menu[hidden] { display: none; }
.afb-menu a { display: flex; align-items: center; min-height: 44px; padding: 0 18px; font-size: 14px; }
.afb-menu a:hover, .afb-menu a:focus-visible { background: #f2f2f2; outline: none; }
.afb-sep { height: 1px; background: var(--afb-fio); margin: 6px 0; }

.afb-ganho { flex: none; display: inline-flex; align-items: stretch; font-size: 12px; font-weight: 700; letter-spacing: .02em; margin-right: 12px; border-radius: 3px; overflow: hidden; white-space: nowrap; }
.afb-ganho[hidden] { display: none; }
.afb-ganho span { padding: 3px 0; }
.afb-ganho--extra span { background: var(--ap-accent, #1e3370); color: #fff; padding: 3px 6px; }
.afb-ganho--extra i { font-style: italic; }
.afb-ganho--extra b { background: #fff; color: #000; padding: 3px 6px; }
.afb-share { background: var(--afb-azul); color: #fff; border: 0; border-radius: 6px; font: inherit; font-weight: 600; min-height: 32px; padding: 0 16px; cursor: pointer; }
.afb-share:hover { filter: brightness(1.08); }
.afb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Painel "Gerar link" */
.afb-painel { position: absolute; right: 0; top: calc(100% + 6px); width: 420px; max-width: calc(100vw - 24px); max-height: calc(100vh - 80px); overflow: auto;
  background: #fff; color: #1d1d1f; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.22); z-index: 6; }
.afb-painel[hidden] { display: none; }
.afb-painel :focus-visible { outline: 2px solid var(--afb-azul); outline-offset: 1px; }
.afb-pc { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.afb-pc header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.afb-pc h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.afb-x { width: 44px; height: 44px; margin: -10px -12px 0 0; border: 0; background: none; font-size: 22px; color: var(--afb-t3); cursor: pointer; border-radius: 8px; flex: none; }
.afb-resumo { margin: 0; background: #f5f5f5; border-radius: 6px; padding: 10px 12px; font-size: 13.5px; }
.afb-resumo small { color: var(--afb-t3); font-size: 12px; }
.afb-resumo--extra { background: #e3fbfb; }
.afb-campo { display: flex; flex-direction: column; gap: 6px; }
.afb-campo label { font-size: 13px; font-weight: 600; }
.afb-campo small { font-size: 12px; color: var(--afb-t3); }
.afb-campo select, .afb-nova input { min-height: 44px; border: 0; background: #f5f5f5; border-radius: 6px; padding: 0 12px; font: inherit; color: inherit; outline: none; width: 100%; }
.afb-copia { position: relative; }
.afb-copia input, .afb-copia textarea { width: 100%; min-height: 44px; border: 1px solid #bfbfbf; border-radius: 6px; padding: 0 52px 0 12px; font: inherit; color: inherit; background: #fff; outline: none; }
.afb-copia textarea { padding: 10px 52px 10px 12px; resize: none; line-height: 1.45; font-size: 13.5px; }
.afb-copia input:focus-visible, .afb-copia textarea:focus-visible { border-color: var(--afb-azul); outline: none; }
.afb-cp { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border: 0; background: #f0f0f0; border-radius: 6px; cursor: pointer; display: grid; place-items: center; color: #3a3a3a; }
.afb-cp svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.afb-nova { display: flex; gap: 8px; }
.afb-nova[hidden] { display: none; }
.afb-bt { min-height: 44px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--afb-azul); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.afb-redes { display: flex; gap: 6px; flex-wrap: wrap; }
.afb-redes a, .afb-redes button { border: 0; font-family: inherit; cursor: pointer; flex: 1; min-width: 72px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 13px; font-weight: 600; color: #fff; background: var(--c); }
.afb-pe { margin: 0; font-size: 13px; color: var(--afb-t3); }
.afb-pe a { color: var(--afb-azul); }
.afb-aviso { margin: 0; background: #fff4e0; color: #8a5300; border-radius: 6px; padding: 10px 12px; font-size: 13px; }
.afb-erro { color: #b42318; margin: 0; }
.afb-mudo { color: var(--afb-t3); margin: 0; }

@media (max-width: 860px) {
  .afb-in { padding: 0 8px; gap: 0; }
  .afb-marca span, .afb-so-largo, .afb-div { display: none; }
  .afb-marca { padding: 0 8px; }
  .afb-lk { padding: 0 8px; font-size: 13px; }
  .afb-ganho { margin-right: 6px; }
  .afb-ganho--extra i { display: none; }
  .afb-share { padding: 0 12px; }
  .afb-drop--dir { position: static; }
  .afb-painel { position: fixed; left: 8px; right: 8px; top: 52px; width: auto; max-width: none; max-height: calc(100vh - 64px); }
  .afb-menu { position: fixed; left: 8px; right: 8px; top: 48px; }
}
@media (prefers-reduced-motion: no-preference) { .afb-lk, .afb-share { transition: background-color .15s, filter .15s; } }

.afb-so-estreito, .afb-curto { display: none; }
@media (max-width: 860px) { .afb-so-estreito { display: block; } .afb-curto { display: inline; } }
/* Produto sem compra direta: sem comissão + parecidos à venda */
.afb-ganho--sem span { background: #ececf0; color: #424245; padding: 3px 8px; border-radius: 4px; font-weight: 700; }
.afb-alt { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.afb-alt a { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; border: 1px solid var(--afb-fio); color: inherit; text-decoration: none; min-height: 44px; }
.afb-alt a:hover { background: #f5f5f7; }
.afb-alt img { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: #f5f5f7; flex: none; }
.afb-alt span { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.afb-alt span > b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.afb-alt small { color: var(--afb-t3, #6e6e73); }
.afb-alt small b { color: #12694a; }
