/* ============================================================================
   ell-drawer.css — Drawer lateral reutilizável (substitui modais centrais)

   API: window.Ello.drawer.open({ ... })  → vide ell-drawer.js

   Tamanhos:
     .ell-drawer--md   440px (default, detalhes)
     .ell-drawer--lg   640px (formulários longos)
     .ell-drawer--xl   860px (gestão com sub-abas, ex: Campanhas)

   Variantes:
     .ell-drawer--left   entra pela esquerda (raro)
     (default)           entra pela direita
   ============================================================================ */

.ell-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 900;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.ell-drawer-backdrop.is-open { opacity: 1; }

.ell-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 440px;
  /* Sprint C: max-width:100% em vez de 100vw — 100vw inclui scrollbar vertical
     em alguns browsers e causa overflow horizontal sutil. */
  max-width: 100%;
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  z-index: 901;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.08);
}
.ell-drawer.is-open { transform: translateX(0); }

.ell-drawer--md { width: 440px; }
.ell-drawer--lg { width: 640px; }
.ell-drawer--xl { width: 860px; }

/* ─── Header do drawer ───────────────────────────────────────── */

.ell-drawer__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--line-subtle);
  flex-shrink: 0;
}

.ell-drawer__label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.ell-drawer__title {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.ell-drawer__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.ell-drawer__subtitle {
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.5;
  margin: var(--space-1) 0 0;
}

.ell-drawer__close {
  background: transparent;
  border: 0;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.ell-drawer__close:hover {
  background: var(--bg-sunken);
  color: var(--text);
}

/* ─── Corpo scrollável ───────────────────────────────────────── */

.ell-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.ell-drawer__body--flush { padding: 0; }

/* ─── Footer com ações ───────────────────────────────────────── */

.ell-drawer__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--line-subtle);
  flex-shrink: 0;
  background: var(--bg-elev);
}
.ell-drawer__footer--between { justify-content: space-between; }

/* ─── Responsivo ─────────────────────────────────────────────── */

@media (max-width: 900px) {
  .ell-drawer--md,
  .ell-drawer--lg,
  .ell-drawer--xl { width: 100%; }
}

/* ─── Trava scroll do body quando drawer aberto ───────────── */

body.ell-drawer-open {
  overflow: hidden;
}
