/* tc-select.css - CustomSelect (shared/custom-select.js) do kit: UMA definicao para os dois mundos (B3 C-B3 29/10/2026, achado B3-04).
   Antes: a estrutura + pele dos paineis moravam no tc-compat.css (escopo body.painel) e uma copia do site publico no tc-publico.css (escopo body.com-dock).
   Agora: ESTRUTURA sem escopo (so display/position/overflow/flex; contrato com o JS: .open .open-up .selected .disabled .placeholder .highlighted .cs-flutuante)
   e PELE (so por token) com escopo body:is(.painel, .com-dock) - mesma especificidade de antes (0,2,1), entao vence o CSS local igual a antes.
   Quem carrega: paineis /servicos e /estoque (depois do tc-compat) e o /auto-orcamento (depois do tc-publico). Quem NAO usa CustomSelect nao carrega.
   O que e so de um mundo fica no fim ou com :where(), com o escopo do mundo (altura minima da opcao do publico; barra de rolagem fina do painel).
   Mudou o menu = edite aqui; o CSS local so tem layout da pagina. */

/* ---- ESTRUTURA (sem escopo; igual nos dois mundos) ---- */
.custom-select { position: relative; width: 100%; }
.custom-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
.custom-select:focus, .custom-select-trigger:focus { outline: none; }
.custom-select-value { flex: 1 1 0%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.custom-select-arrow { width: 12px; height: 12px; transition: transform 0.2s, color 0.2s; flex-shrink: 0; }
.custom-select.open .custom-select-arrow { transform: rotate(180deg); }
.custom-select-dropdown { position: absolute; top: 100%; left: 0; right: 0; max-height: 0; overflow: hidden; opacity: 0; transition: opacity 0.18s, max-height 0.18s; z-index: var(--z-dropdown); }
.custom-select.open .custom-select-dropdown { max-height: 300px; overflow-y: auto; opacity: 1; }
/* lista aberta: o JS a move para o body e marca .cs-flutuante (+ .cs-acima); posicao e tamanho ficam inline, camada e visual aqui */
.custom-select-dropdown.cs-flutuante { z-index: var(--z-popover); } /* 1300: acima do toast (1200), como o 999999 inline de antes */
/* barra fina so nos paineis (o publico mantem a nativa); :where() zera a especificidade: continua perdendo para o tc-rolagem.css como antes */
:where(body:not(.com-dock)) .custom-select-dropdown::-webkit-scrollbar { width: 8px; }
:where(body:not(.com-dock)) .custom-select-dropdown::-webkit-scrollbar-track { background: transparent; }
:where(body:not(.com-dock)) .custom-select-dropdown::-webkit-scrollbar-thumb { background: var(--sup-4); border-radius: 999px; }
.custom-select-option { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; transition: background 0.15s, color 0.15s; }
.custom-select-option.selected::after { content: "✓"; margin-left: auto; font-weight: 700; }
.custom-select-option.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.custom-select-trigger, .custom-select-option { -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; }
@media (max-width: 768px) {
.custom-select { z-index: var(--z-dropdown); }
.custom-select.open .custom-select-dropdown { max-height: 280px; }
.custom-select-option { min-height: 48px; padding: 0.9rem 1rem; }
}

/* ---- PELE (por token; paineis = body.painel, site publico = body.com-dock): campo fechado = .campo select; lista = menu com superficie e sombra do kit ---- */
body:is(.painel, .com-dock) .custom-select-trigger {
    min-height: 46px;
    padding: 11px 14px;
    border: 0;
    border-radius: var(--r-md);
    background-color: var(--sup-2);
    color: var(--txt);
    font-family: var(--fonte);
    font-size: var(--fs-base);
    transition: background var(--dur-1), box-shadow var(--dur-1);
}
body:is(.painel, .com-dock) .custom-select-trigger:hover { background-color: var(--sup-3); }
body:is(.painel, .com-dock) .custom-select.open .custom-select-trigger,
body:is(.painel, .com-dock) .custom-select-trigger:focus {
    background-color: var(--sup-1);
    box-shadow: inset 0 0 0 2px var(--acc-ink);
    border-radius: var(--r-md);
}
body:is(.painel, .com-dock) .custom-select.open-up .custom-select-trigger { border-radius: var(--r-md); }
body:is(.painel, .com-dock) .custom-select-value.placeholder { color: var(--txt-4); }
body:is(.painel, .com-dock) .custom-select-arrow { color: var(--txt-3); }
body:is(.painel, .com-dock) .custom-select.open .custom-select-arrow { color: var(--acc-ink); }
/* a lista (movida para o body pelo custom-select.js) so tem geometria inline; o visual vem daqui, sem !important */
body:is(.painel, .com-dock) .custom-select-dropdown {
    margin: 6px 0;
    padding: 4px;
    border: 0;
    border-radius: var(--r-md);
    background: var(--sup-1);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: var(--sombra-3);
}
body:is(.painel, .com-dock) .custom-select-option {
    padding: 10px 12px;
    border-radius: var(--r-sm);
    color: var(--txt);
    font-weight: 600;
}
body:is(.painel, .com-dock) .custom-select-option:hover,
body:is(.painel, .com-dock) .custom-select-option.highlighted { background: var(--sup-2); color: var(--txt); }
body:is(.painel, .com-dock) .custom-select-option.selected { background: var(--acc-soft); color: var(--acc-ink); box-shadow: none; font-weight: 700; }
body:is(.painel, .com-dock) .custom-select-option.selected::after { color: var(--acc-ink); }
/* so do site publico: o menu tem altura minima de toque de 44 px em qualquer largura (o painel usa 48 px so no celular, na estrutura acima) */
body.com-dock .custom-select-option { min-height: 44px; }
