/*
 * MrTehranLitePlus R1
 * Targeted navigation/header extension on top of MrTehranLite.
 * Scope: Base.ascx only via .mtlp-shell.
 */

:root {
  --mtlp-orange: #ff5a24;
  --mtlp-orange-hover: #ea4613;
  --mtlp-drawer-width: 430px;
}

body.mtlp-lock { overflow: hidden !important; }
body.mtlp-skin-active .kco-launcher { display: none !important; }

.mtlp-shell .mtlp-header-main-row { position: relative; }
.mtlp-shell .mtlp-header-actions {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  direction: rtl;
}

.mtlp-shell .mtlp-header-tool {
  position: relative;
  min-width: 62px;
  min-height: 58px;
  margin: 0;
  padding: 5px 7px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #fff !important;
  text-decoration: none !important;
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.2;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
  box-sizing: border-box;
}
.mtlp-shell .mtlp-header-tool:hover,
.mtlp-shell .mtlp-header-tool:focus {
  background: rgba(255,255,255,.14);
  color: #fff !important;
  text-decoration: none !important;
  outline: 0;
}
.mtlp-shell .mtlp-header-tool:active { transform: translateY(1px); }
.mtlp-shell .mtlp-header-tool > i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  margin: 0;
  padding: 0;
  color: #fff !important;
  font-size: 22px;
  line-height: 1;
}
.mtlp-shell .mtlp-header-tool > span,
.mtlp-shell .mtlp-header-tool .mtlp-tool-label {
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  text-align: center;
}

/* BasketPreview is kept native; only its trigger is restyled into the header tool. */
.mtlp-shell .mtlp-basket-host {
  min-width: 66px;
  padding: 0;
  overflow: visible;
}
.mtlp-shell .mtlp-basket-host .btn-show-basket {
  width: 66px !important;
  min-width: 66px !important;
  min-height: 58px !important;
  margin: 0 !important;
  padding: 5px 6px !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #fff !important;
  cursor: pointer;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  box-sizing: border-box !important;
  transition: background-color .18s ease, transform .18s ease;
}
.mtlp-shell .mtlp-basket-host .btn-show-basket:hover,
.mtlp-shell .mtlp-basket-host .btn-show-basket:focus,
.mtlp-shell .mtlp-basket-host .btn-show-basket.active {
  background: rgba(255,255,255,.14) !important;
}
.mtlp-shell .mtlp-basket-host .btn-show-basket:before {
  content: "\f291" !important;
  position: static !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 26px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #fff !important;
  font-family: "Font Awesome 7 Free" !important;
  font-weight: 900 !important;
  font-size: 22px !important;
  line-height: 1 !important;
}
.mtlp-shell .mtlp-basket-host .btn-show-basket.active:before { content: "\f00d" !important; }
.mtlp-shell .mtlp-basket-host .btn-show-basket:after {
  content: "سبد خرید" !important;
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  white-space: nowrap;
}
.mtlp-shell .mtlp-basket-count {
  position: absolute;
  z-index: 8;
  top: 1px;
  right: 1px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--karen-primary);
  border-radius: 999px;
  background: var(--mtlp-orange);
  color: #fff !important;
  font: 700 11px/16px Tahoma, sans-serif;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}

/* Native basket box is anchored under the new header basket action on desktop. */
@media screen and (min-width: 1200px) {
  .mtlp-shell .mtlp-basket-host .basket-preview-wrap {
    position: absolute !important;
    z-index: 1095 !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 380px !important;
    max-width: min(380px, 94vw) !important;
    transform: translateY(-10px) !important;
    opacity: 0 !important;
    pointer-events: none;
  }
  .mtlp-shell .mtlp-basket-host .basket-preview-wrap.active {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto;
  }
}

/* Desktop category trigger before the existing main menu. */
.mtlp-shell .mtlp-nav-row { min-height: 56px; }
.mtlp-shell .mtlp-nav-inner {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  direction: rtl;
}
.mtlp-shell .mtlp-category-trigger {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: 12px;
  background: var(--mtlp-orange);
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}
.mtlp-shell .mtlp-category-trigger:hover,
.mtlp-shell .mtlp-category-trigger:focus {
  background: var(--mtlp-orange-hover);
  color: #fff !important;
  outline: 0;
}
.mtlp-shell .mtlp-category-trigger:active { transform: translateY(1px); }
.mtlp-shell .mtlp-category-trigger i,
.mtlp-shell .mtlp-category-trigger span { color: #fff !important; }
.mtlp-shell .mtlp-category-trigger i { font-size: 18px; }
.mtlp-shell .mtlp-desktop-menu-slot { flex: 1 1 auto; min-width: 0; }
.mtlp-shell .mtlp-main-nav { width: 100%; }
.mtlp-shell .mtlp-main-menu { margin-top: 0 !important; }

/* R1.1: Base is intentionally single-column. Category HTML is kept only inside the shared drawer. */
.mtlp-shell .mtlp-page-body .mtlp-content-full {
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  border-right: 0 !important;
}
.mtlp-shell .mtlp-category-server-pane {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Shared drawer. Desktop category button opens categories; mobile menu exposes both tabs. */
.mtlp-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147480500;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0,0,0,.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.mtlp-navigation-drawer {
  position: fixed !important;
  z-index: 2147480600 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: min(var(--mtlp-drawer-width), 94vw) !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-left: 1px solid var(--karen-border) !important;
  background: var(--karen-surface) !important;
  color: var(--karen-text) !important;
  box-shadow: -12px 0 38px rgba(0,0,0,.20);
  transform: translate3d(104%,0,0);
  transition: transform .25s ease;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
body.mtlp-drawer-open .mtlp-drawer-overlay { opacity: 1; pointer-events: auto; }
body.mtlp-drawer-open .mtlp-navigation-drawer { transform: translate3d(0,0,0); }
.mtlp-drawer-head {
  flex: 0 0 auto;
  min-height: 78px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--karen-border);
  background: var(--karen-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mtlp-drawer-heading { display: flex; flex-direction: column; min-width: 0; }
.mtlp-drawer-heading strong { color: var(--karen-text) !important; font-size: 17px; line-height: 1.6; }
.mtlp-drawer-heading span { color: var(--karen-text-muted) !important; font-size: 13px; line-height: 1.6; }
.mtlp-drawer-close {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--karen-border);
  border-radius: 12px;
  background: var(--karen-surface-muted);
  color: var(--karen-text) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mtlp-drawer-close i { color: var(--karen-text) !important; font-size: 20px; }
.mtlp-drawer-tabs {
  flex: 0 0 auto;
  min-height: 58px;
  display: none;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--karen-border);
  background: var(--karen-surface-muted);
}
.mtlp-drawer-tab {
  position: relative;
  min-height: 58px;
  border: 0;
  background: transparent;
  color: var(--karen-text-muted) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.mtlp-drawer-tab i,
.mtlp-drawer-tab span { color: inherit !important; }
.mtlp-drawer-tab:after {
  content: "";
  position: absolute;
  right: 16px;
  left: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}
.mtlp-drawer-tab.is-active { color: var(--karen-primary) !important; background: rgba(var(--karen-primary-rgb),.05); }
.mtlp-drawer-tab.is-active:after { background: var(--karen-primary); }
.mtlp-drawer-body { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.mtlp-drawer-panel {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px;
  background: var(--karen-surface);
}
.mtlp-drawer-panel[hidden] { display: none !important; }

/* Category menu keeps its original server-rendered HTML; only drawer sizing is normalized. */
.mtlp-category-drawer-slot,
.mtlp-category-drawer-slot #RightPane,
.mtlp-category-drawer-slot .fsh-category-menu-wrap,
.mtlp-category-drawer-slot .wi-menu { width: 100% !important; max-width: 100% !important; }
.mtlp-category-drawer-slot .fsh-category-menu-wrap { margin: 0 !important; }

/* Main menu inside mobile drawer: same BootstrapMenu HTML, no Ajax/duplicate menu. */
.mtlp-mobile-menu-slot .mtlp-main-nav {
  position: static !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
.mtlp-mobile-menu-slot .mtlp-main-menu {
  float: none !important;
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
.mtlp-mobile-menu-slot .mtlp-main-menu > li {
  float: none !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
}
.mtlp-mobile-menu-slot .mtlp-main-menu > li > a {
  width: 100% !important;
  min-height: 50px;
  padding: 12px 10px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--karen-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--karen-text) !important;
  display: flex !important;
  align-items: center;
  white-space: normal !important;
  font-size: 14px;
}
.mtlp-mobile-menu-slot .mtlp-main-menu > li > a:hover,
.mtlp-mobile-menu-slot .mtlp-main-menu > li > a:focus,
.mtlp-mobile-menu-slot .mtlp-main-menu > li > a:visited { color: var(--karen-text) !important; }
.mtlp-mobile-menu-slot .mtlp-main-menu > li.active > a { color: var(--karen-primary) !important; background: rgba(var(--karen-primary-rgb),.06) !important; }
.mtlp-mobile-menu-slot .mtlp-main-menu .dropdown-menu {
  position: static !important;
  float: none !important;
  display: block;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-right: 2px solid rgba(var(--karen-primary-rgb),.18) !important;
  border-radius: 0 !important;
  background: var(--karen-surface-muted) !important;
  box-shadow: none !important;
}
.mtlp-mobile-menu-slot .mtlp-main-menu .dropdown-menu > li > a {
  min-height: 44px;
  padding: 9px 16px !important;
  color: var(--karen-text) !important;
  white-space: normal !important;
}
.mtlp-mobile-menu-slot .mtlp-main-menu > li.mtlp-mobile-overflow > a { display: none !important; }
.mtlp-mobile-menu-slot .mtlp-main-menu > li.mtlp-mobile-overflow > .dropdown-menu {
  display: block !important;
  border-right: 0 !important;
  background: transparent !important;
}
.mtlp-mobile-menu-slot .mtlp-main-menu > li.mtlp-mobile-overflow > .dropdown-menu > li > a {
  min-height: 50px;
  padding: 12px 10px !important;
  border-bottom: 1px solid var(--karen-border) !important;
  background: transparent !important;
}

@media screen and (max-width: 1199px) {
  .mtlp-shell > header { padding-top: 12px; }
  .mtlp-shell .mtlp-header-main-row {
    margin: 0 -8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    direction: rtl;
  }
  .mtlp-shell .mtlp-header-logo {
    order: 1;
    float: none !important;
    flex: 0 0 100%;
    width: 100%;
    padding: 0 8px;
    text-align: center;
  }
  .mtlp-shell .mtlp-header-logo a { margin-bottom: 9px; }
  .mtlp-shell .mtlp-menu-trigger {
    order: 2;
    flex: 0 0 48px;
    width: 48px;
    min-width: 48px;
    min-height: 54px;
    padding: 4px 3px;
    display: inline-flex !important;
  }
  .mtlp-shell .mtlp-header-search {
    order: 3;
    float: none !important;
    flex: 1 1 110px;
    width: auto !important;
    min-width: 90px;
    padding: 0 4px;
    text-align: center;
  }
  .mtlp-shell .mtlp-header-actions {
    order: 4;
    float: none !important;
    flex: 0 0 auto;
    width: auto !important;
    min-height: 54px;
    padding: 0 4px;
    gap: 1px;
    display: flex !important;
    align-items: center;
  }
  .mtlp-shell .mtlp-header-actions .mtlp-header-tool,
  .mtlp-shell .mtlp-menu-trigger {
    min-height: 54px;
    border-radius: 8px;
  }
  .mtlp-shell .mtlp-header-actions .mtlp-header-tool { min-width: 47px; padding: 3px 2px; }
  .mtlp-shell .mtlp-custom-order-action { width: 60px; min-width: 60px !important; }
  .mtlp-shell .mtlp-header-tool > i { width: 25px; height: 24px; font-size: 20px; }
  .mtlp-shell .mtlp-header-tool > span { font-size: 10.5px; line-height: 1.25; }
  .mtlp-shell .mtlp-custom-order-action > span { max-width: 58px; white-space: normal; }
  .mtlp-shell .mtlp-basket-host { min-width: 48px !important; width: 48px; }
  .mtlp-shell .mtlp-basket-host .btn-show-basket {
    width: 48px !important;
    min-width: 48px !important;
    min-height: 54px !important;
    padding: 3px 2px !important;
  }
  .mtlp-shell .mtlp-basket-host .btn-show-basket:before { width: 25px !important; height: 24px !important; font-size: 20px !important; }
  .mtlp-shell .mtlp-basket-host .btn-show-basket:after { font-size: 10.5px !important; }
  .mtlp-shell .mtlp-basket-count {
    top: -1px;
    right: -1px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-width: 2px;
    font-size: 10px;
    line-height: 14px;
  }

  /* Search internals are deliberately not restyled; only its available width changes. */
  .mtlp-shell .mtlp-header-search > div.js__header-search-box { width: 100%; }

  /* Original desktop category trigger is intentionally absent on mobile/tablet. */
  .mtlp-shell .mtlp-nav-row { display: none !important; }

  .mtlp-drawer-tabs { display: grid; }
  .mtlp-navigation-drawer { width: min(var(--mtlp-drawer-width), 94vw) !important; }
  .mtlp-drawer-head { min-height: 70px; padding: 11px 13px; }
  .mtlp-drawer-panel { padding: 10px; }

  /* Native basket preview becomes a header-associated floating card on small screens. */
  .mtlp-shell .mtlp-basket-host .basket-preview-wrap {
    position: fixed !important;
    z-index: 2147480700 !important;
    top: 136px !important;
    left: 10px !important;
    right: 10px !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    transform: translateY(-10px) !important;
    opacity: 0 !important;
    pointer-events: none;
  }
  .mtlp-shell .mtlp-basket-host .basket-preview-wrap.active {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto;
  }
}

@media screen and (max-width: 480px) {
  .mtlp-shell > header { padding-right: 8px; padding-left: 8px; }
  .mtlp-shell .mtlp-header-main-row { margin-right: 0; margin-left: 0; }
  .mtlp-shell .mtlp-header-logo { padding-right: 0; padding-left: 0; }
  .mtlp-shell .mtlp-menu-trigger { flex-basis: 43px; width: 43px; min-width: 43px; }
  .mtlp-shell .mtlp-header-search { flex-basis: 82px; min-width: 76px; padding-right: 2px; padding-left: 2px; }
  .mtlp-shell .mtlp-header-actions { padding-right: 1px; padding-left: 0; }
  .mtlp-shell .mtlp-header-actions .mtlp-header-tool { min-width: 43px; width: 43px; }
  .mtlp-shell .mtlp-custom-order-action { min-width: 56px !important; width: 56px !important; }
  .mtlp-shell .mtlp-basket-host { min-width: 43px !important; width: 43px !important; }
  .mtlp-shell .mtlp-basket-host .btn-show-basket { width: 43px !important; min-width: 43px !important; }
  .mtlp-shell .mtlp-header-tool > span,
  .mtlp-shell .mtlp-basket-host .btn-show-basket:after { font-size: 10px !important; }
  .mtlp-navigation-drawer { width: min(420px, 96vw) !important; }
}

/* ================================================================
 * R1.2 — Mobile header hierarchy refinement
 * - Description moves to a slim darker strip at the top of header.
 * - Row 1: Menu + right-aligned brand title | Login + Basket on left.
 * - Row 2: Existing search box + Custom Order; search internals unchanged.
 * Desktop is intentionally untouched.
 * ================================================================ */
@media screen and (max-width: 1199px) {
  .mtlp-shell > header {
    padding-top: 0 !important;
  }

  .mtlp-shell .mtlp-header-main-row {
    position: relative;
    margin-right: -8px;
    margin-left: -8px;
    padding: 34px 8px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    direction: rtl;
  }

  /* Keep one source of truth for the portal description, but present it as
     a dedicated slim strip. The darker tone is derived from the current
     brand header instead of hard-coding a site color. */
  .mtlp-shell .mtlp-header-logo {
    position: static !important;
    order: 2;
    float: none !important;
    flex: 0 0 calc(100% - 144px);
    width: calc(100% - 144px) !important;
    min-width: 0;
    margin: 0;
    padding: 0 8px;
    text-align: right;
  }
  .mtlp-shell .mtlp-header-logo a {
    display: block;
    width: 100%;
    margin: 0 !important;
    padding: 0;
    text-align: right;
  }
  .mtlp-shell .mtlp-header-logo a strong {
    display: block;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: #fff;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mtlp-shell .mtlp-header-logo a span {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    left: 0;
    height: 28px;
    margin: 0;
    padding: 0 12px;
    background: rgba(0, 0, 0, .12);
    color: rgba(255, 255, 255, .72);
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 11.5px;
    line-height: 28px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
  }

  /* The wrapper no longer owns a row on mobile; its children become direct
     flex items so Login/Basket can share the brand row while Custom Order
     stays beside Search on the row below. */
  .mtlp-shell .mtlp-header-actions {
    display: contents !important;
  }

  .mtlp-shell .mtlp-menu-trigger {
    order: 1;
    flex: 0 0 48px;
    width: 48px;
    min-width: 48px;
    min-height: 54px;
    margin: 0;
    padding: 4px 3px;
    display: inline-flex !important;
  }
  .mtlp-shell .mtlp-login-action {
    order: 3;
    flex: 0 0 48px;
    width: 48px;
    min-width: 48px !important;
  }
  .mtlp-shell .mtlp-basket-host {
    order: 4;
    flex: 0 0 48px;
    width: 48px;
    min-width: 48px !important;
  }

  /* Second mobile row: keep original search component styling; only the
     available width/placement changes. */
  .mtlp-shell .mtlp-header-search {
    order: 5;
    float: none !important;
    flex: 0 0 calc(100% - 64px);
    width: calc(100% - 64px) !important;
    min-width: 0;
    margin-top: 6px;
    padding: 0 4px 0 0;
    text-align: center;
  }
  .mtlp-shell .mtlp-custom-order-action {
    order: 6;
    flex: 0 0 64px;
    width: 64px !important;
    min-width: 64px !important;
    margin-top: 6px;
  }
  .mtlp-shell .mtlp-header-search > div.js__header-search-box {
    width: 100%;
  }

  /* Basket preview follows the new two-row header height. */
  .mtlp-shell .mtlp-basket-host .basket-preview-wrap {
    top: 150px !important;
  }
}

@media screen and (max-width: 480px) {
  .mtlp-shell .mtlp-header-main-row {
    margin-right: 0;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
  }
  .mtlp-shell .mtlp-menu-trigger {
    flex-basis: 43px;
    width: 43px;
    min-width: 43px;
  }
  .mtlp-shell .mtlp-header-logo {
    flex-basis: calc(100% - 129px);
    width: calc(100% - 129px) !important;
    padding-right: 7px;
    padding-left: 7px;
  }
  .mtlp-shell .mtlp-login-action {
    flex-basis: 43px;
    width: 43px;
    min-width: 43px !important;
  }
  .mtlp-shell .mtlp-basket-host {
    flex-basis: 43px;
    width: 43px;
    min-width: 43px !important;
  }
  .mtlp-shell .mtlp-header-search {
    flex-basis: calc(100% - 58px);
    width: calc(100% - 58px) !important;
    padding-right: 0;
    padding-left: 3px;
  }
  .mtlp-shell .mtlp-custom-order-action {
    flex-basis: 58px;
    width: 58px !important;
    min-width: 58px !important;
  }
}

/* ========================================================================== 
 * R1.3 — Header composition aligned to approved desktop/mobile mockup
 * ========================================================================== */

/* Shared header rhythm */
.mtlp-shell > .mtlp-header {
  padding: 0 !important;
  background: var(--karen-primary) !important;
  color: #fff !important;
}
.mtlp-shell .mtlp-mobile-description { display: none; }
.mtlp-shell .mtlp-header-main-row {
  min-height: 138px;
  margin: 0 !important;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(360px, 1fr) minmax(280px, 360px);
  grid-template-areas: "actions search brand";
  align-items: center;
  column-gap: 28px;
  direction: ltr;
}
.mtlp-shell .mtlp-header-logo {
  grid-area: brand;
  width: auto !important;
  max-width: none !important;
  min-width: 0;
  padding: 0 !important;
  float: none !important;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  direction: rtl;
  text-align: right;
}
.mtlp-shell .mtlp-header-logo .mtlp-brand-link {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  text-decoration: none !important;
  text-align: right;
}
.mtlp-shell .mtlp-header-logo .mtlp-brand-link strong {
  display: block;
  margin: 0;
  padding: 0;
  color: #fff !important;
  font-size: 29px;
  font-weight: 900;
  line-height: 1.45;
  text-align: right;
}
.mtlp-shell .mtlp-header-logo .mtlp-brand-link .mtlp-desktop-description {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.52) !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.8;
  text-align: right;
  white-space: normal;
}
.mtlp-shell .mtlp-header-search {
  grid-area: search;
  width: 100% !important;
  max-width: 760px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 !important;
  float: none !important;
}
.mtlp-shell .mtlp-header-search > div.js__header-search-box {
  width: 100%;
  min-height: 48px;
}
.mtlp-shell .mtlp-header-actions {
  grid-area: actions;
  min-height: 68px;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  direction: rtl;
}
.mtlp-shell .mtlp-header-actions .mtlp-header-tool {
  min-width: 74px;
  min-height: 64px;
  padding: 4px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent !important;
}
.mtlp-shell .mtlp-header-actions .mtlp-header-tool:hover,
.mtlp-shell .mtlp-header-actions .mtlp-header-tool:focus {
  background: rgba(255,255,255,.10) !important;
}
.mtlp-shell .mtlp-header-actions .mtlp-header-tool > i,
.mtlp-shell .mtlp-basket-host .btn-show-basket:before {
  font-size: 24px !important;
}
.mtlp-shell .mtlp-header-actions .mtlp-header-tool > span,
.mtlp-shell .mtlp-basket-host .btn-show-basket:after {
  font-size: 12px !important;
  font-weight: 700 !important;
}
.mtlp-shell .mtlp-basket-host,
.mtlp-shell .mtlp-basket-host .btn-show-basket {
  width: 74px !important;
  min-width: 74px !important;
  min-height: 64px !important;
}
.mtlp-shell .mtlp-basket-count {
  top: 1px;
  right: 6px;
  border-color: var(--karen-primary) !important;
}

/* Darker lower navigation bar: utility actions + regular site menu */
.mtlp-shell .mtlp-nav-row {
  min-height: 82px;
  margin: 0 !important;
  background: rgba(0,0,0,.10);
  border-top: 1px solid rgba(255,255,255,.035);
}
.mtlp-shell .mtlp-nav-inner {
  min-height: 82px;
  width: 100%;
  margin: 0;
  padding: 0 22px;
  display: flex;
  align-items: stretch;
  gap: 0;
  direction: rtl;
}
.mtlp-shell .mtlp-utility-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  direction: rtl;
  order: 1;
}
.mtlp-shell .mtlp-utility-action {
  position: relative;
  width: 165px;
  min-height: 82px;
  margin: 0;
  padding: 9px 10px 8px;
  border: 0;
  border-left: 1px solid rgba(255,255,255,.07);
  border-radius: 0;
  background: transparent;
  color: #fff !important;
  text-decoration: none !important;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color .18s ease;
  box-sizing: border-box;
}
.mtlp-shell .mtlp-utility-action:first-child { border-right: 1px solid rgba(255,255,255,.07); }
.mtlp-shell .mtlp-utility-action:hover,
.mtlp-shell .mtlp-utility-action:focus {
  background: rgba(255,255,255,.07);
  color: #fff !important;
  text-decoration: none !important;
  outline: 0;
}
.mtlp-shell .mtlp-utility-action i {
  color: #fff !important;
  font-size: 23px;
  line-height: 1;
}
.mtlp-shell .mtlp-utility-action span {
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  white-space: nowrap;
}
.mtlp-shell .mtlp-desktop-menu-slot {
  order: 2;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.mtlp-shell .mtlp-desktop-menu-slot .mtlp-main-nav,
.mtlp-shell .mtlp-desktop-menu-slot .mtlp-main-menu { width: auto !important; }
.mtlp-shell .mtlp-desktop-menu-slot .mtlp-main-menu {
  display: flex;
  align-items: center;
  margin: 0 !important;
  padding: 0 !important;
}
.mtlp-shell .mtlp-desktop-menu-slot .mtlp-main-menu > li > a {
  padding-top: 29px !important;
  padding-bottom: 29px !important;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
}

/* Basket panel stays anchored under the upper-left basket action. */
@media screen and (min-width: 1200px) {
  .mtlp-shell .mtlp-basket-host .basket-preview-wrap {
    top: 74px !important;
    left: 0 !important;
  }
}

/* --------------------------------------------------------------------------
 * Mobile / tablet
 * -------------------------------------------------------------------------- */
@media screen and (max-width: 1199px) {
  .mtlp-shell > .mtlp-header { padding: 0 !important; }
  .mtlp-shell .mtlp-mobile-description {
    display: block !important;
    min-height: 31px;
    padding: 5px 12px 4px;
    background: rgba(0,0,0,.10);
    color: rgba(255,255,255,.55) !important;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.8;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mtlp-shell .mtlp-header-main-row {
    min-height: 0;
    margin: 0 !important;
    padding: 12px 14px 14px;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "actions brand"
      "search search";
    align-items: center;
    column-gap: 10px;
    row-gap: 14px;
    direction: ltr;
  }
  .mtlp-shell .mtlp-header-logo {
    grid-area: brand;
    width: auto !important;
    max-width: 280px;
    min-width: 0;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    direction: rtl;
  }
  .mtlp-shell .mtlp-menu-trigger {
    flex: 0 0 50px;
    width: 50px;
    min-width: 50px !important;
    height: 60px;
    min-height: 60px !important;
    padding: 3px 2px !important;
    border-radius: 10px;
    background: transparent !important;
  }
  .mtlp-shell .mtlp-menu-trigger:hover,
  .mtlp-shell .mtlp-menu-trigger:focus { background: rgba(255,255,255,.10) !important; }
  .mtlp-shell .mtlp-menu-trigger > i { font-size: 23px !important; }
  .mtlp-shell .mtlp-menu-trigger > span { font-size: 10.5px !important; }
  .mtlp-shell .mtlp-brand-link {
    min-width: 0;
    margin: 0 !important;
  }
  .mtlp-shell .mtlp-header-logo .mtlp-brand-link strong {
    max-width: 205px;
    font-size: 25px;
    line-height: 1.35;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mtlp-shell .mtlp-desktop-description { display: none !important; }

  .mtlp-shell .mtlp-header-actions {
    grid-area: actions;
    min-height: 60px;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    direction: rtl;
  }
  .mtlp-shell .mtlp-header-actions .mtlp-header-tool,
  .mtlp-shell .mtlp-basket-host,
  .mtlp-shell .mtlp-basket-host .btn-show-basket {
    width: 56px !important;
    min-width: 56px !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 3px 2px !important;
    border-radius: 9px !important;
    background: transparent !important;
  }
  .mtlp-shell .mtlp-header-actions .mtlp-header-tool > i,
  .mtlp-shell .mtlp-basket-host .btn-show-basket:before { font-size: 22px !important; }
  .mtlp-shell .mtlp-header-actions .mtlp-header-tool > span,
  .mtlp-shell .mtlp-basket-host .btn-show-basket:after {
    font-size: 10px !important;
    line-height: 1.3 !important;
  }
  .mtlp-shell .mtlp-basket-count {
    top: 0;
    right: 1px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 14px;
  }
  .mtlp-shell .mtlp-header-search {
    grid-area: search;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 6px !important;
    float: none !important;
  }
  .mtlp-shell .mtlp-header-search > div.js__header-search-box {
    width: 100% !important;
    min-height: 54px;
    margin: 0 !important;
  }

  .mtlp-shell .mtlp-nav-row {
    min-height: 78px;
    background: rgba(0,0,0,.10);
  }
  .mtlp-shell .mtlp-nav-inner {
    min-height: 78px;
    padding: 0 !important;
    display: block !important;
  }
  .mtlp-shell .mtlp-utility-actions {
    width: 100%;
    min-height: 78px;
    display: flex !important;
    align-items: stretch;
  }
  .mtlp-shell .mtlp-utility-action {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 78px;
    padding: 8px 4px 7px;
  }
  .mtlp-shell .mtlp-utility-action i { font-size: 22px; }
  .mtlp-shell .mtlp-utility-action span {
    max-width: 100%;
    font-size: 11.5px;
    white-space: normal;
    line-height: 1.45;
  }
  .mtlp-shell .mtlp-desktop-menu-slot { display: none !important; }

  /* Mobile menu still opens the shared two-tab drawer. */
  .mtlp-shell .mtlp-drawer-tabs { display: grid !important; }

  /* Basket preview remains attached to the mobile header instead of bottom nav. */
  .mtlp-shell .mtlp-basket-host .basket-preview-wrap {
    position: fixed !important;
    top: 108px !important;
    right: 12px !important;
    left: 12px !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    z-index: 2147480400 !important;
  }
}

@media screen and (max-width: 480px) {
  .mtlp-shell .mtlp-header-main-row {
    padding-right: 8px;
    padding-left: 8px;
    column-gap: 4px;
  }
  .mtlp-shell .mtlp-header-logo { gap: 6px; }
  .mtlp-shell .mtlp-menu-trigger {
    flex-basis: 44px;
    width: 44px;
    min-width: 44px !important;
  }
  .mtlp-shell .mtlp-header-logo .mtlp-brand-link strong {
    max-width: 174px;
    font-size: 23px;
  }
  .mtlp-shell .mtlp-header-actions { gap: 2px; }
  .mtlp-shell .mtlp-header-actions .mtlp-header-tool,
  .mtlp-shell .mtlp-basket-host,
  .mtlp-shell .mtlp-basket-host .btn-show-basket {
    width: 50px !important;
    min-width: 50px !important;
  }
  .mtlp-shell .mtlp-header-actions .mtlp-header-tool > span,
  .mtlp-shell .mtlp-basket-host .btn-show-basket:after { font-size: 9.5px !important; }
  .mtlp-shell .mtlp-utility-action span { font-size: 10.5px; }
}

/* R1.3 conflict guards for legacy R1.2 mobile declarations. */
@media screen and (max-width: 1199px) {
  .mtlp-shell .mtlp-nav-row { display: block !important; }
  .mtlp-shell .mtlp-utility-actions .mtlp-custom-order-action {
    order: 0 !important;
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    margin-top: 0 !important;
  }
}
.mtlp-shell .mtlp-utility-action[hidden] { display: none !important; }
.mtlp-shell .mtlp-utility-action .mtlp-utility-glyph {
  color: #fff !important;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
}
@media screen and (max-width:1199px) {
  .mtlp-shell .mtlp-utility-action .mtlp-utility-glyph { font-size: 24px; }
}


/* ========================================================================== 
 * R1.4 — Header alignment / typography / search direction / basket behavior
 * ========================================================================== */

/* Buttons and navigation labels use normal weight; brand title remains bold. */
.mtlp-shell .mtlp-header-tool > span,
.mtlp-shell .mtlp-basket-host .btn-show-basket:after,
.mtlp-shell .mtlp-utility-action span,
.mtlp-shell .mtlp-desktop-menu-slot .mtlp-main-menu > li > a,
.mtlp-shell .mtlp-mobile-menu-slot .mtlp-main-menu a,
.mtlp-shell .mtlp-drawer-tab,
.mtlp-shell .mtlp-drawer-close,
.mtlp-shell .mtlp-category-trigger {
  font-weight: 400 !important;
}

/* Persian search flow: text starts from the right, search action remains on the left. */
.mtlp-shell .mtlp-header-search,
.mtlp-shell .mtlp-header-search > .js__header-search-box {
  direction: rtl !important;
}
.mtlp-shell .mtlp-header-search > .js__header-search-box {
  flex-direction: row !important;
}
.mtlp-shell .mtlp-header-search input[type="search"] {
  direction: rtl !important;
  text-align: right !important;
}

/* Basket gets exactly one hover surface: the native trigger itself. */
.mtlp-shell .mtlp-basket-host {
  background: transparent !important;
}
.mtlp-shell .mtlp-basket-host:hover,
.mtlp-shell .mtlp-basket-host:focus,
.mtlp-shell .mtlp-basket-host:focus-within {
  background: transparent !important;
}

@media screen and (min-width: 1200px) {
  /* Symmetric side columns keep Search visually centered while title/actions
     sit against the standard inner header padding. */
  .mtlp-shell .mtlp-header-main-row {
    padding: 18px 28px !important;
    grid-template-columns: minmax(240px, 320px) minmax(360px, 1fr) minmax(240px, 320px) !important;
    column-gap: 28px !important;
  }
  .mtlp-shell .mtlp-header-logo {
    justify-content: flex-start !important; /* RTL flex-start = physical right */
  }
  .mtlp-shell .mtlp-header-actions {
    justify-content: flex-end !important;   /* RTL flex-end = physical left */
  }
  .mtlp-shell .mtlp-nav-inner {
    padding-right: 28px !important;
    padding-left: 28px !important;
  }
}

@media screen and (max-width: 1199px) {
  /* No separate top description strip on mobile. Description returns beneath title. */
  .mtlp-shell .mtlp-mobile-description { display: none !important; }
  .mtlp-shell .mtlp-header-logo {
    justify-content: flex-start !important; /* physical right in RTL */
    align-items: center !important;
  }
  .mtlp-shell .mtlp-menu-trigger {
    order: 0 !important;
  }
  .mtlp-shell .mtlp-brand-link {
    order: 1 !important;
  }
  .mtlp-shell .mtlp-header-logo .mtlp-brand-link .mtlp-desktop-description {
    position: static !important;
    z-index: auto !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    background: transparent !important;
    opacity: 1 !important;
    display: block !important;
    margin-top: 2px !important;
    color: rgba(255,255,255,.52) !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    line-height: 1.55 !important;
    text-align: right !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .mtlp-shell .mtlp-header-actions {
    justify-content: flex-end !important; /* RTL flex-end = physical left */
  }
}

/* ========================================================================== 
 * R1.5 — Basket badge anchor / quick-action alignment / category drawer parity
 * ========================================================================== */

/* Basket badge must be anchored to the basket action itself, never to the page. */
.mtlp-shell .mtlp-basket-host {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  line-height: 1 !important;
}
.mtlp-shell .mtlp-basket-count {
  top: -3px !important;
  right: 2px !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
}

/* Login and basket are two equal quick actions: same box, vertical rhythm and label weight. */
.mtlp-shell .mtlp-header-actions {
  align-items: center !important;
}
.mtlp-shell .mtlp-login-action,
.mtlp-shell .mtlp-basket-host,
.mtlp-shell .mtlp-basket-host .btn-show-basket {
  align-self: center !important;
}
.mtlp-shell .mtlp-login-action > span,
.mtlp-shell .mtlp-basket-host .btn-show-basket:after {
  font-family: inherit !important;
  font-weight: 400 !important;
  font-variation-settings: "wght" 400;
}

/* Category drawer now follows the same flat list language as the Menu tab. */
.mtlp-shell .mtlp-category-drawer-slot .fsh-category-menu-wrap {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}
.mtlp-shell .mtlp-category-drawer-slot .wi-menu,
.mtlp-shell .mtlp-category-drawer-slot .wi-menu ul {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding-left: 0 !important;
  list-style: none !important;
  box-shadow: none !important;
}
.mtlp-shell .mtlp-category-drawer-slot .wi-menu {
  padding: 0 !important;
  background: transparent !important;
}
.mtlp-shell .mtlp-category-drawer-slot .wi-menu li {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
.mtlp-shell .mtlp-category-drawer-slot .wi-menu li > a {
  width: 100% !important;
  min-height: 50px;
  margin: 0 !important;
  padding: 12px 10px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--karen-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--karen-text) !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  text-decoration: none !important;
  white-space: normal !important;
  transition: background-color .16s ease, color .16s ease !important;
}
.mtlp-shell .mtlp-category-drawer-slot .wi-menu li > a:hover,
.mtlp-shell .mtlp-category-drawer-slot .wi-menu li > a:focus {
  padding-right: 10px !important;
  background: rgba(var(--karen-primary-rgb),.06) !important;
  color: var(--karen-primary) !important;
  text-decoration: none !important;
  outline: 0 !important;
}
.mtlp-shell .mtlp-category-drawer-slot .wi-menu li > a:before {
  flex: 0 0 auto;
  padding-left: 7px !important;
  color: var(--karen-primary) !important;
}
.mtlp-shell .mtlp-category-drawer-slot .wi-menu li.active > a,
.mtlp-shell .mtlp-category-drawer-slot .wi-menu li.wi-active > a {
  background: rgba(var(--karen-primary-rgb),.06) !important;
  color: var(--karen-primary) !important;
}
.mtlp-shell .mtlp-category-drawer-slot .wi-menu li > ul {
  border: 0 !important;
  border-right: 2px solid rgba(var(--karen-primary-rgb),.18) !important;
  background: var(--karen-surface-muted) !important;
}
.mtlp-shell .mtlp-category-drawer-slot .wi-menu li > ul li > a {
  min-height: 44px;
  padding: 9px 16px !important;
}
.mtlp-shell .mtlp-category-drawer-slot .wi-menu li > ul li > a:hover,
.mtlp-shell .mtlp-category-drawer-slot .wi-menu li > ul li > a:focus {
  padding-right: 16px !important;
}

@media screen and (max-width: 1199px) {
  .mtlp-shell .mtlp-basket-count {
    top: -2px !important;
    right: 0 !important;
  }
  .mtlp-shell .mtlp-header-actions .mtlp-header-tool,
  .mtlp-shell .mtlp-basket-host,
  .mtlp-shell .mtlp-basket-host .btn-show-basket {
    align-self: center !important;
  }
}


/* ==========================================================================
 * R1.6 — Account label specificity fix
 * ========================================================================== */
/* R1.3 had a more-specific !important selector for generic header-tool labels.
   Match/exceed that specificity so Account really resolves to normal weight. */
html body .mtlp-shell .mtlp-header-actions .mtlp-header-tool.mtlp-login-action > span {
  font-family: inherit !important;
  font-weight: normal !important;
  font-variation-settings: "wght" 400 !important;
}
