/* ================================================================
   NAVBAR.CSS — Elite Egypt Tours
   Brand Identity 2025: Navy #0A2340 + Teal #0FB1A2 + Cairo font.

   Sections:
     1. Custom tokens
     2. Root header / sticky wrapper
     3. Inner layout
     4. Logo
     5. Desktop nav links + active indicator
     6. Right-side actions
     7. Language switcher pill
     8. CTA "Book Now" button
     9. Hamburger → ✕ animation
    10. Mobile menu (slide-down panel)
    11. Scroll-margin for sections
    12. RTL overrides
    13. Responsive breakpoints
   ================================================================ */


/* ================================================================
   1. CUSTOM TOKENS
   ================================================================ */
:root {
  --nav-h:            72px;
  --nav-bg:           rgba(10, 35, 64, 0.35);    /* slight tint at top — readable on any bg */
  --nav-bg-scrolled:  rgba(10, 35, 64, 0.97);    /* solid navy on scroll */
  --nav-blur:         blur(18px);
  --nav-border:       rgba(15, 177, 162, 0.22);
  --nav-shadow:       0 4px 40px rgba(10, 35, 64, 0.35);

  --nav-text:         rgba(255, 255, 255, 0.80);
  --nav-text-hover:   #FFFFFF;
  --nav-text-active:  #0FB1A2;
  --nav-active-bar:   #0FB1A2;

  --nav-teal:         #0FB1A2;
  --nav-teal-light:   #3FC4B7;
  --nav-navy:         #0A2340;

  --nav-ease:         250ms ease;
  --nav-ease-spring:  380ms cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ================================================================
   2. ROOT HEADER / STICKY WRAPPER
   ================================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--nav-h);

  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(15, 177, 162, 0.08);

  transition:
    background      var(--nav-ease),
    backdrop-filter var(--nav-ease),
    border-color    var(--nav-ease),
    box-shadow      var(--nav-ease);
}

.navbar.scrolled {
  background:         var(--nav-bg-scrolled);
  backdrop-filter:    var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
  border-bottom-color: var(--nav-border);
  box-shadow:         var(--nav-shadow);
}


/* ================================================================
   3. INNER LAYOUT
   ================================================================ */
.navbar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
  gap: 1.5rem;
}


/* ================================================================
   4. LOGO
   ================================================================ */
.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity var(--nav-ease), transform var(--nav-ease-spring);
}

.nav-logo:hover {
  opacity: 0.90;
  transform: scale(1.03);
}

/* Transparent PNG logo — bright & clear on dark navbar */
.nav-logo-img {
  height: 56px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  object-position: left center;
  display: block;
  /* Brightness boost + teal glow to stand out on dark background */
  filter:
    brightness(1.25)
    contrast(1.1)
    drop-shadow(0 0 10px rgba(15,177,162,0.55))
    drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  transition: filter 0.3s ease;
}

.nav-logo:hover .nav-logo-img {
  filter:
    brightness(1.4)
    contrast(1.15)
    drop-shadow(0 0 16px rgba(15,177,162,0.8))
    drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

@media (max-width: 400px) {
  .nav-logo-img {
    height: 44px;
    max-width: 150px;
  }
}


/* ================================================================
   5. DESKTOP NAV LINKS + ACTIVE INDICATOR
   ================================================================ */
.nav-links-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-links-wrap ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.10rem;
}

.nav-link {
  position: relative;
  display: block;
  padding: 0.45rem 0.85rem;
  color: var(--nav-text);
  text-decoration: none;
  font-family: 'Cairo', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 8px;
  transition: color var(--nav-ease), background var(--nav-ease);
}

/* Teal underline bar */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: calc(100% - 1.6rem);
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--nav-active-bar) 30%,
    var(--nav-teal-light) 70%,
    transparent
  );
  border-radius: 2px;
  transition: transform var(--nav-ease-spring);
  transform-origin: center;
}

.nav-link:hover {
  color: var(--nav-text-hover);
  background: rgba(15, 177, 162, 0.10);
}

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

.nav-link.active {
  color: var(--nav-text-active);
}


/* ================================================================
   6. RIGHT-SIDE ACTIONS
   ================================================================ */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}


/* ================================================================
   7. LANGUAGE SWITCHER — pill container
   ================================================================ */
.lang-switcher {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Cairo', sans-serif;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color var(--nav-ease), background var(--nav-ease), box-shadow var(--nav-ease);
  white-space: nowrap;
  line-height: 1;
}

.lang-btn .lang-flag {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-block;
}

.lang-btn:hover {
  color: rgba(255, 255, 255, 0.90);
  background: rgba(15, 177, 162, 0.15);
}

/* Active language — teal pill */
.lang-btn.active {
  background: linear-gradient(135deg, var(--nav-teal), var(--nav-teal-light));
  color: var(--nav-navy);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(15, 177, 162, 0.40);
}

.lang-btn.active:hover {
  background: linear-gradient(135deg, var(--nav-teal-light), var(--nav-teal));
}


/* ================================================================
   8. CTA "BOOK NOW" BUTTON
   ================================================================ */
.btn-book-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.52rem 1.35rem;
  background: linear-gradient(135deg, var(--nav-teal), var(--nav-teal-light));
  color: var(--nav-navy);
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(15, 177, 162, 0.35);
  transition: transform var(--nav-ease), box-shadow var(--nav-ease), background var(--nav-ease);
}

/* Shimmer sweep */
.btn-book-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.40), transparent);
  transform: skewX(-18deg);
  animation: nav-shimmer 3.5s ease-in-out infinite 0.8s;
  pointer-events: none;
}

@keyframes nav-shimmer {
  0%        { left: -80%; opacity: 0; }
  8%        { opacity: 1; }
  52%       { left: 130%; opacity: 1; }
  53%, 100% { left: 130%; opacity: 0; }
}

.btn-book-nav:hover {
  background: linear-gradient(135deg, var(--nav-teal-light), var(--nav-teal));
  box-shadow: 0 6px 28px rgba(15, 177, 162, 0.55);
  transform: translateY(-2px) scale(1.03);
}

.btn-book-nav:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 3px 14px rgba(15, 177, 162, 0.35);
}


/* ================================================================
   9. HAMBURGER BUTTON → ✕ ANIMATION
   ================================================================ */
.hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  gap: 5px;
  padding: 0;
  flex-shrink: 0;
  transition: background var(--nav-ease), border-color var(--nav-ease);
}

.hamburger:hover {
  background: rgba(15, 177, 162, 0.14);
  border-color: rgba(15, 177, 162, 0.38);
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 2px;
  transition:
    transform   340ms cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity     220ms ease,
    width       220ms ease;
  transform-origin: center;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ================================================================
   10. MOBILE MENU — slide-down panel
   ================================================================ */
.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 899;

  background: rgba(10, 35, 64, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(15, 177, 162, 0.20);

  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition:
    max-height 420ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility  10ms linear 420ms;
}

.mobile-menu.open {
  max-height: 680px;
  visibility: visible;
  transition:
    max-height 420ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility  0ms linear 0ms;
}

.mobile-menu-inner {
  padding: 1.25rem clamp(1.25rem, 6vw, 2rem) 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-link {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  border-left: 2px solid transparent;
  transition: color var(--nav-ease), background var(--nav-ease),
              border-color var(--nav-ease), padding-left var(--nav-ease);
}

.mobile-link:hover,
.mobile-link.active {
  color: var(--nav-teal);
  background: rgba(15, 177, 162, 0.09);
  border-left-color: var(--nav-teal);
  padding-left: 1.4rem;
}

.mobile-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 0.75rem 0 0.5rem;
  border: none;
}

.mobile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.mobile-lang {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.mobile-lang .lang-btn {
  padding: 5px 10px;
  font-size: 0.78rem;
  border-radius: 8px;
}

.mobile-footer .btn-book-nav {
  padding: 0.6rem 1.6rem;
  font-size: 0.88rem;
}


/* ================================================================
   11. SCROLL-MARGIN FOR SECTIONS
   ================================================================ */
section[id],
[id="home"] {
  scroll-margin-top: var(--nav-h);
}


/* ================================================================
   12. RTL OVERRIDES
   ================================================================ */
[dir="rtl"] .nav-link::after {
  left: auto;
  right: 50%;
  transform: translateX(50%) scaleX(0);
}

[dir="rtl"] .nav-link:hover::after,
[dir="rtl"] .nav-link.active::after {
  transform: translateX(50%) scaleX(1);
}

[dir="rtl"] .mobile-link {
  border-left: none;
  border-right: 2px solid transparent;
  padding-left: 1rem;
  padding-right: 1rem;
}

[dir="rtl"] .mobile-link:hover,
[dir="rtl"] .mobile-link.active {
  border-right-color: var(--nav-teal);
  padding-right: 1.4rem;
  padding-left: 1rem;
}

[dir="rtl"] .nav-logo {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-actions {
  flex-direction: row-reverse;
}


/* ================================================================
   13. RESPONSIVE BREAKPOINTS
   ================================================================ */

@media (max-width: 1100px) {
  .lang-btn .lang-code {
    display: none;
  }
  .lang-btn {
    padding: 4px 7px;
  }
}

@media (max-width: 900px) {
  .nav-links-wrap {
    display: none;
  }
  .nav-actions .btn-book-nav {
    display: none;
  }
  .hamburger {
    display: flex;
  }
}

@media (max-width: 400px) {
  .nav-logo-text span {
    display: none;
  }
  .nav-logo-text strong {
    font-size: 0.92rem;
  }
  /* Show lang switcher on small screens — compact version */
  .lang-switcher {
    display: flex !important;
    padding: 2px;
    gap: 1px;
  }
  .lang-btn {
    padding: 3px 5px;
    font-size: 0.65rem;
  }
  .lang-btn .lang-flag {
    font-size: 0.80rem;
  }
  /* Hide text code on very small screens, show only flags */
  .lang-btn .lang-code {
    display: none;
  }
}

@media (max-width: 360px) {
  .navbar-inner { gap: 0.5rem; }
  .nav-logo-img { height: 38px !important; }
  .nav-actions   { gap: 4px; }
}

/* Mobile menu: full width on very small screens */
@media (max-width: 480px) {
  .mobile-menu {
    padding: 16px 0;
  }
  .mobile-link {
    font-size: 0.95rem;
    padding: 11px 20px;
  }
}


/* ================================================================
   ANDROID MOBILE NAVBAR FIX
   Added: 2026-05-01
   Fix 1: Lang switcher always visible on all mobile sizes
   Fix 2: Compact nav-actions on small screens
   Fix 3: Ensure btn-book-nav visible in mobile menu
================================================================ */

/* Ensure lang switcher NEVER disappears on mobile */
@media (max-width: 900px) {
  /* Keep lang switcher visible in navbar on mobile */
  .nav-actions .lang-switcher {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Compact lang buttons on mobile */
  .nav-actions .lang-btn {
    padding: 3px 6px;
    font-size: 0.68rem;
    gap: 3px;
  }

  /* Hide text labels on mobile, keep flags only */
  .nav-actions .lang-btn .lang-code {
    display: none;
  }

  /* Compact lang switcher container */
  .nav-actions .lang-switcher {
    padding: 2px;
    gap: 1px;
  }
}

/* Very small screens: still show flags */
@media (max-width: 360px) {
  .nav-actions .lang-switcher {
    display: flex !important;
    padding: 1px;
    gap: 0px;
  }
  .nav-actions .lang-btn {
    padding: 2px 4px;
    font-size: 0.60rem;
  }
  .nav-actions .lang-btn .lang-flag {
    font-size: 0.72rem;
  }
}