/* JDServer-Webs v6.1 — modules/header/header.css
   - BrandTitle (grande) con Apple-ish vibes
   - Nav bajo el título, responsive sin romper
*/

#site-header {
  position: relative;
  z-index: 30; /* por si hay elementos con z-index altos debajo */
  backdrop-filter: blur(10px);
  background:
    radial-gradient(1200px 200px at 50% -40%, var(--brand-50, color-mix(in oklab, var(--brand, #10b981) 12%, transparent)), transparent 70%),
    linear-gradient(180deg, var(--brand-100, color-mix(in oklab, var(--brand, #10b981) 20%, transparent)), transparent 40%);
  box-shadow: var(--shadow-2);
  border-bottom: 1px solid var(--border);
}

/* ──────────────── Fila superior: logo + título + acciones ──────────────── */
.header-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  flex-wrap: wrap; /* permite bajar acciones si no cabe */
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  flex: 0 0 auto;
}

.brand-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title strong {
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: .1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-title span {
  color: var(--muted);
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ──────────────── Segunda fila: navegación ──────────────── */
.header-nav {
  border-top: 1px solid var(--border);
  padding: 10px 0 14px;
}

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav a {
  padding: .45rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg, var(--text));
  font-size: .92rem;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
  outline: none;
}

.nav a:hover {
  background: var(--brand-50, color-mix(in oklab, var(--brand, #10b981) 12%, transparent));
  border-color: var(--brand-200, color-mix(in oklab, var(--brand, #10b981) 30%, transparent));
}

.nav a:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand, #10b981) 30%, transparent);
}

.nav a.active {
  background: linear-gradient(180deg, var(--brand-accent, var(--brand, #10b981)), var(--brand, #10b981));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* ──────────────── Dropdowns accesibles con <details> ──────────────── */
.dropdown {
  position: relative;
}
.dropdown > summary {
  list-style: none;
  cursor: pointer;
  outline: none;
}
.dropdown > summary::-webkit-details-marker {
  display: none;
}
.dropdown > summary:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand, #10b981) 30%, transparent);
  border-radius: 10px;
}

.dropdown .menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  padding: 6px;
  min-width: 180px;
  z-index: 60; /* por encima del header */
}

.menu a,
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--fg, var(--text));
  padding: .55rem .65rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: .95rem;
  outline: none;
}

.menu a.active,
.menu button.active,
.menu a:hover,
.menu button:hover {
  background: rgba(0,0,0,.05);
}

.menu a:focus-visible,
.menu button:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand, #10b981) 30%, transparent);
}

@media (prefers-color-scheme: dark) {
  .menu a.active,
  .menu button.active,
  .menu a:hover,
  .menu button:hover {
    background: rgba(255,255,255,.06);
  }
}

/* ──────────────── Etiquetas pequeñas tipo “badge” ──────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .18rem .5rem;
  font-size: .78rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
}

/* ──────────────── Responsive tweaks ──────────────── */
@media (max-width: 880px) {
  .brand-logo { width: 40px; height: 40px; border-radius: 12px; }
  .brand-title strong { font-size: 1.1rem; }
  .brand-title span { font-size: .86rem; }
  .header-actions { gap: 6px; }
  .nav a { font-size: .9rem; padding: .42rem .62rem; }
}

@media (max-width: 520px) {
  .brand-logo { width: 36px; height: 36px; border-radius: 10px; }
  .brand-title strong { font-size: 1.02rem; }
  .brand-title span { font-size: .82rem; }
  .nav a { font-size: .86rem; }
}
