/* Header review (P1-P9, Nov 2026): the top-bar buttons, the account menu and the phone header row.
   Logical properties only (inline-start / inline-end), so Arabic mirrors without a second file. Chevron icons are
   already mirrored for RTL by custom.rtl.css. */

/* ---------- Top bar (768 px and wider) ---------- */
.top-bar {
  padding: 0.4375rem 0;
}
.top-bar-row {
  min-height: 32px;
}
.top-bar-actions {
  gap: 0.25rem;
}
.top-bar-btn,
.top-bar a.top-bar-btn,
.top-bar .top-bar-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 32px;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.top-bar-btn:hover,
.top-bar-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.top-bar-btn:focus-visible {
  outline: 2px solid var(--bs-info);
  outline-offset: 2px;
}
.top-bar-btn .icon-header {
  margin: 0 !important;
}
.top-bar-caret {
  font-size: 10px;
  opacity: 0.7;
}
/* Header review (C1): "Contact Us" is a top-bar button like the others (same height, weight and hover) */
.top-bar-contact {
  margin-inline-start: -0.55rem;
}
.top-bar-sep {
  width: 1px;
  height: 20px;
  margin-inline: 0.25rem;
  background: rgba(255, 255, 255, 0.2);
}
.top-bar-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-bar a.top-bar-btn.top-bar-signin {
  background: var(--bs-purple);
  color: #fff;
}
.top-bar a.top-bar-btn.top-bar-signin:hover {
  background: #9586dc;
  color: #fff;
}
/* Top-bar menus open over the sticky navbar below them */
.top-bar .dropdown-menu {
  z-index: 1050;
}

/* The count on the corner of an icon (bell, basket) - top bar and phone row */
.header-count {
  position: absolute;
  top: -2px;
  inset-inline-start: 21px;
  padding: 0.25em 0.45em;
  font-size: 0.62rem;
  line-height: 1;
}

/* ---------- Account picture ---------- */
.acct-avatar {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: var(--bs-purple);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.acct-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.acct-avatar-lg {
  width: 44px;
  height: 44px;
  border-color: var(--bs-purple);
  font-size: 15px;
}
/* Acting for someone else (delegation): a yellow dot on the picture */
.acct-delegated-dot {
  position: absolute;
  top: 20px;
  inset-inline-start: 24px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--bs-stone);
  border-radius: 50%;
  background: var(--bs-warning);
}

/* ---------- Account menu (header and dashboard picture) ---------- */
.acct-menu {
  width: 290px;
  max-width: calc(100vw - 16px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  font-size: 14px;
}
.acct-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #ece9f8;
  background: #f6f5fc;
}
.acct-head-text {
  min-width: 0;
}
.acct-head-name {
  color: var(--bs-stone);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.acct-head-email {
  color: #6c757d;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.acct-context {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e8e4fb;
  color: #5b4bb5;
  font-size: 11px;
  font-weight: 700;
}
.acct-context-delegated {
  background: #fff1d6;
  color: #8a5a00;
}
.acct-menu .dropdown-item,
.top-bar .acct-menu a.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 1rem;
  border: 0;
  background: transparent;
  color: var(--bs-stone);
  font-size: 14px;
  font-weight: 500;
  white-space: normal;
}
.acct-menu .dropdown-item > i:first-child {
  flex: none;
  width: 18px;
  color: #8a93a0;
  text-align: center;
}
.acct-menu .dropdown-item:hover,
.acct-menu .dropdown-item:focus {
  background: #f6f5fc;
  color: var(--bs-stone);
}
.acct-menu .dropdown-item.active,
.acct-menu .dropdown-item.active-language,
.top-bar .acct-menu a.dropdown-item.active {
  background: transparent;
  color: var(--bs-stone);
  font-weight: 700;
}
.acct-menu .acct-list .dropdown-item.active::after {
  content: "\f00c";
  margin-inline-start: auto;
  color: var(--bs-success);
  font-family: "Font Awesome 6 Pro";
  font-weight: 900;
}
.acct-menu .dropdown-header {
  padding: 0.6rem 1rem 0.2rem;
  color: #9aa3ad;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.acct-menu .dropdown-divider {
  margin: 0.3rem 0;
  border-color: #ece9f8;
  opacity: 1;
}
.acct-menu .acct-logout,
.acct-menu .acct-logout > i:first-child {
  color: #d9534f;
}
/* Phones: the Language row and the language panel that replaces the list */
.acct-lang-current {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-inline-start: auto;
  color: #6c757d;
  font-size: 13px;
  font-weight: 400;
}
.acct-chevron {
  font-size: 11px;
}
.acct-menu .acct-back,
.acct-menu .acct-back > i:first-child {
  color: #5b4bb5;
  font-weight: 700;
}
.acct-pane-title {
  margin-inline-start: auto;
  color: var(--bs-stone);
}

/* ---------- Phone header row (below 768 px) ---------- */
.header-mobile-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-inline-start: auto;
  margin-inline-end: 0.4rem;
}
.header-icon-btn,
a.header-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 40px;
  height: 38px;
  padding: 0 0.6rem;
  border: 0;
  border-radius: 0.25rem;
  box-shadow: 0 0.25rem 0 rgba(0, 0, 0, 0.1);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.header-icon-btn:hover,
.header-icon-btn:focus {
  color: #fff;
}
.header-icon-btn .header-count {
  top: -6px;
  inset-inline-start: auto;
  inset-inline-end: -6px;
}
/* Header review (A): the account picture sits in a purple tile the same size as the bell and basket buttons, so the
   phone row reads as four equal buttons; the round picture (white ring) is centred in the tile */
.header-avatar-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0.25rem;
  background: var(--bs-purple);
  box-shadow: 0 0.25rem 0 rgba(0, 0, 0, 0.1);
}
.header-avatar-btn .acct-avatar {
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  font-size: 11px;
}
/* Delegation: the yellow dot on the tile's corner, where a count sits on the other buttons */
.header-avatar-btn .acct-delegated-dot {
  top: -4px;
  bottom: auto;
  inset-inline-start: auto;
  inset-inline-end: -4px;
  width: 14px;
  height: 14px;
  border-color: #fff;
}
/* The phone account menu spans the header width, under the row */
.header-mobile-account {
  position: static;
}
.acct-menu.acct-menu-sheet {
  position: absolute;
  top: 100%;
  inset-inline: 8px;
  width: auto;
  max-width: none;
  margin-top: 4px;
  border-radius: 12px;
  font-size: 15px;
  z-index: 1050;
}
.acct-menu.acct-menu-sheet .dropdown-item {
  padding: 0.7rem 1rem;
  font-size: 15px;
}
@media (max-width: 575.98px) {
  .navbar > .container {
    flex-wrap: nowrap;
  }
  .navbar > .container > .navbar-brand {
    flex-shrink: 1;
    min-width: 0;
    margin-inline-end: 0.25rem;
  }
  .navbar > .container > .navbar-brand img {
    max-width: 120px;
    height: auto;
  }
  .header-mobile-actions {
    gap: 0.35rem;
    min-width: 0;
    margin-inline-end: 0.35rem;
  }
}
/* Small phones (360-399 px): a smaller logo and a tighter "Sign in", so long translations (Arabic) stay on one row */
@media (max-width: 399.98px) {
  .navbar > .container > .navbar-brand img {
    max-width: 100px;
  }
  .header-signin-btn {
    min-width: 0;
    padding: 0 0.5rem;
    font-size: 13px;
  }
  .header-signin-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ---------- Tablet menu (P9): 768-991 px keep the menu button and the phone-style list ----------
   The navbar is navbar-expand-md, so Bootstrap and the theme lay the menu out in a row from 768 px. Six labelled items
   do not fit below 992 px, so in that range the row is turned back into the collapsed phone list: the menu button shows,
   the list opens under the header, and the theme's 768 px desktop rules are undone. */
@media (min-width: 768px) and (max-width: 991.98px) {
  .navbar.header-tablet-collapse .navbar-toggler {
    display: inline-block;
  }
  .navbar.header-tablet-collapse .navbar-collapse {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    width: 100%;
    max-height: 400px;
    border-top: 1px solid #e7e7e7;
    background-color: #fff;
    box-shadow: 0 0.25rem 0 rgba(0, 0, 0, 0.1);
  }
  .navbar.header-tablet-collapse .navbar-collapse.show,
  .navbar.header-tablet-collapse .navbar-collapse.collapsing {
    display: block !important;
    overflow-y: auto;
  }
  .navbar.header-tablet-collapse .navbar-nav {
    flex-direction: column;
    margin: 0.94rem 0;
  }
  .navbar.header-tablet-collapse .navbar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
  }
  .navbar.header-tablet-collapse .nav-icon {
    display: inline-block;
    margin: 0;
    margin-inline-end: 0.6325rem;
  }
  .navbar.header-tablet-collapse .navbar-nav .dropdown .nav-link span {
    display: inline-block;
    width: auto;
    padding: 0;
    border-right: 0 !important;
    border-left: 0 !important;
  }
  .navbar.header-tablet-collapse .navbar-nav .dropdown .dropdown-menu {
    position: static;
    width: auto;
    margin: 0;
    padding: 0;
    border-top: 0;
    box-shadow: none;
  }
  .navbar.header-tablet-collapse .navbar-nav .dropdown .dropdown-menu .dropdown-item,
  .navbar.header-tablet-collapse .navbar-nav .dropdown .dropdown-menu ul li a {
    display: block;
    padding: 0.38rem 1rem;
  }
  .navbar.header-tablet-collapse .navbar-nav .dropdown .dropdown-menu i {
    display: none;
  }
  .navbar.header-tablet-collapse .navbar-nav .dropdown .dropdown-menu .sub-menu {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: auto;
    visibility: visible;
    opacity: 1;
    box-shadow: none;
    background-color: transparent;
  }
  .navbar.header-tablet-collapse .navbar-nav .dropdown .dropdown-menu .sub-menu:before,
  .navbar.header-tablet-collapse .navbar-nav .dropdown .dropdown-menu .sub-menu:after {
    display: none;
  }
}
