/* components.css — Componentes reutilizables (header, botones, cards, badges, etc.) */

/* ── Header ── */
.header { border-bottom: 1px solid var(--borde); background: var(--fondo); position: sticky; top: 0; z-index: 50; }
.header .contenedor { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 800; color: var(--tinta); }
.brand .logo { height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.brand .logo img { height: 100%; width: auto; display: block; }
.brand .ai { color: var(--azul); }
.nav { display: flex; gap: 30px; }
.nav a { color: var(--texto); font-weight: 600; font-size: .95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.activo { color: var(--azul); border-bottom-color: var(--azul); }
.header-right { display: flex; gap: 12px; }

/* ── Select pill (país / idioma) ── */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--borde); border-radius: var(--r-btn);
  padding: 9px 14px; background: var(--fondo); font-size: .9rem; font-weight: 600;
  color: var(--tinta); cursor: pointer; min-width: 130px; justify-content: space-between;
}
.pill .izq { display: flex; align-items: center; gap: 8px; }
.pill .flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; display: block; }
.pill svg { width: 16px; height: 16px; color: var(--muted); }
.pill select { border: none; background: transparent; font: inherit; color: inherit;
  cursor: pointer; outline: none; -webkit-appearance: none; appearance: none; }

/* ── Botones ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--fuente); font-weight: 700; font-size: 1rem; cursor: pointer;
  border: none; border-radius: var(--r-btn); padding: 14px 28px; transition: .15s; }
.btn svg { width: 20px; height: 20px; }
.btn-primario { background: linear-gradient(135deg, var(--azul), var(--azul-osc)); color: #fff;
  box-shadow: var(--sombra-azul); }
.btn-primario:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(37,99,235,.42); }
.btn-grande { padding: 20px 56px; font-size: 1.15rem; letter-spacing: .02em; }
.upper { text-transform: uppercase; letter-spacing: .02em; }
.btn-secundario { background: #fff; color: var(--azul); border: 1px solid var(--azul-claro); box-shadow: var(--sombra); }
.btn-secundario:hover { background: var(--superficie); }

/* ── Dropdown propio (con bandera en cada opción) ── */
.dd { position: relative; }
.dd-trigger { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--borde); border-radius: 12px; padding: 9px 12px; background: #fff;
  cursor: pointer; font-family: var(--fuente); font-weight: 600; font-size: .9rem; color: var(--tinta);
  min-width: 150px; }
.dd-cur { display: inline-flex; align-items: center; gap: 8px; overflow: hidden; }
.dd-cur .dd-lab { white-space: nowrap; }
.dd-flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; flex-shrink: 0; display: block; }
.dd-trigger svg.gl { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.dd-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; flex-shrink: 0; }
.dd.abierto .dd-chev { transform: rotate(180deg); }
.dd-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 100%; background: #fff;
  border: 1px solid var(--borde); border-radius: 12px; box-shadow: var(--sombra-md); padding: 6px;
  z-index: 200; display: none; max-height: 300px; overflow: auto; }
.dd.abierto .dd-menu { display: block; }
.dd-item { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: none;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font-family: var(--fuente); font-size: .9rem;
  font-weight: 600; color: var(--texto); text-align: left; white-space: nowrap; }
.dd-item:hover { background: var(--superficie); }

/* ── Cards ── */
.card { background: var(--fondo); border: 1px solid var(--borde); border-radius: var(--r-card);
  padding: 24px; box-shadow: var(--sombra); }

/* ── Aviso (banner ámbar, p. ej. documento truncado) ── */
.aviso-banner { background: var(--ambar-bg); color: var(--ambar-tx); border: 1px solid var(--ambar);
  border-radius: var(--r-card); padding: 12px 16px; margin-bottom: 16px;
  font-size: .88rem; font-weight: 600; }

/* ── Badges ── */
.badge { display: inline-block; border-radius: var(--r-pill); padding: 4px 12px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.badge-green { background: var(--verde-bg); color: var(--verde-tx); }
.badge-amber { background: var(--ambar-bg); color: var(--ambar-tx); }
.badge-red   { background: var(--rojo-bg);  color: var(--rojo-tx); }
.badge-blue  { background: var(--azul-bg);  color: var(--azul-tx); }

/* ── Barras de dimensión ── */
.dim { display: flex; align-items: center; gap: 12px; margin: 9px 0; }
.dim .lab { flex: 1; font-size: .88rem; color: var(--texto); }
.dim .track { width: 130px; height: 8px; background: var(--superficie-2); border-radius: 6px;
  display: inline-block; overflow: hidden; flex-shrink: 0; }
.dim .fill { display: block; height: 8px; border-radius: 6px; min-width: 3px; }
.dim .pct { width: 44px; text-align: right; font-weight: 700; font-size: .84rem; color: var(--tinta); }

/* ── Footer ── */
.footer { border-top: 1px solid var(--borde); margin-top: 64px; }
.footer .contenedor { display: flex; justify-content: space-between; align-items: center;
  height: 64px; color: var(--faint); font-size: .85rem; }
.footer .item { display: flex; align-items: center; gap: 8px; }
.footer svg { width: 16px; height: 16px; }

@media (max-width: 768px) {
  .nav { display: none; }
  .header .contenedor { height: 64px; }
  .header-right { gap: 8px; }
  .pill { min-width: auto; padding: 8px 10px; font-size: .82rem; }
}
