/* فقط قالب هدر جدید Elementor */
.stratix-header-v2 {
  --mh2-ink: #0c0d0e;
  --mh2-paper: #f5f2f0;
  --mh2-gold: #8b7355;
  position: relative;
  z-index: 1000;
  color: var(--mh2-ink);
  background: #fff;
  font-family: "BrownLLWeb", sans-serif;
}

.stratix-header-v2 .mh2-main {
  position: relative;
  min-height: 53px !important;
  padding: 0 max(5vw, calc((100% - 1080px) / 2));
  background: rgba(245, 242, 240, .85);
  justify-content: space-between !important;
}

.stratix-header-v2 .mh2-logo {
  position: static;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 145px;
  height: 53px;
  margin: 0;
  transform: none;
  pointer-events: auto;
}

.stratix-header-v2 .mh2-logo img {
  width: 145px !important;
  max-width: 145px !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain;
}
.stratix-header-v2 .mh2-nav {
  display: flex !important;
  flex: 0 0 calc((100% - 145px) / 2) !important;
  width: calc((100% - 145px) / 2) !important;
  max-width: calc((100% - 145px) / 2) !important;
  min-width: 0;
}
.stratix-header-v2 .mh2-main { flex-wrap: nowrap !important; }
.stratix-header-v2 .mh2-logo { flex: 0 0 145px !important; max-width: 145px !important; }
.stratix-header-v2 .mh2-nav--right {
  justify-content: flex-start;
  box-sizing: border-box;
  padding-left: 27.5px;
}
.stratix-header-v2 .mh2-nav--left {
  justify-content: flex-end;
  box-sizing: border-box;
  padding-right: 43.5px;
}

.stratix-header-v2 .e-n-menu-heading {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100% !important;
  gap: 0 !important;
  direction: rtl;
}

.stratix-header-v2 .e-n-menu-heading > .e-n-menu-item {
  display: flex;
  min-width: 0;
  justify-content: center;
}

.stratix-header-v2 .e-n-menu-heading > .e-n-menu-item > .e-n-menu-title {
  padding: 0 !important;
  color: var(--mh2-ink) !important;
  font-family: "BrownLLWeb", sans-serif !important;
  font-size: 11px !important;
  font-weight: 300 !important;
  line-height: 13.2px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 53px;
  letter-spacing: 0 !important;
  transition: color .2s ease, opacity .2s ease;
}

.stratix-header-v2 .e-n-menu-heading > .e-n-menu-item > .e-n-menu-title:hover,
.stratix-header-v2 .e-n-menu-heading > .e-n-menu-item > .e-n-menu-title:focus-visible,
.stratix-header-v2 .e-n-menu-heading > .e-n-menu-item > .e-n-menu-title.e-active {
  color: var(--mh2-ink) !important;
}

/* خط طلاییِ مرجع: تنها روی هاور یا آیتم باز دیده می‌شود. */
.stratix-header-v2 .e-n-menu-title-container { position: relative; }
.stratix-header-v2 .e-n-menu-title-container::before {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-start: -26px;
  width: 16px;
  height: 2px;
  background: #c2a066;
  transform: translateY(-50%) scaleX(0);
  transform-origin: center;
  transition: transform .25s cubic-bezier(.68, 0, .32, 1.6);
}
.stratix-header-v2 .e-n-menu-title:hover .e-n-menu-title-container::before,
.stratix-header-v2 .e-n-menu-title:has(.e-n-menu-dropdown-icon[aria-expanded="true"]) .e-n-menu-title-container::before {
  transform: translateY(-50%) scaleX(1);
}

.stratix-header-v2 .mh2-primary .e-n-menu-heading > .e-n-menu-item:nth-child(4) {
  width: 0;
  margin: 0;
  overflow: visible;
}
.stratix-header-v2 .mh2-primary .e-n-menu-heading > .e-n-menu-item:nth-child(4) > .e-n-menu-title { display: none !important; }
.stratix-header-v2 .mh2-primary .e-n-menu-dropdown-icon i,
.stratix-header-v2 .mh2-primary .e-n-menu-dropdown-icon svg { display: none !important; }
.stratix-header-v2 .mh2-primary .e-n-menu-dropdown-icon {
  width: 13px !important;
  height: 13px !important;
  margin-inline-start: 2px !important;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 13 13'%3E%3Ccircle cx='6.5' cy='6.5' r='5.5' fill='none' stroke='%23000'/%3E%3Cpath d='m4.3 5.2 2.2 2 2.2-2' fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.2'/%3E%3C/svg%3E") center/contain no-repeat !important;
}

.stratix-header-v2 .mh2-search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px !important;
  min-width: 32px !important;
  height: 53px;
  flex: 0 0 32px !important;
  margin-inline-start: 14px;
  color: var(--mh2-ink);
  cursor: pointer;
}
.stratix-header-v2 .mh2-search-trigger .elementor-icon { font-size: 17px; transition: color .2s ease, transform .2s ease; }
.stratix-header-v2 .mh2-search-trigger:hover .elementor-icon { color: var(--mh2-gold); transform: scale(1.08); }

/* جستجو در مرجع از نوار مشکی باز می‌شود؛ دو آیکن سفیدِ باقی‌مانده نباید همیشه دیده شوند. */
.stratix-header-v2 .mh2-main .mh2-search-trigger,
.stratix-header-v2 .mh2-main .mo-search-close { display: none !important; }
.stratix-header-v2.mh2-expanded.mh2-search-open .mh2-main .mo-search-close {
  display: block !important;
  position: absolute;
  inset-inline-start: max(5vw, calc((100% - 1080px) / 2));
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
}

.stratix-header-v2 .e-n-menu-content {
  z-index: 2;
  border: 0 !important;
  background: var(--mh2-paper) !important;
  box-shadow: none !important;
}

/* Elementor همهٔ پنل‌های Nested Menu را در DOM نگه می‌دارد. پنلِ بسته باید
   واقعاً از لایه‌بندی خارج شود؛ وگرنه پنل جستجوی بسته روی مگامنوی محصولات
   قرار می‌گیرد و فقط یک بوم خالی دیده می‌شود. */
.stratix-header-v2 .mh2-primary .e-n-menu-content:not(.e-active) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.stratix-header-v2 .mh2-primary .e-n-menu-content.e-active {
  display: flex !important;
  visibility: visible !important;
}

.stratix-header-v2 .mh2-primary .e-n-menu-content {
  position: fixed !important;
  top: 53px !important;
  right: auto !important;
  left: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  min-height: calc(100vh - 53px) !important;
  transform: none !important;
}

body.admin-bar .stratix-header-v2 .mh2-primary .e-n-menu-content {
  top: 85px !important;
  min-height: calc(100vh - 85px) !important;
}

.stratix-header-v2 .mh2-search-panel { min-height: calc(100vh - 53px); padding: clamp(36px, 5vw, 72px) max(5vw, 48px) !important; }
.stratix-header-v2 .mh2-search-panel .elementor-search-form__container { min-height: 58px; }
.stratix-header-v2 .mh2-search-panel input {
  border: 1px solid var(--mh2-ink) !important;
  border-radius: 0 !important;
  color: var(--mh2-ink) !important;
  background: #fff !important;
  font-family: "BrownLLWeb", sans-serif !important;
}
.stratix-header-v2 .mh2-search-panel button { border-radius: 0 !important; background: var(--mh2-ink) !important; }
.stratix-header-v2 .mh2-search-panel .elementor-post__title { font-family: "BrownLLWeb", sans-serif !important; }
.stratix-header-v2 .mh2-search-panel .elementor-post__title a:hover { color: var(--mh2-gold) !important; }
.stratix-header-v2 .mh2-search-empty { display: none; }
.stratix-header-v2 .mh2-search-results.is-empty .mh2-search-empty { display: block; }
.stratix-header-v2 .mh2-search-results.is-empty .elementor-posts-container { display: none; }
.stratix-header-v2 .mo-search-input { position: relative; }
.stratix-header-v2 .mh2-search-suggestions {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 2;
  display: none;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(12, 13, 14, .18);
  border-top: 0;
  box-shadow: 0 10px 24px rgba(12, 13, 14, .12);
}
.stratix-header-v2 .mh2-search-suggestions.is-open { display: block; }
.stratix-header-v2 .mh2-search-suggestions button {
  display: block;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  background: transparent;
  color: var(--mh2-ink);
  font: 300 12px/15px "BrownLLWeb", sans-serif;
  text-align: start;
  cursor: pointer;
}
.stratix-header-v2 .mh2-search-suggestions button:hover { background: var(--mh2-paper); }

.stratix-header-v2 .mh2-utility {
  min-height: 40px !important;
  padding: 0 max(5vw, calc((100% - 1080px) / 2)) !important;
  background: var(--mh2-ink) !important;
  transition: transform .35s cubic-bezier(.2, 1, .5, 1);
}
.stratix-header-v2 .mh2-utility .elementor-button {
  padding: 0 !important;
  color: #fff !important;
  background: transparent !important;
  font-family: "BrownLLWeb", sans-serif !important;
  font-size: 10px !important;
  font-weight: 300 !important;
  line-height: 15px !important;
  letter-spacing: 1px !important;
}
.stratix-header-v2 .mh2-utility .elementor-button:hover { color: var(--mh2-gold) !important; }
.stratix-header-v2 .mh2-utility > .e-con:nth-child(2) > .e-con-inner {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 24px !important;
  direction: ltr;
}
.stratix-header-v2 .mh2-utility > .e-con:nth-child(2) .elementor-widget { width: auto !important; }
.stratix-header-v2 .mh2-utility .elementor-button { direction: rtl; }
.stratix-header-v2 .mh2-language-trigger .elementor-button { direction: ltr; }

/* حالت باز همان هندسهٔ هدر مرجع را دارد: پنل زیر نوار سفید و نوار مشکی در انتهای نمایشگر. */
@media (min-width: 768px) {
  html.mh2-menu-open,
  body.mh2-menu-open { overflow: hidden !important; }

  .stratix-header-v2.mh2-expanded {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    background: var(--mh2-paper) !important;
  }
  body.admin-bar .stratix-header-v2.mh2-expanded {
    top: 32px !important;
    height: calc(100dvh - 32px) !important;
    min-height: calc(100dvh - 32px) !important;
  }
  .stratix-header-v2.mh2-expanded .mh2-main { z-index: 10002; flex: 0 0 53px !important; }
  .stratix-header-v2.mh2-expanded .mh2-utility {
    position: fixed !important;
    top: 53px !important;
    right: 0 !important;
    left: 0 !important;
    z-index: 10003 !important;
    transform: translateY(0);
  }
  .stratix-header-v2.mh2-expanded.mh2-expanded--settled .mh2-utility {
    transform: translateY(calc(100dvh - 93px));
  }
  body.admin-bar .stratix-header-v2.mh2-expanded .mh2-utility { top: 85px !important; }
  body.admin-bar .stratix-header-v2.mh2-expanded.mh2-expanded--settled .mh2-utility {
    transform: translateY(calc(100dvh - 125px));
  }
  .stratix-header-v2.mh2-expanded .mh2-primary .e-n-menu-content.e-active {
    position: fixed !important;
    top: 53px !important;
    right: 0 !important;
    bottom: 40px !important;
    left: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    z-index: 10001 !important;
    overflow: hidden !important;
    background: var(--mh2-paper) !important;
  }
  body.admin-bar .stratix-header-v2.mh2-expanded .mh2-primary .e-n-menu-content.e-active { top: 85px !important; }
  .stratix-header-v2.mh2-expanded .mh2-primary .e-n-menu-content.e-active > .e-con {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    background: var(--mh2-paper) !important;
  }
  .stratix-header-v2.mh2-expanded .mo-bed-panel,
  .stratix-header-v2.mh2-expanded .mh2-search-panel { background: var(--mh2-paper) !important; }
  .stratix-header-v2.mh2-expanded .mo-bed-hero,
  .stratix-header-v2.mh2-expanded .mo-bed-grid {
    width: min(1080px, calc(100% - 10vw)) !important;
    max-width: min(1080px, calc(100% - 10vw)) !important;
    margin-inline: auto !important;
  }
}

@media (max-width: 1024px) {
  .stratix-header-v2 .mh2-main { padding: 0 20px; }
  .stratix-header-v2 .mh2-nav { flex-basis: 40% !important; width: 40% !important; max-width: 40% !important; }
  .stratix-header-v2 .mh2-logo { width: 126px; }
}

@media (max-width: 767px) {
  .stratix-header-v2 .mh2-main { min-height: 53px !important; }
  .stratix-header-v2 .mh2-logo { flex-basis: 118px !important; width: 118px; max-width: 118px !important; }
  .stratix-header-v2 .mh2-nav--left,
  .stratix-header-v2 .mh2-utility { display: none !important; }
  .stratix-header-v2 .mh2-search-trigger { margin-inline-start: 0; }
  .stratix-header-v2 .e-n-menu-content { background: var(--mh2-paper) !important; }
}
