/* ============================================================
   Traveronto — navbar.css
   Default = SOLID white (every page, from first load).
   .tr-nav--hero = transparent overlay on the homepage hero ONLY,
   turning solid + fixed on scroll.
   ============================================================ */

.tr-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  width: 100%;
  background: var(--white);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 6px 24px rgba(0, 0, 0, 0.05);
  transition: background var(--transition), box-shadow var(--transition);
}
/* Solid navbar: deepen shadow on scroll */
.tr-nav:not(.tr-nav--hero).scrolled {
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08), 0 8px 32px rgba(0, 0, 0, 0.10);
}

/* HERO variant: overlay the dark hero image, transparent until scrolled */
.tr-nav--hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030; /* explicit — ensures burger stays clickable above hero content */
  background: transparent;
  box-shadow: none;
}
.tr-nav--hero.scrolled {
  position: fixed;
  background: var(--white);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 6px 24px rgba(0, 0, 0, 0.05);
}

.tr-nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

/* ---------- Logo ---------- */
.tr-logo {
  font-weight: 800;
  font-size: clamp(20px, 4vw, 26px);
  letter-spacing: -0.03em;
  color: var(--primary);
  white-space: nowrap;
}
.tr-logo:hover { color: var(--primary-dark); }
.tr-logo .dot { color: var(--primary); }
/* white logo only on transparent hero */
.tr-nav--hero:not(.scrolled) .tr-logo { color: var(--white); }

/* ---------- Center links ---------- */
.tr-nav__links {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}
.tr-nav__links a {
  display: block;
  padding: 6px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--dark);
  transition: color 0.18s ease, background 0.18s ease;
  position: relative;
}
.tr-nav__links a:hover { color: var(--primary); background: transparent; }

/* Active underline dot */
.tr-nav__links a.active { color: var(--primary); }
.tr-nav__links a.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* transparent hero: white links */
.tr-nav--hero:not(.scrolled) .tr-nav__links a { color: rgba(255, 255, 255, 0.88); }
.tr-nav--hero:not(.scrolled) .tr-nav__links a:hover { color: #fff; background: transparent; }
.tr-nav--hero:not(.scrolled) .tr-nav__links a.active { color: #fff; }
.tr-nav--hero:not(.scrolled) .tr-nav__links a.active::after { background: var(--primary); }

/* ---------- Right cluster ---------- */
.tr-nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tr-select {
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  max-width: 92px;
}
.tr-nav--hero:not(.scrolled) .tr-select {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.tr-nav--hero:not(.scrolled) .tr-select option { color: #1a1a2e; }

.tr-nav__actions .btn-nav { padding: 8px 20px; font-size: 13.5px; border-radius: 7px; font-weight: 700; letter-spacing: 0.01em; }
/* outline login button stays readable on transparent hero */
.tr-nav--hero:not(.scrolled) .btn-nav.btn-tr-outline { color: #fff; border-color: rgba(255,255,255,0.8); }
.tr-nav--hero:not(.scrolled) .btn-nav.btn-tr-outline:hover { background: #fff; color: var(--dark); }

/* ---------- Hamburger ---------- */
.tr-burger {
  display: none;
  border: none;
  background: transparent;
  font-size: 26px;
  color: var(--dark);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.tr-nav--hero:not(.scrolled) .tr-burger { color: #fff; }

/* ---------- Offcanvas ---------- */
.tr-offcanvas { max-width: 86vw; }
.tr-offcanvas .offcanvas-header { border-bottom: 1px solid var(--border); }
.tr-offcanvas .tr-logo { color: var(--primary); }
.tr-offcanvas .offcanvas-body { display: flex; flex-direction: column; gap: 4px; }
.tr-offcanvas .offcanvas-body a.mlink {
  padding: 12px 8px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--dark);
  border-bottom: 1px solid var(--border);
}
.tr-offcanvas .offcanvas-body a.mlink:hover { background: var(--light); color: var(--primary); }
.tr-offcanvas .offcanvas-body a.mlink.active { color: var(--primary); }
.tr-offcanvas .m-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.tr-offcanvas .m-selects { display: flex; gap: 10px; margin-top: 18px; }
.tr-offcanvas .m-selects .tr-select { flex: 1; max-width: none; }

@media (max-width: 1199px) {
  .tr-nav__links { display: none; }
  .tr-nav__actions .desktop-only { display: none !important; }
  .tr-burger { display: block; }
  /* Push actions (burger) to the far right when nav links are hidden */
  .tr-nav__actions { margin-left: auto; }
}

/* ==========================================================
   Override mytravel app.css global .header-main-menu li rules
   (border-right divider + forced padding on <a>)
   ========================================================== */
.tr-nav__links .header-main-menu li,
.tr-mobile-nav .header-main-menu li {
  border-right: none !important;
  margin: 0 !important;
}
.tr-nav__links .header-main-menu li a {
  padding: 8px 13px !important;
}
.tr-mobile-nav .header-main-menu li a {
  padding: 12px 8px !important;
}

/* ==========================================================
   Generated menu inside .tr-nav__links
   generate_menu('primary') outputs <ul class="main-menu ...">
   ========================================================== */
.tr-nav__links { /* already flex; make the generated <ul> fill it */ }
.tr-nav__links ul.main-menu {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tr-nav__links ul.main-menu > li { position: relative; }
.tr-nav__links ul.main-menu > li > a {
  display: block;
  padding: 6px 16px !important;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--dark);
  transition: color 0.18s ease, background 0.18s ease;
  white-space: nowrap;
  background: transparent;
  position: relative;
}
.tr-nav__links ul.main-menu > li > a:hover {
  color: var(--primary) !important;
  background: rgba(231, 78, 53, 0.08) !important;
}
.tr-nav__links ul.main-menu > li.active > a {
  color: var(--primary) !important;
  background: rgba(231, 78, 53, 0.08) !important;
}
/* active underline */
.tr-nav__links ul.main-menu > li.active > a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}
/* transparent hero */
.tr-nav--hero:not(.scrolled) .tr-nav__links ul.main-menu > li > a { color: rgba(255,255,255,0.88) !important; background: transparent !important; }
.tr-nav--hero:not(.scrolled) .tr-nav__links ul.main-menu > li > a:hover { color: #fff !important; background: rgba(255,255,255,0.12) !important; }
.tr-nav--hero:not(.scrolled) .tr-nav__links ul.main-menu > li.active > a { color: #fff !important; background: rgba(255,255,255,0.12) !important; }
.tr-nav--hero:not(.scrolled) .tr-nav__links ul.main-menu > li.active > a::after { background: var(--primary); }

/* Sub-menus (depth-1) */
.tr-nav__links ul.main-menu > li ul.children-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  list-style: none;
  padding: 6px 0;
  z-index: 1050;
}
.tr-nav__links ul.main-menu > li:hover ul.children-menu { display: block; }
.tr-nav__links ul.main-menu > li ul.children-menu a {
  display: block;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dark);
}
.tr-nav__links ul.main-menu > li ul.children-menu a:hover { color: var(--primary); background: var(--light); }

/* Mobile nav uses the same generated ul */
.tr-mobile-nav ul.main-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tr-mobile-nav ul.main-menu > li > a {
  display: block;
  padding: 12px 8px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--dark);
  border-bottom: 1px solid var(--border);
}
.tr-mobile-nav ul.main-menu > li > a:hover { background: var(--light); color: var(--primary); }
.tr-mobile-nav ul.main-menu > li ul.children-menu {
  list-style: none;
  padding: 0 0 0 16px;
}
.tr-mobile-nav ul.main-menu > li ul.children-menu a {
  display: block;
  padding: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ==========================================================
   Logo image inside .tr-logo
   ========================================================== */
.tr-logo-img { max-height: 44px; width: auto; vertical-align: middle; }

/* ==========================================================
   User dropdown (desktop)
   Bootstrap 4's .dropdown-menu handles positioning;
   these add Traveronto-specific look.
   ========================================================== */
.tr-user-dropdown { position: relative; }
.tr-user-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
  transition: background var(--transition);
  white-space: nowrap;
}
.tr-user-toggle:hover { background: rgba(231,78,53,0.08); color: var(--primary); }
.tr-nav--hero:not(.scrolled) .tr-user-toggle { color: #fff; }

.tr-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(231,78,53,0.3);
}
.tr-avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.tr-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.tr-user-menu { min-width: 220px; border-radius: var(--radius-sm); border: 1px solid var(--border); box-shadow: var(--shadow); }
.tr-user-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dark);
}
.tr-user-menu .dropdown-item:hover { color: var(--primary); background: rgba(231,78,53,0.06); }
.tr-user-menu .dropdown-item i { font-size: 15px; color: var(--text-muted); }

/* ==========================================================
   Mobile user section
   ========================================================== */
.tr-mobile-user__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.tr-mobile-user__name { font-weight: 600; font-size: 15px; }
.tr-mobile-user__links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tr-mobile-user__links li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dark);
  border-bottom: 1px solid var(--border);
}
.tr-mobile-user__links li a:hover { color: var(--primary); }
.tr-mobile-user__links li a i { font-size: 15px; color: var(--text-muted); }

/* Currency/language switcher wrapper in desktop nav */
.tr-switcher { display: flex; align-items: center; }

/* ── Switcher button (currency & language) ──────────────────────────
   Used in both desktop .tr-nav__actions and mobile .m-selects
   ────────────────────────────────────────────────────────────────── */
.tr-switcher-wrap { position: relative; }

.tr-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  line-height: 1.4;
}
.tr-switcher-btn:focus { outline: none; }
.tr-switcher-btn:hover {
  background: rgba(231, 78, 53, 0.08);
  border-color: var(--primary);
  color: var(--primary);
}

/* On transparent hero: white outline */
.tr-nav--hero:not(.scrolled) .tr-switcher-btn {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
}
.tr-nav--hero:not(.scrolled) .tr-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.8);
}

.tr-switcher-caret {
  font-size: 11px;
  opacity: 0.7;
  transition: transform var(--transition);
}
.tr-switcher-btn[aria-expanded="true"] .tr-switcher-caret {
  transform: rotate(180deg);
}

/* Hide Bootstrap's default caret from dropdown-toggle */
.tr-switcher-btn.dropdown-toggle::after { display: none; }

.tr-switcher-menu {
  min-width: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 4px 0;
}
.tr-switcher-menu .dropdown-item {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tr-switcher-menu .dropdown-item:hover {
  background: rgba(231, 78, 53, 0.06);
  color: var(--primary);
}

/* ==========================================================
   Offcanvas (Bootstrap 4 compatible — replaces BS5 offcanvas)
   Toggle class: .show
   ========================================================== */
.tr-offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 90vw;
  height: 100%;
  background: var(--white);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1055;
  overflow-y: auto;
  box-shadow: -4px 0 32px rgba(0,0,0,0.12);
}
.tr-offcanvas.show { transform: translateX(0); }

.tr-offcanvas-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  transition: opacity 0.3s ease;
}
.tr-offcanvas-backdrop.show { display: block; }

.tr-offcanvas .offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.tr-offcanvas .offcanvas-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tr-btn-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.tr-btn-close:hover { color: var(--dark); background: var(--light); }
