/* Componentes Achadinhos (classes ach-*). Os componentes React em components/ usam estas classes. */
@keyframes ach-girar { to { transform: rotate(360deg); } }
@keyframes ach-surgir { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Ícone (Lucide via máscara, herda currentColor) */
.ach-icone { display: inline-block; flex: none; background: currentColor; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }

/* Botão */
.ach-botao { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--altura-controle); padding: 0 18px; border-radius: var(--raio-pilula); border: 1px solid transparent; font: inherit; font-size: var(--texto-sm); font-weight: var(--peso-semibold); line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none; color: var(--texto); background: transparent; transition: background var(--transicao-rapida), color var(--transicao-rapida), border-color var(--transicao-rapida), transform var(--transicao-rapida), box-shadow var(--transicao-rapida); }
.ach-botao:hover { text-decoration: none; }
.ach-botao:active { transform: scale(0.98); }
.ach-botao:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ach-botao--primario { background: var(--destaque); color: var(--destaque-texto); }
.ach-botao--primario:hover:not(:disabled) { background: var(--destaque-hover); color: var(--destaque-texto); }
.ach-botao--primario:active:not(:disabled) { background: var(--destaque-ativo); }
.ach-botao--marca { background: var(--marca); color: var(--marca-texto); }
.ach-botao--marca:hover:not(:disabled) { background: var(--marca-hover); color: var(--marca-texto); }
.ach-botao--secundario { background: var(--superficie); border-color: var(--borda-forte); color: var(--texto); }
.ach-botao--secundario:hover:not(:disabled) { background: var(--superficie-3); color: var(--texto); }
.ach-botao--fantasma { color: var(--texto-suave); }
.ach-botao--fantasma:hover:not(:disabled) { background: var(--superficie-3); color: var(--texto); }
.ach-botao--perigo { background: var(--erro-fundo); color: var(--erro-texto); }
.ach-botao--perigo:hover:not(:disabled) { background: var(--erro); color: #fff; }
.ach-botao--pequeno { height: var(--altura-controle-sm); padding: 0 12px; font-size: var(--texto-xs); gap: 6px; }
.ach-botao--grande { height: var(--altura-controle-lg); padding: 0 24px; font-size: var(--texto-md); }
.ach-botao--largo { width: 100%; }
.ach-botao__spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ach-girar 0.7s linear infinite; }
.ach-botao-icone { padding: 0; width: var(--altura-controle); }
.ach-botao-icone.ach-botao--pequeno { width: var(--altura-controle-sm); }
.ach-botao-icone.ach-botao--grande { width: var(--altura-controle-lg); }

/* Campo / Seletor */
.ach-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ach-campo__rotulo { font-size: var(--texto-sm); font-weight: var(--peso-medio); color: var(--texto); }
.ach-campo__controle { position: relative; display: flex; align-items: center; gap: 8px; height: var(--altura-controle); padding: 0 12px; background: var(--superficie); border: 1px solid var(--borda-forte); border-radius: var(--raio-sm); color: var(--texto); transition: border-color var(--transicao-rapida), box-shadow var(--transicao-rapida); }
.ach-campo__controle:focus-within { border-color: var(--destaque); box-shadow: var(--anel-foco); }
.ach-campo--erro .ach-campo__controle { border-color: var(--erro); }
.ach-campo__controle input, .ach-campo__controle select { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-size: var(--texto-md); padding: 0; box-shadow: none; }
.ach-campo__controle input::placeholder { color: var(--texto-fraco); }
.ach-campo__controle select { appearance: none; -webkit-appearance: none; padding-right: 22px; cursor: pointer; }
.ach-campo__controle select option { color: var(--carvao); background: #fff; }
.ach-campo__seta { position: absolute; right: 12px; pointer-events: none; color: var(--texto-suave); }
.ach-campo__afixo { color: var(--texto-suave); font-family: var(--fonte-mono); font-size: var(--texto-sm); }
.ach-campo__ajuda { font-size: var(--texto-xs); color: var(--texto-suave); }
.ach-campo__erro { font-size: var(--texto-xs); color: var(--erro-texto); font-weight: var(--peso-medio); }

/* Caixa (checkbox) e Alternador (switch) */
.ach-caixa { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.ach-caixa input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--destaque); flex: none; cursor: pointer; }
.ach-caixa__texto { display: flex; flex-direction: column; gap: 2px; }
.ach-caixa__rotulo { font-size: var(--texto-md); color: var(--texto); line-height: 1.4; }
.ach-caixa__descricao { font-size: var(--texto-sm); color: var(--texto-suave); }
.ach-alternador { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.ach-alternador__trilho { position: relative; flex: none; width: 40px; height: 24px; margin-top: 1px; padding: 0; border: 0; border-radius: var(--raio-pilula); background: var(--borda-forte); cursor: pointer; transition: background var(--transicao-rapida); }
.ach-alternador__trilho:disabled { opacity: 0.5; cursor: not-allowed; }
.ach-alternador__bolinha { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sombra-1); transition: transform var(--transicao-rapida); }
.ach-alternador--ligado .ach-alternador__trilho { background: var(--destaque); }
.ach-alternador--ligado .ach-alternador__bolinha { transform: translateX(16px); }

/* Selo */
.ach-selo { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--raio-pilula); font-size: var(--texto-xs); font-weight: var(--peso-semibold); line-height: 1; white-space: nowrap; background: var(--superficie-3); color: var(--texto-suave); }
.ach-selo__ponto { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ach-selo--destaque { background: var(--destaque-suave); color: var(--link); }
.ach-selo--solido { background: var(--destaque); color: var(--destaque-texto); }
.ach-selo--marca { background: var(--marca-suave); color: var(--marca); }
.ach-selo--sucesso { background: var(--sucesso-fundo); color: var(--sucesso-texto); }
.ach-selo--alerta { background: var(--alerta-fundo); color: var(--alerta-texto); }
.ach-selo--erro { background: var(--erro-fundo); color: var(--erro-texto); }
.ach-selo--info { background: var(--info-fundo); color: var(--info-texto); }
.ach-selo--contorno { background: transparent; box-shadow: inset 0 0 0 1px var(--borda-forte); color: var(--texto-suave); }

/* Cartão */
.ach-cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio-lg); box-shadow: var(--sombra-1); display: flex; flex-direction: column; min-width: 0; }
.ach-cartao--preenchido { padding: 20px; gap: 16px; }
.ach-cartao__cabecalho { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ach-cartao__titulo { font-family: var(--fonte-display); font-size: var(--texto-md); font-weight: var(--peso-semibold); letter-spacing: var(--espacamento-titulo); }
.ach-cartao__descricao { font-size: var(--texto-sm); color: var(--texto-suave); margin-top: 2px; }
.ach-cartao__acoes { display: flex; gap: 8px; flex: none; }
.ach-cartao__rodape { border-top: 1px solid var(--borda); margin: 0 -20px -20px; padding: 14px 20px; font-size: var(--texto-sm); color: var(--texto-suave); display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Abas */
.ach-abas { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); overflow-x: auto; scrollbar-width: none; }
.ach-abas::-webkit-scrollbar { display: none; }
.ach-abas__aba { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: var(--texto-sm); font-weight: var(--peso-medio); color: var(--texto-suave); cursor: pointer; white-space: nowrap; transition: color var(--transicao-rapida), border-color var(--transicao-rapida); }
.ach-abas__aba:hover { color: var(--texto); }
.ach-abas__aba--ativa { color: var(--texto); border-bottom-color: var(--destaque); }
.ach-abas__contador { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--raio-pilula); background: var(--superficie-3); font-family: var(--fonte-mono); font-size: 11px; color: var(--texto-suave); }
.ach-abas__aba--ativa .ach-abas__contador { background: var(--destaque-suave); color: var(--link); }

/* Tabela */
.ach-tabela-envoltorio { overflow-x: auto; }
.ach-tabela { width: 100%; border-collapse: collapse; font-size: var(--texto-sm); }
.ach-tabela th { text-align: left; padding: 10px 12px; font-size: var(--texto-xs); font-weight: var(--peso-semibold); letter-spacing: var(--espacamento-rotulo); text-transform: uppercase; color: var(--texto-suave); border-bottom: 1px solid var(--borda); white-space: nowrap; }
.ach-tabela td { padding: 12px; border-bottom: 1px solid var(--borda); vertical-align: middle; color: var(--texto); }
.ach-tabela--compacta td { padding: 8px 12px; }
.ach-tabela tbody tr:last-child td { border-bottom: 0; }
.ach-tabela--clicavel tbody tr { cursor: pointer; }
.ach-tabela--clicavel tbody tr:hover td { background: var(--superficie-2); }
.ach-tabela .ach-tabela__direita { text-align: right; }
.ach-tabela .ach-tabela__num { text-align: right; font-family: var(--fonte-mono); font-variant-numeric: tabular-nums; }
.ach-tabela__vazio { padding: 32px 12px; text-align: center; color: var(--texto-suave); }

/* Nota da oferta */
.ach-nota { display: inline-flex; align-items: center; gap: 10px; }
.ach-nota__anel { --nota-cor: var(--nota-fraca); --nota-pct: 0; position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%; background: conic-gradient(var(--nota-cor) calc(var(--nota-pct) * 1%), var(--superficie-3) 0); display: grid; place-items: center; }
.ach-nota__anel::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--superficie); }
.ach-nota__valor { position: relative; font-family: var(--fonte-mono); font-weight: var(--peso-semibold); font-size: 15px; color: var(--texto); font-variant-numeric: tabular-nums; }
.ach-nota--pequeno .ach-nota__anel { width: 36px; height: 36px; } .ach-nota--pequeno .ach-nota__anel::before { inset: 4px; } .ach-nota--pequeno .ach-nota__valor { font-size: 12px; }
.ach-nota--grande .ach-nota__anel { width: 84px; height: 84px; } .ach-nota--grande .ach-nota__anel::before { inset: 8px; } .ach-nota--grande .ach-nota__valor { font-size: 28px; }
.ach-nota--nata .ach-nota__anel { --nota-cor: var(--nota-nata); }
.ach-nota--boa .ach-nota__anel { --nota-cor: var(--nota-boa); }
.ach-nota__faixa { display: flex; flex-direction: column; gap: 2px; }
.ach-nota__nome { font-size: var(--texto-sm); font-weight: var(--peso-semibold); }
.ach-nota--nata .ach-nota__nome { color: var(--link); } .ach-nota--boa .ach-nota__nome { color: var(--marca); } .ach-nota--fraca .ach-nota__nome { color: var(--texto-suave); }
.ach-nota__legenda { font-size: var(--texto-xs); color: var(--texto-suave); }

/* Cartão de oferta */
.ach-oferta { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; padding: 16px; background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio-lg); box-shadow: var(--sombra-1); transition: border-color var(--transicao-rapida), box-shadow var(--transicao-rapida); animation: ach-surgir var(--transicao-lenta) both; }
.ach-oferta:hover { border-color: var(--borda-forte); box-shadow: var(--sombra-2); }
.ach-oferta--selecionado { border-color: var(--destaque); box-shadow: 0 0 0 1px var(--destaque), var(--sombra-2); }
.ach-oferta__imagem { width: 96px; height: 96px; border-radius: var(--raio-sm); background: var(--superficie-3); display: grid; place-items: center; color: var(--texto-fraco); overflow: hidden; }
.ach-oferta__imagem img { width: 100%; height: 100%; object-fit: cover; }
.ach-oferta__corpo { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ach-oferta__loja { font-size: var(--texto-xs); color: var(--texto-suave); display: flex; align-items: center; gap: 6px; }
.ach-oferta__titulo { font-family: var(--fonte-display); font-size: var(--texto-md); font-weight: var(--peso-semibold); letter-spacing: var(--espacamento-titulo); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ach-oferta__precos { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ach-oferta__preco { font-family: var(--fonte-mono); font-size: var(--titulo-sm); font-weight: var(--peso-semibold); font-variant-numeric: tabular-nums; }
.ach-oferta__de { font-family: var(--fonte-mono); font-size: var(--texto-sm); color: var(--texto-fraco); text-decoration: line-through; }
.ach-oferta__selos { display: flex; flex-wrap: wrap; gap: 6px; }
.ach-oferta__motivos { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: var(--texto-sm); color: var(--texto-suave); }
.ach-oferta__motivos li { display: flex; gap: 8px; align-items: flex-start; }
.ach-oferta__motivos li .ach-icone { margin-top: 3px; color: var(--marca); }
.ach-oferta__lado { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ach-oferta__acoes { display: flex; gap: 8px; }
.ach-oferta--compacto { grid-template-columns: 56px minmax(0, 1fr) auto; padding: 12px; border-radius: var(--raio); }
.ach-oferta--compacto .ach-oferta__imagem { width: 56px; height: 56px; }
.ach-oferta--compacto .ach-oferta__titulo { font-size: var(--texto-sm); -webkit-line-clamp: 1; }
.ach-oferta--compacto .ach-oferta__preco { font-size: var(--texto-md); }
@media (max-width: 640px) { .ach-oferta { grid-template-columns: 72px minmax(0, 1fr); } .ach-oferta__lado { grid-column: 1 / -1; flex-direction: row; align-items: center; } }

/* Aviso */
.ach-aviso { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--raio-sm); border: 1px solid transparent; font-size: var(--texto-sm); line-height: 1.45; }
.ach-aviso__icone { flex: none; margin-top: 1px; }
.ach-aviso__corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ach-aviso__titulo { font-weight: var(--peso-semibold); }
.ach-aviso__fechar { flex: none; margin: -4px -6px -4px 0; width: 28px; height: 28px; border: 0; border-radius: var(--raio-xs); background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; opacity: 0.7; }
.ach-aviso__fechar:hover { opacity: 1; background: rgba(0,0,0,0.06); }
.ach-aviso--sucesso { background: var(--sucesso-fundo); color: var(--sucesso-texto); }
.ach-aviso--alerta { background: var(--alerta-fundo); color: var(--alerta-texto); }
.ach-aviso--erro { background: var(--erro-fundo); color: var(--erro-texto); }
.ach-aviso--info { background: var(--info-fundo); color: var(--info-texto); }

/* Dica (tooltip) */
.ach-dica { position: relative; display: inline-flex; }
.ach-dica__balao { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px); padding: 6px 10px; border-radius: var(--raio-xs); background: var(--carvao); color: #fff; font-size: var(--texto-xs); font-weight: var(--peso-medio); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity var(--transicao-rapida), transform var(--transicao-rapida); z-index: 20; }
.ach-dica__balao::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -4px; border: 4px solid transparent; border-top-color: var(--carvao); }
.ach-dica--baixo .ach-dica__balao { bottom: auto; top: calc(100% + 8px); transform: translate(-50%, -4px); }
.ach-dica--baixo .ach-dica__balao::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--carvao); }
.ach-dica:hover .ach-dica__balao, .ach-dica:focus-within .ach-dica__balao { opacity: 1; transform: translate(-50%, 0); }
[data-tema="escuro"] .ach-dica__balao { background: var(--areia-100); color: var(--carvao); } [data-tema="escuro"] .ach-dica__balao::after { border-top-color: var(--areia-100); } [data-tema="escuro"] .ach-dica--baixo .ach-dica__balao::after { border-top-color: transparent; border-bottom-color: var(--areia-100); }

/* Diálogo */
.ach-dialogo { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: var(--sobreposicao); animation: ach-surgir var(--transicao) both; }
.ach-dialogo__caixa { width: min(520px, 100%); max-height: 100%; overflow: auto; background: var(--superficie); border-radius: var(--raio-xl); box-shadow: var(--sombra-3); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.ach-dialogo__cabecalho { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ach-dialogo__titulo { font-family: var(--fonte-display); font-size: var(--titulo-sm); font-weight: var(--peso-semibold); letter-spacing: var(--espacamento-titulo); }
.ach-dialogo__descricao { font-size: var(--texto-sm); color: var(--texto-suave); margin-top: 4px; }
.ach-dialogo__acoes { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
