/* ----------------------------------------------------------------------------------------
 * Author        : Prospera
 * File          : Header — utility cluster, account menu, mobile bar
 * ----------------------------------------------------------------------------------------
 *
 * Loaded AFTER custom.css, which it deliberately overrides. The signed-in bar
 * had grown to eight controls of near-equal weight (logo, five links, phone
 * number, language, My Sessions, name chip, Logout, Book Now) and wrapped in
 * Arabic. Two changes fix it:
 *
 *   1. A hairline divider splits the bar into "where you can go" (nav) and
 *      "who you are and what you do" (utilities). The divider is not
 *      decoration -- it marks a real change of kind.
 *   2. The three account controls collapse into one: your name opens a panel
 *      holding your sessions and sign-out. Identity-scoped things live under
 *      your identity.
 *
 * The phone number is now an icon on the bar (the digits stay for screen
 * readers, in the tooltip, in the mobile drawer, and in the footer). It cost
 * ~240px of the most contested space on the page to serve a small share of
 * taps.
 *
 * Mobile: custom.css leaves .header-contact-btn inside Bootstrap's collapsed
 * .navbar-collapse, which means language, sign-in, account and Book Now were
 * all unreachable below 992px -- the hamburger only ever carried the nav
 * links. Below the breakpoint the wrapper is forced back into view with the
 * nav list hidden, and the controls wrap rather than overflow, so nothing is
 * ever cut off.
 * -------------------------------------------------------------------------- */

/* --- The bar ------------------------------------------------------------- */

.main-header .header-contact-btn {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* custom.css sets these with !important / element margins; both fight the
   gap above, so they are neutralised here rather than edited in place. */
html[dir='rtl'] .main-header .header-contact-btn {
  gap: 14px !important;
}

body.rtl .main-header .header-contact-btn > * {
  margin-left: 0;
  margin-right: 0;
}

/* The divider between navigation and utilities. */
.main-header .header-contact-btn::before {
  content: '';
  align-self: stretch;
  width: 1px;
  margin-inline-end: 4px;
  background: var(--divider-color);
}

/* Five links at 15px of padding each ate the space the utilities needed, and
   a wrapped "About us" was the first thing to break in Arabic. */
.main-header .main-menu ul li a {
  padding: 15px 12px !important;
  white-space: nowrap;
}

.main-header .main-menu .nav-menu-wrapper {
  margin: 0 24px;
}

/* Book Now stays the loudest thing in the bar, but at 17px/25px it was
   competing with the logo for size rather than winning on colour. */
.main-header .header-contact-btn .btn-default {
  padding: 14px 24px;
  font-size: 15px;
  white-space: nowrap;
}

/* --- Phone: icon on the bar, digits everywhere else ---------------------- */

.main-header .header-contact-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--secondary-color);
  flex: 0 0 auto;
}

.main-header .header-contact-now i {
  width: auto;
  height: auto;
  margin: 0;
  background: none;
  border-radius: 0;
  font-size: 16px;
  color: var(--accent-color);
}

.main-header .header-contact-now:hover {
  background-color: var(--accent-color);
}

.main-header .header-contact-now:hover i {
  color: var(--white-color);
}

/* Present for assistive tech, absent from the layout. */
.header-contact-number {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Language: the code, not the word ------------------------------------ */

.main-header .lang-toggle {
  margin: 0;
  padding: 9px 16px;
  gap: 7px;
  flex: 0 0 auto;
}

body.rtl .main-header .lang-toggle {
  margin: 0;
}

/* The full language name is a luxury the bar can only afford when wide. */
.lang-toggle .lang-full {
  display: none;
}

@media (min-width: 1300px) {
  .lang-toggle .lang-full {
    display: inline;
  }

  .lang-toggle .lang-short {
    display: none;
  }
}

/* --- Account: three controls become one ---------------------------------- */

.user-info-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--divider-color);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

body.rtl .account-trigger {
  padding: 6px 6px 6px 14px;
}

.account-trigger:hover,
.account-trigger[aria-expanded='true'] {
  border-color: var(--accent-color);
  background: var(--divider-color);
}

/* The monogram is set in the brand's display face -- the one place the
   account control borrows from the identity rather than the UI kit. */
.account-monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(47, 168, 160, 0.14);
  color: var(--primary-color);
  font-family: var(--accent-font);
  font-size: 16px;
  line-height: 1;
  text-transform: uppercase;
}

.account-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 600;
  text-transform: capitalize;
}

.account-caret {
  font-size: 11px;
  color: var(--text-color);
  transition: transform 0.3s ease;
}

.account-trigger[aria-expanded='true'] .account-caret {
  transform: rotate(180deg);
}

/* --- Account panel -------------------------------------------------------- */

.account-panel {
  position: absolute;
  inset-block-start: calc(100% + 12px);
  inset-inline-end: 0;
  min-width: 232px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--divider-color);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(13, 59, 102, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 1000;
}

.account-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.account-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 16px;
  border-bottom: 1px solid var(--divider-color);
  margin-bottom: 8px;
}

.account-panel-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--primary-color);
  font-size: 15px;
  font-weight: 600;
  text-transform: capitalize;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--primary-color);
  font-family: var(--default-font);
  font-size: 14px;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.account-item i {
  width: 18px;
  font-size: 15px;
  color: var(--accent-color);
  transition: color 0.3s ease;
}

.account-item:hover,
.account-item:focus-visible {
  background: var(--secondary-color);
  color: var(--primary-color);
}

.account-item-exit:hover,
.account-item-exit:focus-visible {
  background: rgba(230, 87, 87, 0.1);
  color: var(--error-color);
}

.account-item-exit:hover i,
.account-item-exit:focus-visible i {
  color: var(--error-color);
}

/* --- Signed out ----------------------------------------------------------- */

.main-header .btn-auth-nav {
  white-space: nowrap;
}

/* --- Keyboard ------------------------------------------------------------- */

.main-header .account-trigger:focus-visible,
.main-header .lang-toggle:focus-visible,
.main-header .header-contact-now:focus-visible,
.account-panel .account-item:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

/* --- Mobile --------------------------------------------------------------- */

@media (max-width: 991px) {
  /* Bootstrap collapses .navbar-collapse below the expand breakpoint, which
     took the whole utility cluster with it. Force the wrapper back and hide
     only the nav list, which slicknav has already re-rendered in the drawer. */
  .main-header .main-menu.navbar-collapse {
    display: flex !important;
    flex: 1 1 auto;
    justify-content: flex-end;
    padding: 0;
  }

  .main-header .main-menu .nav-menu-wrapper {
    display: none;
  }

  /* Wrapping is the guarantee that nothing is ever cut off, however narrow
     the device or however long the client's name. */
  .main-header .header-contact-btn {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 0;
  }

  html[dir='rtl'] .main-header .header-contact-btn {
    gap: 10px !important;
  }

  /* The divider only reads as a divider on one line. */
  .main-header .header-contact-btn::before {
    display: none;
  }

  /* The number is a full row in the drawer instead. */
  .main-header .header-contact-now {
    display: none;
  }

  .main-header .lang-toggle {
    width: auto;
    margin: 0;
    padding: 8px 12px;
  }

  .main-header .header-contact-btn .btn-default {
    padding: 11px 20px;
    font-size: 14px;
    margin: 0;
  }

  .auth-buttons,
  .user-info-nav {
    margin-top: 0;
  }

  /* The caret drops and the monogram alone identifies the account. The name
     is hidden visually rather than removed, so it still names the button for
     screen readers at every width. */
  .account-trigger,
  body.rtl .account-trigger {
    padding: 4px;
  }

  .account-caret {
    display: none;
  }

  .account-name {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .account-panel {
    inset-block-start: calc(100% + 10px);
    min-width: 220px;
  }
}

@media (max-width: 400px) {
  .main-header .header-contact-btn .btn-default {
    padding: 10px 16px;
    font-size: 13px;
  }

  .lang-toggle .lang-short {
    font-size: 13px;
  }
}

/* The phone row appended to the mobile drawer by function.js. */
.slicknav_nav .slicknav-phone a {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  margin-top: 5px !important;
  direction: ltr;
}

body.rtl .slicknav_nav .slicknav-phone a {
  justify-content: flex-end;
}

@media (prefers-reduced-motion: reduce) {
  .account-panel,
  .account-caret,
  .account-trigger {
    transition-duration: 0.001ms !important;
  }
}
