/* ============================================================
   هدر و منو — الهام از dmroom.agency
   ============================================================ */

/* هدر شفاف روی هیرو، جامد پس از اسکرول */
.gpy-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: transparent;
  border-bottom: 1px solid transparent;
  backdrop-filter: none;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}
.gpy-site-header.is-scrolled,
body:not(.gpy-has-homepage) .gpy-site-header {
  background: rgba(14, 28, 48, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
body.gpy-preloader-active .gpy-site-header {
  opacity: 0;
  pointer-events: none;
}
body.gpy-preloader-done .gpy-site-header {
  opacity: 1;
  transition: opacity 0.4s ease 0.1s, background 0.35s ease, border-color 0.35s ease;
}

/* فاصله محتوا از هدر ثابت */
.gpy-site-main {
  padding-top: 72px;
}
body.gpy-has-homepage .gpy-site-main {
  padding-top: 0;
}

.gpy-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 2rem);
}

.gpy-branding { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.gpy-site-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
  margin: 0;
  letter-spacing: 0.02em;
}
.gpy-site-title a { color: inherit; }
.gpy-site-desc { display: none; }

/* منوی افقی مرکز */
.gpy-main-nav {
  display: flex;
  justify-content: center;
  min-width: 0;
}
.gpy-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}
.gpy-menu-item {
  position: relative;
}
.gpy-menu-item__inner {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.gpy-menu-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.gpy-menu-link:hover,
.gpy-menu-item--current > .gpy-menu-item__inner > .gpy-menu-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.gpy-menu-caret {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.25s ease, color 0.2s;
  pointer-events: none;
}
.gpy-menu-item--has-children:hover > .gpy-menu-item__inner .gpy-menu-caret,
.gpy-menu-item--has-children.is-open > .gpy-menu-item__inner .gpy-menu-caret {
  transform: rotate(180deg);
  color: var(--gpy-orange-glow, #ff9a5c);
}

/* پنل زیرمنو — تیره مثل dmroom */
.gpy-submenu {
  list-style: none;
  margin: 0;
  padding: 0.65rem;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 50%;
  transform: translateX(50%) translateY(8px);
  min-width: 220px;
  background: #1b1c1f;
  border: 1px solid #2c2c2c;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
  z-index: 100;
}
.gpy-menu-item--has-children:hover > .gpy-submenu,
.gpy-menu-item--has-children.is-open > .gpy-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(50%) translateY(0);
}
.gpy-submenu .gpy-menu-link {
  width: 100%;
  border-radius: 10px;
  font-size: 0.88rem;
  padding: 0.65rem 0.85rem;
  color: rgba(240, 244, 250, 0.88);
}
.gpy-submenu .gpy-menu-link:hover {
  background: #131313;
  color: #fff;
}
.gpy-submenu--depth-1 {
  top: 0;
  right: 100%;
  transform: translateX(-8px);
  margin-right: 0.35rem;
}
.gpy-submenu .gpy-menu-item--has-children:hover > .gpy-submenu--depth-1 {
  transform: translateX(0);
}

/* سمت چپ هدر: منوی موبایل + دکمه مشاوره (ثابت، خارج از منو) */
.gpy-header-end {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  justify-self: end;
}
.gpy-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  background: linear-gradient(135deg, var(--gpy-orange, #ff6b2c), var(--gpy-orange-dark, #e05520));
  border: 1px solid var(--gpy-orange-dark, #e05520);
  box-shadow: 0 8px 32px rgba(255, 107, 44, 0.4);
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.gpy-header-cta:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(255, 107, 44, 0.5);
  background: linear-gradient(135deg, var(--gpy-orange-glow, #ff9a5c), var(--gpy-orange, #ff6b2c));
}

/* دکمه همبرگری موبایل — مشابه dmroom */
.gpy-nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.gpy-nav-toggle:hover,
.gpy-nav-toggle:focus-visible { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 107, 44, 0.5); }
.gpy-nav-toggle svg { display: block; }
.gpy-nav-toggle .gpy-icon-close { display: none; }
.gpy-nav-toggle[aria-expanded="true"] .gpy-icon-open { display: none; }
.gpy-nav-toggle[aria-expanded="true"] .gpy-icon-close { display: block; }

/* سربرگ منوی موبایل + دکمه بستن (فقط موبایل) */
.gpy-mobile-menu-head { display: none; }
.gpy-mobile-menu-cta { display: none; }

/* موبایل — منوی تمام‌صفحه تیره */
@media (max-width: 1024px) {
  .gpy-header-inner {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    padding: 0.85rem clamp(1rem, 4vw, 1.5rem);
  }
  .gpy-nav-toggle { display: inline-flex; }
  .gpy-header-end {
    position: relative;
    z-index: 10005;
  }
  .gpy-nav-toggle {
    position: relative;
    z-index: 10006;
    touch-action: manipulation;
  }
  .gpy-header-end .gpy-header-cta {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
  }

  .gpy-main-nav {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: #0a1525;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0 1.25rem 2rem;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  }
  body > .gpy-main-nav.gpy-nav-portal,
  .gpy-main-nav.gpy-nav-portal {
    z-index: 100000;
  }
  .gpy-main-nav.gpy-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  /* سربرگ ثابت منو با دکمه بستن واضح */
  .gpy-mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 3;
    margin: 0 -1.25rem 1rem;
    padding: max(1rem, env(safe-area-inset-top, 0px)) 1.25rem 1rem;
    background: rgba(3, 3, 3, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .gpy-mobile-menu-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
  }
  .gpy-nav-close {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 107, 44, 0.5);
    background: rgba(255, 107, 44, 0.14);
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s, transform 0.15s;
  }
  .gpy-nav-close:hover,
  .gpy-nav-close:active { background: var(--gpy-orange, #ff6b2c); transform: scale(0.97); }
  .gpy-nav-close svg { display: block; }

  .gpy-menu {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    flex: 1 1 auto;
    position: relative;
    z-index: 2;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .gpy-main-nav .gpy-menu-link,
  .gpy-main-nav .gpy-menu-label {
    color: #fff;
  }
  .gpy-menu-item__inner { width: 100%; }
  .gpy-menu-link {
    padding: 1.1rem 0.35rem;
    font-size: 1.05rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex: 1;
  }
  .gpy-menu-caret {
    margin-inline-start: auto;
    padding: 0.6rem;
    color: var(--gpy-orange-glow, #ff9a5c);
  }
  .gpy-submenu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
    min-width: 0;
    width: 100%;
    margin: 0 0 0.5rem;
    padding: 0.35rem 0.35rem 0.35rem 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    box-shadow: none;
    border-radius: 12px;
  }
  .gpy-submenu .gpy-menu-link {
    font-size: 0.95rem;
    padding: 0.85rem 0.5rem;
  }
  .gpy-menu-item--has-children.is-open > .gpy-submenu {
    display: block;
  }

  /* دکمه مشاوره داخل منوی موبایل */
  .gpy-mobile-menu-cta {
    display: inline-flex;
    width: 100%;
    margin-top: 1.75rem;
    padding: 1rem;
    font-size: 1rem;
  }
}

@media (max-width: 1024px) {
  body.gpy-nav-open {
    overflow: hidden;
  }
}
