:root {
  --ordering-top-bar-max-width: min(var(--ui-content-max, 1200px), 100%);
}

.ordering-top-bar {
  width: var(--ordering-top-bar-max-width);
  margin: 0 auto clamp(10px, 3vw, 24px);
  padding: clamp(10px, 2vw, 18px);
  border: 1px solid #dbe4f2;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 100%);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
  position: relative;
  z-index: 60;
}

.ordering-top-bar__shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "lang brand home";
  align-items: center;
  gap: 12px;
}

.ordering-top-bar__home {
  grid-area: home;
  justify-self: end;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #d5deed;
  background: rgba(255, 255, 255, 0.92);
  color: #1f2937;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.ordering-top-bar__home:hover,
.ordering-top-bar__home:focus-visible {
  border-color: rgba(59, 130, 246, 0.62);
  outline: none;
}

.ordering-top-bar__brand-link {
  grid-area: brand;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #1f2937;
  min-width: 0;
}

.ordering-top-bar__brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid #dbe4f2;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.ordering-top-bar__brand-name {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 800;
  line-height: 1.3;
  max-width: min(360px, 48vw);
  overflow-wrap: anywhere;
}

.ordering-top-bar .rt-lang-menu {
  grid-area: lang;
  position: relative;
  left: auto;
  right: auto;
  justify-self: start;
  z-index: 70;
}

.ordering-top-bar .rt-lang-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #d5deed;
  background: rgba(255, 255, 255, 0.92);
  color: #1f2937;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ordering-top-bar .rt-lang-menu__toggle:hover,
.ordering-top-bar .rt-lang-menu__toggle:focus-visible {
  border-color: rgba(59, 130, 246, 0.62);
  outline: none;
}

.ordering-top-bar .rt-lang-menu__toggle img {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.ordering-top-bar .rt-lang-menu__chevron {
  font-size: 0.74rem;
  opacity: 0.78;
}

.ordering-top-bar .rt-lang-menu__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  min-width: 190px;
  max-height: min(320px, 70vh);
  overflow: auto;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d5deed;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

.ordering-top-bar .rt-lang-menu[data-open="true"] .rt-lang-menu__dropdown {
  display: flex;
}

.ordering-top-bar .rt-lang-menu__item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  width: 100%;
  border: 0;
  padding: 8px 9px;
  border-radius: 9px;
  background: transparent;
  color: #1f2937;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.ordering-top-bar .rt-lang-menu__item[data-lang="ar"] {
  font-family: "Cairo", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ordering-top-bar .rt-lang-menu__item img {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  object-fit: cover;
}

.ordering-top-bar .rt-lang-menu__item:hover,
.ordering-top-bar .rt-lang-menu__item:focus-visible {
  background: rgba(148, 163, 184, 0.18);
  outline: none;
}

.ordering-top-bar .rt-lang-menu__item[aria-current="true"] {
  background: rgba(26, 115, 232, 0.15);
  color: #0f5bcc;
}

html[lang="ar"] .ordering-top-bar__brand-link,
html[dir="rtl"] .ordering-top-bar__brand-link {
  flex-direction: row-reverse;
}

html[lang="ar"] .ordering-top-bar .rt-lang-menu,
html[dir="rtl"] .ordering-top-bar .rt-lang-menu {
  justify-self: end;
}

html[lang="ar"] .ordering-top-bar .rt-lang-menu__dropdown,
html[dir="rtl"] .ordering-top-bar .rt-lang-menu__dropdown {
  left: auto;
  right: 0;
}

html[lang="ar"] .ordering-top-bar .rt-lang-menu__item,
html[dir="rtl"] .ordering-top-bar .rt-lang-menu__item {
  text-align: right;
}

@media (min-width: 721px) {
  html[lang="ar"] body.cart-page .ordering-top-bar__shell,
  html[dir="rtl"] body.cart-page .ordering-top-bar__shell,
  html.rt-lang-ar body.cart-page .ordering-top-bar__shell,
  html.rt-lang-rtl body.cart-page .ordering-top-bar__shell,
  body.cairo-font.cart-page .ordering-top-bar__shell {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "lang brand .";
  }

  html[lang="ar"] body.cart-page .ordering-top-bar .rt-lang-menu,
  html[dir="rtl"] body.cart-page .ordering-top-bar .rt-lang-menu,
  html.rt-lang-ar body.cart-page .ordering-top-bar .rt-lang-menu,
  html.rt-lang-rtl body.cart-page .ordering-top-bar .rt-lang-menu,
  body.cairo-font.cart-page .ordering-top-bar .rt-lang-menu {
    grid-area: lang;
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
  }

  html[lang="ar"] body.cart-page .ordering-top-bar__brand-link,
  html[dir="rtl"] body.cart-page .ordering-top-bar__brand-link,
  html.rt-lang-ar body.cart-page .ordering-top-bar__brand-link,
  html.rt-lang-rtl body.cart-page .ordering-top-bar__brand-link,
  body.cairo-font.cart-page .ordering-top-bar__brand-link {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .ordering-top-bar__shell {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand brand"
      "lang home";
    gap: 10px;
  }

  html[lang="ar"] body.cart-page .ordering-top-bar__shell,
  html[dir="rtl"] body.cart-page .ordering-top-bar__shell,
  html.rt-lang-ar body.cart-page .ordering-top-bar__shell,
  html.rt-lang-rtl body.cart-page .ordering-top-bar__shell,
  body.cairo-font.cart-page .ordering-top-bar__shell {
    grid-template-areas:
      "brand brand"
      "lang .";
  }

  html[lang="ar"] body.cart-page .ordering-top-bar .rt-lang-menu,
  html[dir="rtl"] body.cart-page .ordering-top-bar .rt-lang-menu,
  html.rt-lang-ar body.cart-page .ordering-top-bar .rt-lang-menu,
  html.rt-lang-rtl body.cart-page .ordering-top-bar .rt-lang-menu,
  body.cairo-font.cart-page .ordering-top-bar .rt-lang-menu {
    grid-area: lang;
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
  }

  .ordering-top-bar__brand-link {
    justify-self: center;
  }

  .ordering-top-bar__home {
    padding: 8px 12px;
    min-height: 40px;
  }
}

@media (max-width: 520px) {
  .ordering-top-bar {
    border-radius: 18px;
    padding: 10px;
  }

  .ordering-top-bar__brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .ordering-top-bar__brand-name {
    font-size: 0.95rem;
    max-width: 62vw;
  }

  .ordering-top-bar .rt-lang-menu__toggle [data-rt-lang-current] {
    display: none;
  }

  .ordering-top-bar .rt-lang-menu__toggle {
    min-height: 36px;
    padding: 6px 8px;
  }
}

body.search-page .ordering-top-bar--search-merged {
  --search-merged-nav-btn-size: 50px;
  --search-merged-nav-btn-radius: 16px;
  --search-merged-nav-icon-size: 1.22rem;
  --search-merged-menu-icon-width: 24px;
  --search-merged-menu-icon-height: 30px;
  width: min(860px, calc(100% - 24px));
  margin: clamp(14px, 3vw, 28px) auto clamp(12px, 3vw, 22px);
  padding: clamp(14px, 2.5vw, 22px) clamp(18px, 3.2vw, 30px);
  position: sticky;
  top: calc(var(--ui-safe-top, 0px) + clamp(8px, 2vw, 18px));
  z-index: 80;
}

body.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell {
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  grid-template-areas: "lang brand actions";
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
}

body.search-page .ordering-top-bar--search-merged .ordering-top-bar__brand-link {
  grid-area: brand;
  justify-self: center;
  padding-inline: clamp(10px, 1.6vw, 18px);
}

body.search-page .ordering-top-bar--search-merged .ordering-top-bar__brand-logo {
  width: 60px;
  height: 60px;
}

body.search-page .ordering-top-bar--search-merged .rt-lang-menu {
  grid-area: lang;
  justify-self: start;
}

body.search-page .ordering-top-bar--search-merged .rt-lang-menu__toggle {
  min-height: 46px;
  padding: 8px 14px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

body.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions {
  grid-area: actions;
  justify-self: end;
  display: flex;
  align-items: center;
  min-width: 0;
}

body.search-page .ordering-top-bar--search-merged .search-shell__nav {
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  position: static;
  top: auto;
  z-index: auto;
  justify-content: flex-start;
  direction: ltr;
  flex-direction: row-reverse;
  gap: 12px;
  flex-wrap: nowrap;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.search-page .ordering-top-bar--search-merged .cart-quick-nav__btn {
  width: var(--search-merged-nav-btn-size);
  height: var(--search-merged-nav-btn-size);
  min-width: var(--search-merged-nav-btn-size);
  border-radius: var(--search-merged-nav-btn-radius);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d5deed;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  color: #1f2937;
  transform: none;
  flex-shrink: 0;
}

body.search-page .ordering-top-bar--search-merged .cart-quick-nav__btn::after {
  display: none;
}

body.search-page .ordering-top-bar--search-merged .cart-quick-nav__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

body.search-page .ordering-top-bar--search-merged .cart-quick-nav__btn i {
  font-size: var(--search-merged-nav-icon-size);
}

body.search-page .ordering-top-bar--search-merged .cart-quick-nav__icon {
  width: 30px;
  height: 30px;
  display: block;
  top: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
  mask-size: contain;
  -webkit-mask-size: contain;
  flex-shrink: 0;
}

body.search-page .ordering-top-bar--search-merged .cart-quick-nav__icon--menu {
  width: var(--search-merged-menu-icon-width);
  height: var(--search-merged-menu-icon-height);
  mask-size: contain;
  -webkit-mask-size: contain;
}

body.search-page .ordering-top-bar--search-merged .cart-quick-nav__btn .item-count {
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.62rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

body.search-page .ordering-top-bar--search-merged .cart-quick-nav__btn--accent {
  background: rgba(255, 122, 24, 0.12);
  border-color: rgba(255, 122, 24, 0.3);
  color: var(--color-primary, #ff7a18);
  box-shadow: 0 10px 22px rgba(255, 122, 24, 0.16);
}

body.search-page .ordering-top-bar--search-merged .cart-quick-nav__btn--history {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.18);
  color: #0f766e;
}

html[lang="ar"] body.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell,
html[dir="rtl"] body.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell,
html.rt-lang-ar body.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell,
html.rt-lang-rtl body.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell,
body.cairo-font.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell {
  grid-template-areas: "actions brand lang";
}

html[lang="ar"] body.search-page .ordering-top-bar--search-merged .rt-lang-menu,
html[dir="rtl"] body.search-page .ordering-top-bar--search-merged .rt-lang-menu,
html.rt-lang-ar body.search-page .ordering-top-bar--search-merged .rt-lang-menu,
html.rt-lang-rtl body.search-page .ordering-top-bar--search-merged .rt-lang-menu,
body.cairo-font.search-page .ordering-top-bar--search-merged .rt-lang-menu {
  justify-self: end;
}

html[lang="ar"] body.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions,
html[dir="rtl"] body.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions,
html.rt-lang-ar body.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions,
html.rt-lang-rtl body.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions,
body.cairo-font.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions {
  justify-self: start;
}

html[lang="ar"] body.search-page .ordering-top-bar--search-merged .search-shell__nav,
html[dir="rtl"] body.search-page .ordering-top-bar--search-merged .search-shell__nav,
html.rt-lang-ar body.search-page .ordering-top-bar--search-merged .search-shell__nav,
html.rt-lang-rtl body.search-page .ordering-top-bar--search-merged .search-shell__nav,
body.cairo-font.search-page .ordering-top-bar--search-merged .search-shell__nav {
  flex-direction: row;
}

@media (max-width: 720px) {
  body.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand brand"
      "lang actions";
    gap: 12px;
  }

  body.search-page .ordering-top-bar--search-merged .rt-lang-menu {
    justify-self: start;
  }

  body.search-page .ordering-top-bar--search-merged .ordering-top-bar__brand-link {
    justify-self: center;
  }

  body.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions {
    justify-self: end;
  }

  html[lang="ar"] body.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell,
  html[dir="rtl"] body.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell,
  html.rt-lang-ar body.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell,
  html.rt-lang-rtl body.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell,
  body.cairo-font.search-page .ordering-top-bar--search-merged .ordering-top-bar__shell {
    grid-template-areas:
      "brand brand"
      "actions lang";
  }

  html[lang="ar"] body.search-page .ordering-top-bar--search-merged .rt-lang-menu,
  html[dir="rtl"] body.search-page .ordering-top-bar--search-merged .rt-lang-menu,
  html.rt-lang-ar body.search-page .ordering-top-bar--search-merged .rt-lang-menu,
  html.rt-lang-rtl body.search-page .ordering-top-bar--search-merged .rt-lang-menu,
  body.cairo-font.search-page .ordering-top-bar--search-merged .rt-lang-menu {
    justify-self: end;
  }

  html[lang="ar"] body.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions,
  html[dir="rtl"] body.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions,
  html.rt-lang-ar body.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions,
  html.rt-lang-rtl body.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions,
  body.cairo-font.search-page .ordering-top-bar--search-merged .ordering-top-bar__actions {
    justify-self: start;
  }
}

@media (max-width: 520px) {
  body.search-page .ordering-top-bar--search-merged {
    --search-merged-nav-btn-size: 44px;
    --search-merged-nav-btn-radius: 12px;
    --search-merged-nav-icon-size: 1.06rem;
    --search-merged-menu-icon-width: 22px;
    --search-merged-menu-icon-height: 28px;
    width: calc(100% - 16px);
    padding: 10px;
    border-radius: 20px;
  }

  body.search-page .ordering-top-bar--search-merged .search-shell__nav {
    gap: 9px;
  }

  body.search-page .ordering-top-bar--search-merged .cart-quick-nav__btn {
    width: var(--search-merged-nav-btn-size);
    height: var(--search-merged-nav-btn-size);
    min-width: var(--search-merged-nav-btn-size);
    border-radius: var(--search-merged-nav-btn-radius);
  }

  body.search-page .ordering-top-bar--search-merged .cart-quick-nav__btn i {
    font-size: var(--search-merged-nav-icon-size);
  }

  body.search-page .ordering-top-bar--search-merged .cart-quick-nav__icon {
    width: 26px;
    height: 26px;
  }

  body.search-page .ordering-top-bar--search-merged .cart-quick-nav__icon--menu {
    width: var(--search-merged-menu-icon-width);
    height: var(--search-merged-menu-icon-height);
  }

  body.search-page .ordering-top-bar--search-merged .cart-quick-nav__btn .item-count {
    min-width: 17px;
    height: 17px;
    font-size: 0.58rem;
  }
}
