/* "X" de fechar no canto superior direito de todo modal do Bugaloop.
   Uso: <button type="button" class="modal-x" aria-label="Fechar" onclick="document.getElementById('ID_DO_BOTAO_QUE_FECHA').click()">svg</button>
   como filho direto da caixa do modal. */
:has(> .modal-x){ position: relative; }
.modal-x{
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f3f3;
  border: none;
  border-radius: 50%;
  color: #666;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.modal-x svg{ width: 15px; height: 15px; }
.modal-x:hover{ background: #fde8d4; color: #fc5f01; }
.crop-box > .modal-x,
.admin-crop-box > .modal-x{ background: #3a3a3a; color: #ccc; }
.crop-box > .modal-x:hover,
.admin-crop-box > .modal-x:hover{ background: #4a4a4a; color: #fc5f01; }

/* PADRÃO: cabeçalho fixo no topo do modal (título + X ficam visíveis ao rolar).
   Uso: <div class="modal-topo"> [X] <h2>Título</h2> ... </div> como 1º filho da caixa do modal
   (a caixa é a que tem overflow-y:auto). Se o padding da caixa não for 20px, defina --modal-pad nela. */
.modal-topo{
  position: sticky;
  top: calc(-1 * var(--modal-pad, 20px));
  z-index: 6;
  margin: calc(-1 * var(--modal-pad, 20px)) calc(-1 * var(--modal-pad, 20px)) 14px;
  padding: var(--modal-pad, 20px) calc(var(--modal-pad, 20px) + 36px) 12px var(--modal-pad, 20px);
  background: inherit;
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
