/* =====================================================================
   Travlix design layer (Batch B). Shared polish for the B2C header,
   footer and Flight/Hotel/Bus/Holiday/Visa service tabs.
   Loaded by template/tl_head_assets.php AFTER every theme stylesheet and
   BEFORE the agency's own custom_css (DB), so agency colours always win.
   Colours come only from the existing agency variables
   (--topbar-*, --header-*, --tts-buttton-*, --footer-Bg). The Travlix
   palette below is used only where the agency has not set a value.
   Variant hooks on <body>: .tl-h-<header> .tl-f-<footer> .tl-s-<search>
   Legacy variant 5 (header5/footer5/search5, Bootstrap 3 + external
   devflyway CSS) is deliberately excluded from the structural rules.
   ===================================================================== */

/* ---------- 1. Tokens + Travlix fallback palette ---------- */
:root {
  /* Fallbacks for the agency variables. custom.css used to ship #b01b07 here;
     an agency's custom_css (printed after this file) overrides any of them. */
  --topbar-bg: #5B3DF5;
  --topbar-txt-color: #ffffff;
  --header-bg: #ffffff;
  --header-txt-color: #1F2937;
  --tts-buttton-bg: #5B3DF5;
  --tts-buttton-bg1: #12B8A6;
  --tts-buttton-txt: #ffffff;
  --tts-buttton-txt1: #ffffff;
  --footer-Bg: #ffffff;

  /* Travlix design tokens (internal; agencies may override in custom_css) */
  --tl-primary: var(--tts-buttton-bg);
  --tl-primary-txt: var(--tts-buttton-txt);
  --tl-secondary: var(--tts-buttton-bg1);
  --tl-teal: #12B8A6;
  --tl-coral: #FF7A59;
  --tl-ink: #1F2937;
  --tl-muted: #6B7280;
  --tl-line: #E5E7EB;
  --tl-soft: #F6F7FB;
  --tl-radius: 12px;
  --tl-radius-sm: 8px;
  --tl-shadow: 0 8px 28px rgba(17, 24, 39, .10);
  --tl-shadow-sm: 0 2px 10px rgba(17, 24, 39, .06);
  --tl-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --tl-tap: 44px;
}

/* ---------- 2. Header: all Bootstrap-5 variants (header, header1..4) ---------- */
body.tl-portal:not(.tl-h-header5) #topbar,
body.tl-portal:not(.tl-h-header5) .topbar {
  font-family: var(--tl-font);
  font-size: 13px;
  min-height: 36px;
  background: var(--topbar-bg);
  color: var(--topbar-txt-color);
}
body.tl-portal:not(.tl-h-header5) .topbar a,
body.tl-portal:not(.tl-h-header5) .topbar i { color: var(--topbar-txt-color); }
body.tl-portal:not(.tl-h-header5) .topbar .social-links a { opacity: .9; transition: opacity .2s; }
body.tl-portal:not(.tl-h-header5) .topbar .social-links a:hover { opacity: 1; }

body.tl-portal:not(.tl-h-header5) .navbar,
body.tl-portal:not(.tl-h-header5) .navbar .nav-link,
body.tl-portal:not(.tl-h-header5) .navbar .dropdown-menu,
body.tl-portal:not(.tl-h-header5) .offcanvas,
body.tl-portal:not(.tl-h-header5) .offcanvassiderbar {
  font-family: var(--tl-font);
}

/* logo: consistent size, never stretched */
body.tl-portal:not(.tl-h-header5) .navbar-brand img,
body.tl-portal:not(.tl-h-header5) #logo img,
body.tl-portal:not(.tl-h-header5) .offcanvas-logo img {
  width: auto;
  max-width: 220px;
  max-height: 52px;
  object-fit: contain;
}

/* sticky header elevation */
body.tl-portal .home-header.sticky-top,
body.tl-portal .home-header.fixed-top,
body.tl-portal #header.header-with-alt { box-shadow: var(--tl-shadow-sm); }

/* nav links: same rhythm, focus ring, active indicator in the agency colour */
body.tl-portal:not(.tl-h-header5) .navbar-nav .nav-link {
  font-weight: 600;
  letter-spacing: .1px;
  border-radius: var(--tl-radius-sm);
  transition: color .2s, background-color .2s, box-shadow .2s;
}
body.tl-portal:not(.tl-h-header5) .navbar-nav .nav-link:focus-visible,
body.tl-portal .search_tabs a:focus-visible,
body.tl-portal .navbar-toggler:focus-visible {
  outline: 3px solid var(--tl-primary);
  outline-offset: 2px;
  box-shadow: none;
}
@media (min-width: 992px) {
  body.tl-portal:not(.tl-h-header5):not(.tl-h-header1) .navbar-list .nav-link.active {
    color: var(--tl-primary);
    box-shadow: inset 0 -3px 0 var(--tl-primary);
    border-radius: 0;
  }
  body.tl-portal.tl-h-header1 .navbar-list .nav-link.active { box-shadow: inset 0 -3px 0 currentColor; border-radius: 0; }
}

@media (min-width: 1281px) {
  body.tl-portal:not(.tl-h-header5) .navbar-list .nav-link { font-size: 14.5px; }
}
@media (min-width: 992px) and (max-width: 1280px) {
  body.tl-portal:not(.tl-h-header5) .navbar-list .nav-link { font-size: 13px; }
}

/* dropdowns + holiday megamenu */
body.tl-portal:not(.tl-h-header5) .navbar .dropdown-menu {
  border: 1px solid var(--tl-line);
  border-radius: var(--tl-radius);
  box-shadow: var(--tl-shadow);
  padding: 10px;
}
body.tl-portal:not(.tl-h-header5) .navbar .dropdown-menu .dropdown-item { border-radius: var(--tl-radius-sm); padding: 8px 12px; }
body.tl-portal:not(.tl-h-header5) .navbar .dropdown-menu .dropdown-item:hover,
body.tl-portal:not(.tl-h-header5) .navbar .dropdown-menu .dropdown-link:hover .dropdown-list { background: var(--tl-soft); }
body.tl-portal:not(.tl-h-header5) .megamenu .title { font-weight: 700; color: var(--tl-ink); }
body.tl-portal:not(.tl-h-header5) .megamenu a { color: var(--tl-muted); }
body.tl-portal:not(.tl-h-header5) .megamenu a:hover { color: var(--tl-primary); }

/* login / signup buttons use the agency button colour */
body.tl-portal .navbar .dropdown-menu-header .btn-secondary,
body.tl-portal .tl-btn,
body.tl-portal .offcanvassiderbar .loginbtn {
  background: var(--tl-primary);
  border-color: var(--tl-primary);
  color: var(--tl-primary-txt);
  border-radius: var(--tl-radius-sm);
  font-weight: 600;
}

/* hamburger: 44px tap target in the agency colour */
body.tl-portal:not(.tl-h-header5) .navbar-toggler {
  width: var(--tl-tap);
  height: var(--tl-tap);
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--tl-radius);
  background: var(--tl-primary);
  color: var(--tl-primary-txt);
  font-size: 18px;
  line-height: 1;
}
body.tl-portal:not(.tl-h-header5) .navbar-toggler i { color: inherit; }
body.tl-portal.tl-h-header1 #header .navbar-toggler,
body.tl-portal.tl-h-header1 #header.header-with-alt .navbar-toggler { color: var(--tl-primary-txt); }
@media (max-width: 991.98px) {
  body.tl-portal:not(.tl-h-header5) .navbar-toggler { display: inline-flex; }
}
/* header2 always uses the offcanvas toggler */
body.tl-portal.tl-h-header2 .offcanvassiderbar .navbar-toggler { display: inline-flex; }

/* ---------- 3. Mobile menu (<992px) ----------
   header/header1: the collapse becomes a white card under the bar.
   header3/header4: keep their own full-screen slide-in drawer at <=600px
   (header3.css/header4.css). The card style only applies at 601-991px. */
@media (max-width: 991.98px) {
  body.tl-portal:is(.tl-h-header, .tl-h-header1) .navbar-expand-lg .navbar-collapse {
    background: #fff;
    border: 1px solid var(--tl-line);
    border-radius: var(--tl-radius);
    box-shadow: var(--tl-shadow);
    margin-top: 10px;
    padding: 8px;
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.tl-portal:not(.tl-h-header5):not(.tl-h-header2) .navbar-expand-lg .navbar-collapse .nav-link {
    color: var(--tl-ink);
    min-height: var(--tl-tap);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    text-align: left;
  }
  body.tl-portal:not(.tl-h-header5):not(.tl-h-header2) .navbar-expand-lg .navbar-collapse .nav-link.active {
    color: var(--tl-primary);
    background: var(--tl-soft);
  }
  body.tl-portal:not(.tl-h-header5):not(.tl-h-header2) .navbar-expand-lg .navbar-collapse .nav-item + .nav-item { border-top: 1px solid var(--tl-line); }
  body.tl-portal:not(.tl-h-header5):not(.tl-h-header2) .navbar-expand-lg .navbar-collapse .dropdown-menu {
    position: static;
    float: none;
    box-shadow: none;
    border: 0;
    background: var(--tl-soft);
    margin: 0 0 6px;
    max-height: 50vh;
    overflow-y: auto;
  }
  body.tl-portal:not(.tl-h-header5):not(.tl-h-header2) .navbar-expand-lg .navbar-collapse .megamenu .row > [class*="col-"] { width: 100%; }
  /* login/signup becomes a full-width button */
  body.tl-portal:not(.tl-h-header5):not(.tl-h-header2) .navbar-expand-lg .navbar-collapse .dropdown-right > .nav-link {
    justify-content: center;
    background: var(--tl-primary);
    color: var(--tl-primary-txt);
    border-radius: var(--tl-radius-sm);
    margin-top: 6px;
  }
  /* compact topbar: centred, wraps instead of overflowing */
  body.tl-portal:not(.tl-h-header5) .topbar .contact-info { flex-wrap: wrap; justify-content: center; gap: 2px 14px; }
  body.tl-portal:not(.tl-h-header5) .topbar .contact-info i.ms-4 { margin-left: 0 !important; }
  body.tl-portal:not(.tl-h-header5) .navbar-brand img,
  body.tl-portal:not(.tl-h-header5) #logo img { max-height: 42px; max-width: 170px; }
}
@media (min-width: 601px) and (max-width: 991.98px) {
  body.tl-portal:is(.tl-h-header3, .tl-h-header4) .navbar-expand-lg .navbar-collapse {
    background: #fff;
    border: 1px solid var(--tl-line);
    border-radius: var(--tl-radius);
    box-shadow: var(--tl-shadow);
    margin-top: 10px;
    padding: 8px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }
}
@media (max-width: 600px) {
  body.tl-portal:is(.tl-h-header3, .tl-h-header4) .navbar-expand-lg .navbar-collapse.show { box-shadow: var(--tl-shadow); }
}
@media (max-width: 400px) {
  body.tl-portal:not(.tl-h-header5) .topbar { font-size: 12px; }
  body.tl-portal:not(.tl-h-header5) .topbar .contact-info a { word-break: break-all; }
}

/* header2 offcanvas panel */
body.tl-portal.tl-h-header2 .offcanvas { max-width: 86vw; border-left: 0; box-shadow: var(--tl-shadow); }
body.tl-portal.tl-h-header2 .offcanvas .nav-link { min-height: var(--tl-tap); display: flex; align-items: center; color: var(--tl-ink); }
body.tl-portal.tl-h-header2 .offcanvas .nav-link.active { color: var(--tl-primary); }
@media (max-width: 575.98px) {
  body.tl-portal.tl-h-header2 .offcanvassiderbar .loginbtn { font-size: 13px; padding: 8px 10px; white-space: nowrap; }
}

/* ---------- 4. Service tabs (Flight / Hotel / Bus / Holidays / Visa + custom links) ---------- */
body.tl-portal .search_tabs.tl-service-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 12px 6px 8px;
  margin-left: 0;
  margin-right: 0;
  list-style: none;
  justify-content: flex-start;
  font-family: var(--tl-font);
}
body.tl-portal .search_tabs.tl-service-tabs::-webkit-scrollbar { display: none; }
/* centred when it fits, scrollable from the first tab when it does not */
body.tl-portal .search_tabs.tl-service-tabs > li:first-child { margin-left: auto; }
body.tl-portal .search_tabs.tl-service-tabs > li:last-child { margin-right: auto; }
body.tl-portal .search_tabs.tl-service-tabs > li {
  float: none;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  list-style: none;
  scroll-snap-align: start;
  border: 0;
  background: transparent;
}
body.tl-portal .search_tabs.tl-service-tabs > li > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 88px;
  min-height: 68px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  border-radius: var(--tl-radius);
  background: #fff;
  color: var(--tl-ink);
  border: 1px solid var(--tl-line);
  box-shadow: var(--tl-shadow-sm);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, color .18s, background-color .18s, border-color .18s;
}
body.tl-portal .search_tabs.tl-service-tabs > li > a > span { display: flex; flex-direction: column; align-items: center; gap: 6px; }
body.tl-portal .search_tabs.tl-service-tabs > li > a i { font-size: 19px; margin: 0; display: block; color: inherit; }
body.tl-portal .search_tabs.tl-service-tabs > li > a:hover {
  color: var(--tl-primary);
  border-color: var(--tl-primary);
  transform: translateY(-2px);
  box-shadow: var(--tl-shadow);
}
/* active tab: search..search4 mark the <li>, search1 marks the <a> (class "current") */
body.tl-portal .search_tabs.tl-service-tabs > li.current > a,
body.tl-portal .search_tabs.tl-service-tabs > li > a.current {
  background: var(--tl-primary);
  border-color: var(--tl-primary);
  color: var(--tl-primary-txt);
  box-shadow: 0 8px 20px rgba(17, 24, 39, .18);
}
body.tl-portal .search_tabs.tl-service-tabs > li.current::after,
body.tl-portal .search_tabs.tl-service-tabs > li.current::before { display: none; }
/* custom agency links: same tile, subtle "external" cue */
body.tl-portal .search_tabs.tl-service-tabs > li.tl-custom-tab > a { border-style: dashed; }

@media (max-width: 575.98px) {
  /* 5 services fit side by side at 390px. Extra agency links scroll horizontally */
  body.tl-portal .search_tabs.tl-service-tabs { gap: 6px; padding: 10px 2px 6px; }
  body.tl-portal .search_tabs.tl-service-tabs > li { flex: 1 0 58px; }
  body.tl-portal .search_tabs.tl-service-tabs > li:first-child,
  body.tl-portal .search_tabs.tl-service-tabs > li:last-child { margin-left: 0; margin-right: 0; }
  body.tl-portal .search_tabs.tl-service-tabs > li > a { min-width: 0; width: 100%; min-height: 58px; padding: 8px 4px; font-size: 12px; gap: 4px; }
  body.tl-portal .search_tabs.tl-service-tabs > li > a i { font-size: 16px; }
}

/* hero above the search form: keep it a banner, not a full screen, on every device */
body.tl-portal .hero-banner .carousel-item { max-height: 560px; }
body.tl-portal .hero-banner .carousel-item img { width: 100%; max-height: 560px; object-fit: cover; }
@media (max-width: 575.98px) {
  body.tl-portal .hero-banner,
  body.tl-portal .hero-banner .carousel-item { min-height: 240px; }
  body.tl-portal .hero-banner .carousel-item img { max-height: 280px; }
}

/* ---------- 5. Footer: all Bootstrap-5 variants (footer, footer1..4) ---------- */
body.tl-portal:not(.tl-f-footer5) footer,
body.tl-portal:not(.tl-f-footer5) .footer_newsletter { font-family: var(--tl-font); }
body.tl-portal:not(.tl-f-footer5) footer h4,
body.tl-portal:not(.tl-f-footer5) footer h3 { font-weight: 700; letter-spacing: .2px; }
body.tl-portal:not(.tl-f-footer5) footer ul { padding-left: 0; list-style: none; }
body.tl-portal:not(.tl-f-footer5) footer .footer-links li,
body.tl-portal:not(.tl-f-footer5) footer .footer-widget li { margin: 0 0 8px; line-height: 1.4; }
body.tl-portal:not(.tl-f-footer5) footer .footer-links a,
body.tl-portal:not(.tl-f-footer5) footer .footer-widget a { transition: opacity .2s, padding-left .2s; }
body.tl-portal:not(.tl-f-footer5) footer .footer-links a:hover,
body.tl-portal:not(.tl-f-footer5) footer .footer-widget a:hover { opacity: .85; text-decoration: underline; text-underline-offset: 3px; }
body.tl-portal:not(.tl-f-footer5) footer .social-links { display: flex; flex-wrap: wrap; gap: 8px; }
body.tl-portal:not(.tl-f-footer5) footer .social-links a {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; margin: 0;
}
body.tl-portal:not(.tl-f-footer5) footer img.tts-logo-white,
body.tl-portal:not(.tl-f-footer5) footer .footer-info img { max-height: 56px; width: auto; max-width: 220px; object-fit: contain; }
/* newsletter: input + button never overflow */
body.tl-portal:not(.tl-f-footer5) footer form[name="newsletterform"] { max-width: 100%; }
body.tl-portal:not(.tl-f-footer5) footer form[name="newsletterform"] input[type="email"] { min-width: 0; }

@media (max-width: 767.98px) {
  body.tl-portal:not(.tl-f-footer5) footer .footer-top { padding-top: 32px; padding-bottom: 8px; }
  body.tl-portal:not(.tl-f-footer5) footer .footer-top .row > [class*="col-"] { margin-bottom: 18px; }
  body.tl-portal:not(.tl-f-footer5) footer .footer-info,
  body.tl-portal:not(.tl-f-footer5) footer .footer-newsletter { flex: 0 0 100%; max-width: 100%; }
  body.tl-portal:not(.tl-f-footer5) footer .copyright,
  body.tl-portal:not(.tl-f-footer5) footer .copyright.text-end,
  body.tl-portal:not(.tl-f-footer5) footer .copyright.text-left { text-align: center !important; float: none; width: 100%; }
  body.tl-portal:not(.tl-f-footer5) footer .footer-bottom .row > [class*="col-"],
  body.tl-portal:not(.tl-f-footer5) footer .bottom__content .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  body.tl-portal:not(.tl-f-footer5) footer .footernewsletter { flex-direction: column; align-items: stretch !important; gap: 12px; text-align: center; }
  body.tl-portal:not(.tl-f-footer5) footer .newsletterform { display: flex; width: 100%; }
  body.tl-portal:not(.tl-f-footer5) footer .newsletterform input { flex: 1 1 auto; min-width: 0; }
  body.tl-portal:not(.tl-f-footer5) footer .newsletterform button { flex: 0 0 auto; }
}

/* ---------- 6. Error pages (custom-error-layout) ---------- */
body.tl-portal.tl-error-page { background: var(--tl-soft); }
body.tl-portal.tl-error-page .tl-error-card {
  background: #fff;
  border-radius: var(--tl-radius);
  box-shadow: var(--tl-shadow-sm);
  padding: 40px 24px;
  text-align: center;
  font-family: var(--tl-font);
}
body.tl-portal.tl-error-page .tl-error-card img { width: 120px; max-width: 40%; height: auto; margin-bottom: 16px; }
body.tl-portal.tl-error-page .tl-error-card h1 { font-size: clamp(20px, 3.2vw, 28px); color: var(--tl-ink); }
body.tl-portal.tl-error-page .tl-error-card p { color: var(--tl-muted); }
body.tl-portal.tl-error-page .tl-error-card a:not(.btn) { color: var(--tl-primary); }
body.tl-portal.tl-error-page .tl-btn:hover { filter: brightness(.95); color: var(--tl-primary-txt); }

/* ---------- 7. Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  body.tl-portal .search_tabs.tl-service-tabs > li > a,
  body.tl-portal .navbar-nav .nav-link { transition: none; }
  body.tl-portal .search_tabs.tl-service-tabs > li > a:hover { transform: none; }
}
