/* ==========================================================================
   BM English School - Floating capsule header
   ========================================================================== */

.header,
.header.scrolled {
  top: 14px;
  left: 50%;
  width: min(1240px, calc(100% - 24px));
  padding: 0 !important;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 32px -14px rgba(255, 90, 0, 0.35),
    0 2px 8px rgba(15, 23, 42, 0.05);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, box-shadow 0.3s ease;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 90, 0, 0.14);
}

/* Smart hide: slides away while scrolling down, comes back when scrolling up */
.header.header-hidden {
  transform: translate(-50%, calc(-100% - 24px));
}

.header .nav-container {
  max-width: none;
  padding: 0.45rem 0.5rem 0.45rem 0.6rem !important;
  gap: 0.75rem;
}

/* Logo */
.header .brand-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border-width: 2px;
}

.header .logo-text { font-size: 1.05rem; }

/* Nav links: pills with a sliding orange indicator */
.header .nav-links {
  position: relative;
  gap: 0.15rem !important;
  padding: 0.3rem;
  border-radius: 9999px;
  background: rgba(255, 90, 0, 0.06);
}

.header .nav-link {
  position: relative;
  z-index: 1;
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #475569;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.header .nav-link:hover { color: #FF5A00; }

.header .nav-link.active { color: #FFFFFF; }

.nav-indicator {
  position: absolute;
  top: 0.3rem;
  left: 0;
  height: calc(100% - 0.6rem);
  width: 0;
  border-radius: 9999px;
  background: linear-gradient(135deg, #FF5A00, #FF8A00);
  box-shadow: 0 6px 16px -4px rgba(255, 90, 0, 0.6);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), width 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
}

/* Right side */
.header .nav-actions { gap: 0.4rem; }

.header .lang-btn {
  border-radius: 9999px;
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

.header .social-icon-btn {
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.header .social-icon-btn:hover {
  background: #FF5A00;
  border-color: #FF5A00;
  color: #FFFFFF;
}

.nav-cta {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem 0.65rem 1.15rem;
  border-radius: 9999px;
  background: #0F172A;
  color: #FFFFFF !important;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav-cta .material-symbols-outlined {
  font-size: 1.05rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FF5A00;
  transition: transform 0.3s ease;
}

.nav-cta:hover {
  background: #FF5A00;
  box-shadow: 0 10px 24px -8px rgba(255, 90, 0, 0.7);
}

.nav-cta:hover .material-symbols-outlined {
  background: #FFFFFF;
  color: #FF5A00;
  transform: translateX(2px) rotate(-45deg);
}

.header .mobile-menu-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0F172A;
  color: #FFFFFF;
}

.header .mobile-menu-btn .material-symbols-outlined { font-size: 1.4rem; }

/* Breakpoints: keep it on one line */
@media (min-width: 640px) {
  .nav-cta { display: inline-flex; }
}

@media (max-width: 1199px) {
  .header .social-icon-btn { display: none; }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .header .nav-link { padding: 0.5rem 0.65rem; font-size: 0.78rem; }
  .header .logo-text { display: none; }
}

@media (max-width: 480px) {
  .header,
  .header.scrolled { top: 10px; width: calc(100% - 16px); }
  .header .logo-text { font-size: 0.95rem; }
}

/* Layout fixes: logo never shrinks under the links; burger only below desktop */
.header .logo-link { flex-shrink: 0; }
.header .nav-links { flex-shrink: 1; min-width: 0; }
.header .nav-actions { flex-shrink: 0; }
@media (min-width: 1024px) { .header .mobile-menu-btn { display: none; } }

/* Small phones: everything must fit inside the capsule */
@media (max-width: 480px) {
  .header .nav-container { padding: 0.35rem 0.4rem 0.35rem 0.45rem !important; gap: 0.4rem; }
  .header .logo-link { gap: 0.5rem; min-width: 0; flex-shrink: 1; }
  .header .brand-logo-img { width: 36px; height: 36px; }
  .header .logo-text { font-size: 0.92rem; }
  .header .nav-actions { gap: 0.3rem; }
  .header .lang-btn { padding: 0.4rem 0.55rem; }
  .header .mobile-menu-btn { width: 38px; height: 38px; }
}

@media (max-width: 360px) {
  .header .logo-text span { display: none; }
}
