/* ===== BTRADE HEADER — Floating Glass ===== */

.bh-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.bh-header.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* ── Glass Background ── */
.bh-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  transition: all 0.4s ease;
  z-index: -1;
}

.bh-header.scrolled::before {
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(33, 150, 243, 0.08);
}

/* ── Inner Container ── */
.bh-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  height: 68px;
  display: flex;
  align-items: center;
  direction: ltr !important;
  gap: 0;
}

/* ===== LOGO — far left ===== */
.bh-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  order: 1;
  margin-right: auto;
}

.bh-logo-icon {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.bh-logo-text {
  height: 22px;
  width: auto;
  object-fit: contain;
}

/* ===== NAV — centered absolutely ===== */
.bh-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 36px;
  order: 2;
  pointer-events: auto;
}

.bh-link {
  position: relative;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--btrade-text-secondary, #8b8b9e);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.bh-link:hover { color: #ffffff; }

.bh-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--btrade-primary, #2196F3);
  box-shadow: 0 0 8px var(--btrade-primary, #2196F3);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bh-link:hover::after,
.bh-link.active::after {
  transform: translateX(-50%) scale(1);
}

/* ===== RIGHT SIDE — actions + lang ===== */
.bh-right {
  display: flex;
  align-items: center;
  gap: 10px;
  order: 3;
  margin-left: auto;
}

/* ===== ACTION BUTTONS ===== */
.bh-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bh-btn-ghost {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--btrade-text-secondary, #8b8b9e);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  background: transparent;
  white-space: nowrap;
}

.bh-btn-ghost:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.bh-btn-primary {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--btrade-primary, #2196F3), var(--btrade-primary-dark, #1976D2));
  box-shadow: 0 2px 12px rgba(33, 150, 243, 0.3);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.bh-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(33, 150, 243, 0.45);
}

/* ===== LANGUAGE SWITCHER ===== */
.bh-language-switcher {
  display: flex;
  align-items: center;
}

.bh-lang-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  color: #ffffff;
  text-decoration: none;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.bh-lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Flag image — clean circle */
.bh-flag-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.15);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.bh-lang-text {
  font-size: 13px;
  font-weight: 600;
}

/* ===== GLOW LINE ===== */
.bh-glow-line {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.bh-header.scrolled .bh-glow-line { opacity: 1; }

.bh-glow-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(33, 150, 243, 0.6), rgba(0, 188, 212, 0.4), transparent);
  animation: bh-glow-sweep 4s ease-in-out infinite;
}

@keyframes bh-glow-sweep {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* ===== HAMBURGER ===== */
.bh-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 10001;
  order: 4;
}

.bh-burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.bh-burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.bh-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.bh-burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== MOBILE OVERLAY ===== */
.bh-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.bh-overlay.open {
  opacity: 1;
  visibility: visible;
}

.bh-overlay-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  direction: ltr !important;
}

.bh-overlay-link {
  font-family: "Poppins", "Cairo", sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--btrade-text-secondary, #8b8b9e);
  text-decoration: none;
  transition: color 0.3s, transform 0.3s, opacity 0.3s;
  transform: translateY(20px);
  opacity: 0;
}

.bh-overlay.open .bh-overlay-link { transform: translateY(0); opacity: 1; }
.bh-overlay.open .bh-overlay-link:nth-child(1) { transition-delay: 0.1s; }
.bh-overlay.open .bh-overlay-link:nth-child(2) { transition-delay: 0.15s; }
.bh-overlay.open .bh-overlay-link:nth-child(3) { transition-delay: 0.2s; }
.bh-overlay.open .bh-overlay-link:nth-child(4) { transition-delay: 0.25s; }
.bh-overlay-link:hover { color: #ffffff; }

.bh-overlay-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease 0.3s;
}

.bh-overlay.open .bh-overlay-actions {
  opacity: 1;
  transform: translateY(0);
}

.bh-overlay-actions .bh-btn-primary { padding: 14px 40px; font-size: 16px; }
.bh-overlay-actions .bh-btn-ghost   { padding: 12px 36px; font-size: 15px; }

/* Mobile language link in overlay */
.bh-lang-switch {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 10px;
  padding-top: 15px !important;
  color: #ffffff !important;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .bh-inner { padding: 0 20px; height: 56px; }

  .bh-nav,
  .bh-actions { display: none; }

  .bh-language-switcher { display: none; }

  .bh-burger { display: flex; }

  .bh-logo-icon { height: 28px; }
  .bh-logo-text { height: 18px; }
}

@media (max-width: 480px) {
  .bh-inner { padding: 0 16px; }
  .bh-overlay-link { font-size: 24px; }
}