/* =========================================================
   🔹 DARK FLAT TOP HEADER BAR — Charcoal with Orange Accents
   ========================================================= */
.top-header-bar {
  position: relative;
  background-color: #1f2937; /* dark neutral gray */
  color: #f97316;
  border-bottom: 1px solid #374151;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  z-index: 300; /* must sit above main navbar */
  overflow: visible;
}

/* =========================================================
   🧭 Compact & Centered Layout for Top Header
   (supports .container OR .top-header-inner in your HTML)
   ========================================================= */
.top-header-bar > .container,
.top-header-bar > .top-header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.15rem 1rem;     /* compact height */
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow: visible;
}

/* contact info centered */
.top-header-bar .contact-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  text-align: center;
  width: 100%;
}

/* small icons = slimmer bar */
.top-header-bar img,
.icon-sm {
  width: 16px;
  height: 16px;
  filter: invert(54%) sepia(87%) saturate(4000%) hue-rotate(1deg)
    brightness(100%) contrast(97%);
  vertical-align: middle;
}

/* links */
.top-header-bar a {
  color: #f97316;
  font-weight: 500;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}
.top-header-bar a:hover { color: #fb923c; }

/* Desktop: keep centered info, language pill on right */
@media (min-width: 768px) {
  .lang-wrapper {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* =========================================================
   🌐 LANGUAGE TOGGLE — Right Aligned
   ========================================================= */
.lang-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  overflow: visible;
  z-index: 600;
}

#langToggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  color: #f97316;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}
#langToggle:hover { color: #fb923c; }
#langToggle img { width: 16px; height: 16px; }
#langToggle svg { color: inherit; }

/* =========================================================
   🌐 LANGUAGE DROPDOWN — Single Column, Alternating Rows
   ========================================================= */
#langMenu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;                 /* align to the pill’s right edge */
  left: auto;
  width: 9rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  z-index: 99999;          /* float above everything */
  overflow: hidden;
}

/* 🔧 CRITICAL: override global [data-lang]{display:none} from index.css */
#langMenu button[data-lang] {
  display: block !important;
}

#langMenu.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(2px) !important;
}

#langMenu button {
  border: none;
  background: transparent;
  font-size: 0.88rem;
  color: #374151;
  text-align: left;
  padding: 0.42rem 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
#langMenu button:nth-child(odd) { background-color: #f9fafb; }
#langMenu button:hover { background: #fff7ed; color: #ea580c; }

/* remove bullets if your HTML uses <ul><li> */
#langMenu, #langMenu ul, #langMenu li { list-style: none; margin: 0; padding: 0; }

/* subtle top fade */
#langMenu::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05), transparent);
  pointer-events: none;
}

/* =========================================================
   📱 MOBILE HEADER STACKING FIX
   ========================================================= */
@media (max-width: 767px) {
  .top-header-bar > .container,
  .top-header-bar > .top-header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
  }

  .top-header-bar .contact-info {
    flex-direction: column;
    gap: 0.15rem;
  }

  .lang-wrapper {
    align-self: flex-end;
    margin-right: 1rem;  /* pill on right in row 3 */
  }
}

/* =========================================================
   📱 MOBILE MENU ANIMATION
   ========================================================= */
#mobile-menu { transition: all 0.3s ease; z-index: 400 !important; }

/* =========================================================
   🟠 MOBILE MENU CTA ROW — Register + Login Side by Side
   ========================================================= */
.mobile-cta-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}
.mobile-cta-row a { flex: 1; text-align: center; }

/* =========================================================
   ✨ ACCESSIBILITY / FOCUS HIGHLIGHT & LOGIN HOVER
   ========================================================= */
#langToggle:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}
a[href="login.html"]:hover { background-color: #f97316 !important; color: #fff !important; }
a[href="login.html"]:active { background-color: #ea580c !important; }

/* =========================================================
   🎯 FIX — LANGUAGE PILL PERFECT VERTICAL ALIGNMENT
   ========================================================= */
@media (min-width: 768px) {
  .lang-wrapper {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-48%); /* slight upward correction */
  }

  #langToggle {
    line-height: 1;
    padding-top: 0.05rem;
    padding-bottom: 0.05rem;
  }

  /* ensure visible overflow if clipped by header container */
  .top-header-bar,
  .top-header-bar > .container,
  .lang-wrapper {
    overflow: visible !important;
  }
}

