/* =============================================================
   VEDESCOL — NAVBAR PROFESSIONAL (Dropdown Edition)
   Appended to style.css — overrides previous nav rules
   ============================================================= */

/* ─── CSS VARIABLES ──────────────────────────────────────────── */
:root {
  --nav-bg:        rgba(255, 255, 255, 0.98);
  --nav-text:      #1A2B4A;
  --nav-text-sub:  #475569;
  --nav-accent:    #003087;
  --nav-active-bg: linear-gradient(135deg, #1A4FA8 0%, #003087 100%);
  --nav-hover-bg:  rgba(26, 79, 168, 0.08);
  --nav-height:    68px;
  --nav-radius:    7px;
  --nav-fs:        0.88rem;
  --nav-fw:        500;
  --nav-drop-shadow: 0 8px 32px rgba(26, 43, 74, 0.14);
}

/* ─── BASE NAVBAR ────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(26, 43, 74, 0.09);
  box-shadow: 0 2px 12px rgba(26, 43, 74, 0.07);
  transition: box-shadow 0.3s ease, padding 0.3s ease;
  height: var(--nav-height);
  display: flex;
  align-items: center;
}
.navbar.scrolled {
  box-shadow: 0 4px 24px rgba(26, 43, 74, 0.14);
  background: rgba(255, 255, 255, 0.99);
}

.nav-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

/* ─── LOGO ───────────────────────────────────────────────────── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-emblem {
  width: 46px; height: 46px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(26, 79, 168, 0.2);
  box-shadow: 0 0 10px rgba(26, 79, 168, 0.12);
  background: #fff;
  flex-shrink: 0;
}
.logo-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.logo-main {
  font-family: 'Oswald', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  letter-spacing: 0.5px;
}
.logo-sub {
  font-size: 0.5rem;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  max-width: 180px;
  line-height: 1.2;
}
.flag-yellow { color: #c8952a; }
.flag-blue   { color: #1A4FA8; }
.flag-red    { color: #c8102e; }

/* ─── DESKTOP MENU ───────────────────────────────────────────── */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0; padding: 0;
  flex-wrap: nowrap;
}

.nav-item {
  position: relative;
}

.nav-link,
.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.75rem;
  font-size: var(--nav-fs);
  font-weight: var(--nav-fw);
  font-family: 'Inter', sans-serif;
  color: var(--nav-text);
  border-radius: var(--nav-radius);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1.3;
}
.nav-link:hover,
.nav-dropdown-btn:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-accent);
}
.nav-link.active,
.nav-dropdown-btn.active {
  background: var(--nav-active-bg);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(26, 79, 168, 0.25);
}
.nav-link i,
.nav-dropdown-btn i {
  font-size: 0.85em;
  flex-shrink: 0;
}
.nav-arrow {
  font-size: 0.65em !important;
  transition: transform 0.25s ease;
}
.nav-item.open .nav-arrow {
  transform: rotate(180deg);
}

/* Apóyanos CTA */
.nav-btn-donar {
  background: #c8102e !important;
  color: #fff !important;
  font-weight: 600 !important;
  border-radius: 20px !important;
  padding: 0.45rem 1rem !important;
  box-shadow: 0 3px 10px rgba(200, 16, 46, 0.28);
}
.nav-btn-donar:hover {
  background: #a00d25 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

/* ─── DROPDOWNS ──────────────────────────────────────────────── */
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 230px;
  background: #fff;
  border: 1px solid rgba(26, 43, 74, 0.1);
  border-radius: 10px;
  box-shadow: var(--nav-drop-shadow);
  list-style: none;
  padding: 0.5rem;
  z-index: 1100;
  animation: dropIn 0.18s ease forwards;
}
.nav-item.open .nav-dropdown {
  display: block;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-dropdown li a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  color: #334155;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown li a:hover {
  background: rgba(26, 79, 168, 0.07);
  color: var(--nav-accent);
}
.nav-dropdown li a i {
  width: 14px;
  text-align: center;
  color: #6b7f9e;
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* ─── BODY PADDING (for fixed navbar) ───────────────────────── */
body {
  padding-top: var(--nav-height) !important;
}

/* ─── RESPONSIVE BREAKPOINTS ─────────────────────────────────── */
@media (max-width: 1200px) {
  .logo-sub { display: none; }
  .nav-link, .nav-dropdown-btn { font-size: 0.82rem; padding: 0.4rem 0.6rem; }
}

@media (max-width: 1250px) {
  body { padding-top: var(--nav-height, 68px) !important; }

  /* El encabezado actual no utiliza un menú móvil separado.
     Mantener la navegación principal visible y desplazable evita
     que desaparezca en pantallas estrechas. */
  .nav-container {
    overflow: hidden;
  }

  .nav-menu {
    display: flex !important;
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.05rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: nowrap;
  }

  .nav-menu::-webkit-scrollbar {
    display: none;
  }

  .nav-menu > li {
    flex: 0 0 auto;
  }
}

@media (max-width: 600px) {
  .logo-main { font-size: 1rem; }
  .logo-emblem { width: 38px; height: 38px; }
}

@media (max-width: 380px) {
  .logo-main { font-size: 0.88rem; }
  .logo-emblem { width: 34px; height: 34px; }
  .nav-container { padding: 0 0.75rem; }
}


/* Fixes for header wrapping and vertical text */
.nav-menu li a {
    white-space: nowrap;
}
.nav-btn-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}
.nav-btn-wrapper a {
    white-space: nowrap !important;
    display: inline-flex;
    align-items: center;
}
.btn-primary, .nav-btn-donar {
    white-space: nowrap !important;
}


/* CSS PATCH FOR DROPDOWNS WRITTEN IN header.js */
.nav-item-dropdown {
    position: relative;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid rgba(0, 48, 135, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    z-index: 9999;
}
.nav-item-dropdown:hover .dropdown-menu {
    display: block;
}
.dropdown-menu li a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: #334155;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.dropdown-menu li a:hover {
    background: #f1f5f9;
    color: #003087;
}

/* WCAG AA — Active nav links on white navbar */
.nav-link.active,
.nav-dropdown-btn.active {
    color: #1A4FA8 !important;
    font-weight: 700;
}
.navbar {
    background: #ffffff;
}
.nav-link,
.nav-dropdown-btn {
    color: #1A2B4A;
}
.nav-link:hover,
.nav-dropdown-btn:hover {
    color: #1A4FA8;
}
