.material-symbols-outlined {
  font-family: "Material Symbols Outlined", sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
}

:root {
  --portal-header-height: 88px;
  --portal-header-height-desktop: 88px;
  --portal-header-height-mobile: 74px;
  --mashaer-primary: #3b2b22;
  --mashaer-gold: #c19d60;
  --mashaer-header-solid-text: #784824;
  --mashaer-header-solid-link: #805331;
  --mashaer-drawer-brown: #784824;
  --portal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  color: var(--mashaer-header-solid-text);
  background: rgba(255, 255, 255, 0.95);
  border-top: 4px solid var(--mashaer-gold);
  box-shadow: rgba(31, 22, 14, 0.08) 0 10px 28px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.28s, color 0.28s, box-shadow 0.28s, border-color 0.28s;
}

.portal-header[data-transparent-on-load="true"]:not(.is-solid) {
  color: #fff;
  background: transparent;
  border-top-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.portal-header__shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 84px;
  padding: 18px max(20px, calc(50vw - 660px));
}

.portal-header__section {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  min-width: 0;
}

.portal-header__section--start {
  justify-content: flex-start;
}

.portal-header__section--end {
  justify-content: flex-end;
  position: relative;
}

.portal-header__links,
.portal-header__actions {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
  transition: opacity 0.24s, visibility 0.24s;
}

.portal-header__actions {
  gap: 18px;
}

.portal-header.is-drawer-open .portal-header__links,
.portal-header.is-drawer-open .portal-header__actions {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.portal-header a,
.portal-header button {
  color: inherit;
  border: 0;
  background: transparent;
  touch-action: manipulation;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, opacity 0.2s;
  font-family: inherit;
  padding: 0;
}

/* Set while a click is queued waiting for deferred handlers to load. */
html.mashaer-booting .portal-header button,
html.mashaer-booting .cart-btn {
  cursor: progress;
}

.portal-header a:hover,
.portal-header button:hover,
.portal-header a:focus-visible,
.portal-header button:focus-visible {
  color: var(--mashaer-gold);
  outline: none;
}

/* Prevent old .header wrapper from adding extra chrome */
.app > .header {
  position: relative;
  z-index: 70;
}

.portal-header__icon {
  position: relative;
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.portal-header__menu-button {
  display: none;
}

.portal-header__menu-button .material-symbols-outlined {
  font-size: 30px;
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
}

.portal-header__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
}

.portal-header__logo img {
  height: 50px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  transition: opacity 0.24s;
}

.portal-header__logo .portal-header__logo-img--solid {
  display: block;
}

.portal-header__logo .portal-header__logo-img--light {
  display: none;
}

.portal-header[data-transparent-on-load="true"]:not(.is-solid) .portal-header__logo .portal-header__logo-img--solid {
  display: none;
}

.portal-header[data-transparent-on-load="true"]:not(.is-solid) .portal-header__logo .portal-header__logo-img--light {
  display: block;
}

.portal-header[data-show-logo-when-transparent="false"]:not(.is-solid) .portal-header__logo {
  pointer-events: none;
}

.portal-header[data-show-logo-when-transparent="false"]:not(.is-solid) .portal-header__logo img {
  opacity: 0;
  pointer-events: none;
}

.portal-header__desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-header__link {
  position: relative;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.portal-header__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  background: var(--mashaer-gold);
  transition: transform 0.24s;
}

.portal-header__link:hover::after,
.portal-header__link:focus-visible::after,
.portal-header__link.is-active::after {
  transform: scaleX(1);
}

.portal-header__link.is-active {
  color: var(--mashaer-gold);
}

.portal-header:not(.is-solid) .portal-header__link.is-active {
  color: #fff;
}

.portal-drawer__nav > li > a.is-active {
  color: var(--mashaer-gold);
}

.portal-drawer__nav > li > a.is-active .material-symbols-outlined {
  color: var(--mashaer-gold);
}

.portal-header__region {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.portal-header__region-flag {
  display: block;
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.portal-header__region-label {
  line-height: 1;
}

.portal-header .icon-cart {
  width: 24px;
  height: auto;
  display: block;
}

.portal-header__cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  display: none;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--mashaer-gold);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.portal-header__cart-badge.is-visible,
.portal-header__cart-badge:not(:empty) {
  display: flex;
}

/* Override legacy cart-badge styles inside portal header */
.portal-header .cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  min-width: 16px;
  width: auto;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--mashaer-gold) !important;
  color: #fff !important;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  border: 0;
}

.rtl .portal-header .cart-badge {
  right: auto;
  left: 0;
}

.portal-header__close {
  position: absolute;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) rotate(-90deg) scale(0.5);
  transition: color 0.2s, opacity 0.24s, transform 0.24s;
}

.portal-header.is-drawer-open .portal-header__close {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(-50%) rotate(0) scale(1);
}

.portal-header__close--rtl {
  left: 0;
}

.portal-header__close--ltr {
  right: 0;
}

.portal-header-spacer {
  width: 100%;
  height: var(--portal-header-height-desktop);
  flex-shrink: 0;
}

.portal-header-spacer.is-overlay {
  height: 0;
}

/* Announcement / payment bars sit above fixed header flow via spacer only when not overlaying */
.portal-header .announcement-bar,
.portal-header .payment-session-bar {
  position: relative;
  z-index: 1;
}

/* —— Mobile menu drawer —— */
.portal-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  transition: opacity 0.5s var(--portal-ease);
  padding-top: var(--portal-header-height);
}

.portal-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.portal-drawer__inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  transform: translateY(-16px);
  transition: transform 0.5s var(--portal-ease);
}

.portal-drawer.is-open .portal-drawer__inner {
  transform: translateY(0);
}

.portal-drawer__auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.portal-drawer__auth-btn {
  display: block;
  padding: 16px 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.portal-drawer__auth-btn--fill {
  background: var(--mashaer-drawer-brown);
  color: #fff;
  border: 1px solid var(--mashaer-drawer-brown);
}

.portal-drawer__auth-btn--fill:hover {
  background: #5c3a21;
  color: #fff;
}

.portal-drawer__auth-btn--outline {
  background: transparent;
  color: var(--mashaer-drawer-brown);
  border: 1px solid var(--mashaer-drawer-brown);
}

.portal-drawer__auth-btn--outline:hover {
  background: var(--mashaer-drawer-brown);
  color: #fff;
}

.portal-drawer__nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.portal-drawer__nav > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid #eee;
  color: var(--mashaer-primary);
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.portal-drawer__nav > li > a:hover {
  color: var(--mashaer-gold);
}

.portal-drawer__nav .material-symbols-outlined {
  font-size: 14px;
  color: #999;
  transition: color 0.2s;
}

.portal-drawer__nav > li > a:hover .material-symbols-outlined {
  color: var(--mashaer-gold);
}

.portal-drawer__region {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid #eee;
}

.portal-drawer__region-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: var(--mashaer-drawer-brown);
  font-weight: 500;
  font-size: 16px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color 0.2s;
}

.portal-drawer__region-btn:hover {
  color: var(--mashaer-gold);
}

.portal-drawer__region-flag {
  width: 28px;
  height: 20px;
  border: 1px solid #ddd;
  object-fit: cover;
  flex-shrink: 0;
}

.portal-drawer__region-label {
  flex: 1;
  text-align: start;
}

.portal-drawer__region-meta {
  margin-inline-start: auto;
  font-size: 12px;
  color: #999;
  letter-spacing: 0.04em;
}

/* Search overlay (desktop icon → products search) */
.portal-search-panel {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--portal-header-height);
  z-index: 65;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 16px 20px;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s var(--portal-ease), opacity 0.28s;
  box-shadow: 0 8px 24px rgba(31, 22, 14, 0.06);
}

.portal-search-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.portal-search-panel .autocomplete {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.portal-search-panel .search-input-input {
  width: 100%;
  height: 48px;
  border: 1px solid #e7ddd0;
  border-radius: 0;
  padding: 0 16px;
  font-size: 15px;
  color: var(--mashaer-primary);
  background: #faf6ef;
}

.portal-search-panel .search-input-input:focus {
  outline: 1px solid var(--mashaer-gold);
  border-color: var(--mashaer-gold);
}

body.portal-drawer-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .portal-header__links,
  .portal-header__actions {
    gap: 16px;
  }

  .portal-header__desktop-nav {
    gap: 16px;
  }
}

@media (max-width: 720px) {
  :root {
    --portal-header-height: var(--portal-header-height-mobile);
  }

  .portal-header__shell {
    min-height: 70px;
    padding: 14px 15px;
  }

  .portal-header__links,
  .portal-header__actions {
    gap: 6px;
  }

  .portal-header__icon,
  .portal-header__region {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .portal-header__region {
    gap: 0;
  }

  .portal-header__region-flag {
    width: 24px;
    height: 18px;
  }

  .portal-header .icon-cart {
    width: 25px;
  }

  .portal-header__cart-badge,
  .portal-header .cart-badge {
    top: 3px;
    right: 3px;
  }

  .rtl .portal-header .cart-badge {
    right: auto;
    left: 3px;
  }

  .portal-header__desktop-nav,
  .portal-header__desktop-only,
  .portal-header__region-label {
    display: none !important;
  }

  .portal-header__menu-button {
    display: inline-flex;
  }

  .portal-header__logo img {
    height: 42px;
  }

  .portal-header__close--rtl {
    left: 12px;
  }

  .portal-header__close--ltr {
    right: 12px;
  }

  .portal-header-spacer {
    height: var(--portal-header-height-mobile);
  }

  .portal-header-spacer.is-overlay {
    height: 0;
  }

  .portal-drawer {
    padding-top: var(--portal-header-height-mobile);
  }
}

/* Hide legacy upper account bar if somehow rendered */
.account-lang-currency.upper-bar:not(.portal-header__region-wrap) {
  display: none !important;
}

/* Disable old slide-menu chrome when using portal drawer */
#sidenav-overlay,
#sliding-menu.slide-menu {
  display: none !important;
}
