/* ==========================================================
   ULTRA-MODERN GLASSMORPHIC NAVBAR & LUXURY MEGA-MENU (RTL)
   ========================================================== */

:root {
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-border: rgba(226, 232, 240, 0.6);
  --primary-accent: #f38d2d;
  --primary-glow: rgba(243, 141, 45, 0.2);
  --text-main: #0f172a;
  --text-sub: #64748b;
  --card-bg: #f8fafc;
  --card-hover-bg: #ffffff;
}

#menu {
  background: var(--nav-bg) !important;
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid var(--nav-border);
  border-radius: 20px;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
  padding: 8px 12px !important;
  direction: rtl;
  z-index: 1000;
  max-width: 95%;
  margin: 0 auto !important;
  transition: all 0.4s ease;
}

/* لوگو با افکت سه بعدی ملایم */
.brand-wrapper {
  display: inline-flex;
  align-items: center;
  padding: 4px;
}

#menu #brand {
  width: 42px !important;
  height: 42px !important;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.06));
}

#menu #brand:hover {
  transform: scale(1.1) rotate(-4deg);
}

/* لینک‌های منو */
#menu .navbar-nav {
  align-items: center;
  gap: 6px;
  padding-right: -40px;
}

#menu .nav-item {
  position: relative;
}

#menu .nav-item .nav-link {
  color: var(--text-main) !important;
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 16px !important;
  border-radius: 12px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

#menu .nav-item .nav-link:hover {
  color: var(--primary-accent) !important;
  background-color: rgba(2, 132, 199, 0.06);
}

/* ==========================================================
   مگامنوهای فوق حرفه‌ای و شناور (Floating Dropdowns)
   ========================================================== */

.mega-menu,
.pishtaz-menu,
.learn-menu,
.about-menu {
  position: absolute;
  top: calc(100% + 18px);
  right: 0;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 30px 60px -15px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(226, 232, 240, 0.8);
  padding: 30px;
  display: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1050;
}

.mega-menu { width: 1000px; }
.pishtaz-menu { width: 600px; }
.learn-menu { width: 900px; }
.about-menu { width: 700px; }

/* نمایش نرم مگامنو هنگام هاور */
#product-menu:hover .mega-menu,
#pishtaz-menu:hover .pishtaz-menu,
#learn-menu:hover .learn-menu,
#about-menu:hover .about-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* کارت‌های داخلی محصولات و بخش‌ها (مدرن و فلت) */
.border-product {
  background-color: var(--card-bg);
  border: 1px solid #edf2f7;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  height: 100%;
}

.border-product:hover {
  background-color: var(--card-hover-bg);
  border-color: var(--primary-accent);
  box-shadow: 0 12px 30px -8px var(--primary-glow);
  transform: translateY(-3px);
}

.img-product {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  transition: transform 0.3s ease;
}

.border-product:hover .img-product {
  /* transform: scale(1.08); */
  /* border-color: var(--primary-accent); */
}

.product-info {
  display: flex;
  flex-direction: column;
}

.product-info .title-sub-menu {
  position: relative;
  width: fit-content;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
  transition: color 0.2s ease;
  line-height: 2 !important;
}

.border-product:hover .product-info .title-sub-menu {
  color: var(--primary-accent);
}

.product-info .title-sub-menu::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 100%;
  height: 40%;
  background-color: var(--primary-color);
  opacity: 0.15;
}

.product-info .subtitle {
  font-size: 0.72rem;
  color: var(--text-sub);
  margin-top: 2px;
  font-family: monospace;
  letter-spacing: 0.3px;
}

/* فوتر توضیحات مگامنوها */
.mega-footer-desc {
  font-size: 0.83rem;
  color: #475569;
  line-height: 1.8;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  padding: 12px 18px;
  border-radius: 12px;
  margin-top: 22px;
  display: flex;
  align-items: center;
}

/* ==========================================================
   دکمه اکشن (راهنمای انتخاب رله) با افکت نئونی مدرن
   ========================================================== */

.parent-link {
  display: flex;
  align-items: center;
}

#guid-link {
  background: linear-gradient(135deg, #f38d2d 0%, #f38d2d 100%);
  color: #ffffff !important;
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  box-shadow: 0 8px 20px -4px rgba(243, 141, 45, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#guid-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(243, 141, 45, 0.6);
  background: linear-gradient(135deg, #f38d2d 0%, #f38d2d 100%);
}

.glow-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 0.75rem;
}

/* ایجاد پل نامرئی برای پر کردن فاصله بین لینک و مگامنو بدون تغییر ظاهر */
#menu .nav-item::after {
  content: "";
  position: absolute;
  bottom: -18px; /* دقیقاً به اندازه فاصله ایجاد شده */
  left: 0;
  width: 100%;
  height: 18px;
  background: transparent;
  z-index: 1040;
}

/* ==========================================================
   CUSTOM MOBILE APP-STYLE DRAWER & FLOATING HEADER
   ========================================================== */

:root {
  --pish-primary: #f38d2d;
  --pish-primary-glow: rgba(243, 141, 45, 0.25);
  --pish-bg-glass: rgba(255, 255, 255, 0.88);
  --pish-text-dark: #0f172a;
  --pish-text-sub: #64748b;
  --pish-border: rgba(226, 232, 240, 0.8);
}

/* Header Bar */
.pish-mobile-header {
  position: sticky;
  top: 12px;
  z-index: 1020;
  padding: 0 14px;
  direction: rtl;
}

.pish-mobile-header-inner {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 18px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 15px 35px -10px rgba(15, 23, 42, 0.08);
}

/* Brand & Logo Style */
.pish-mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.pish-mobile-brand:hover {
  color: var(--pish-primary);
  text-decoration: none;
}

.pish-mobile-brand:hover .pish-brand-logo-wrapper {
  border-color: var(--pish-primary);
}

.pish-brand-logo-wrapper {
  width: 38px;
  height: 38px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.pish-brand-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.pish-brand-texts {
  display: flex;
  flex-direction: column;
}

.pish-brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
  line-height: 1.7;
}

.pish-brand-sub {
  font-size: 0.68rem;
  color: #64748b;
  letter-spacing: 0.2px;
  margin-top: 2px;
}

/* Modern Animated Hamburger Button */
.pish-hamburger-btn {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.pish-hamburger-btn:hover {
  background: #ffffff;
  border-color: #f38d2d;
  box-shadow: 0 6px 15px rgba(243, 141, 45, 0.15);
  transform: translateY(-1px);
}

.pish-hamburger-btn:active {
  transform: scale(0.96);
}

.pish-hamburger-box {
  width: 18px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.pish-hamburger-line {
  display: block;
  height: 2px;
  width: 100%;
  background: #0f172a;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.pish-hamburger-btn:hover .pish-hamburger-line {
  background: #f38d2d;
}

.pish-hamburger-line.line-1 { width: 100%; }
.pish-hamburger-line.line-2 { width: 75%; }
.pish-hamburger-line.line-3 { width: 100%; }

.pish-hamburger-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.3px;
}

.pish-hamburger-btn:hover .pish-hamburger-text {
  color: #f38d2d;
}

/* Backdrop Overlay */
.pish-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1080;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.pish-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.pish-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background: #ffffff;
  z-index: 1090;
  box-shadow: -10px 0 30px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  direction: rtl;
  /* در حالت عادی کاملاً به سمت راست و خارج از صفحه هدایت می‌شود */
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pish-mobile-drawer.active {
  /* هنگام فعال شدن به محل اصلی خود برمی‌گردد */
  transform: translateX(0);
}

/* Drawer Header */
.pish-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pish-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--pish-text-dark);
}

.pish-title-badge {
  width: 32px;
  height: 32px;
  background: rgba(243, 141, 45, 0.12);
  color: var(--pish-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pish-drawer-close-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pish-drawer-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Drawer Body & Accordions */
.pish-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.pish-menu-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pish-acc-item {
  border-radius: 12px;
  overflow: hidden;
}

.pish-acc-trigger {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s ease;
}

.pish-acc-trigger:hover,
.pish-acc-item.active .pish-acc-trigger {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.pish-acc-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--pish-text-dark);
}

.pish-acc-arrow {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.3s ease;
}

.pish-acc-item.active .pish-acc-arrow {
  transform: rotate(-90deg);
  color: var(--pish-primary);
}

.pish-acc-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out, padding 0.35s ease-out;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 8px;
}

.pish-acc-item.active .pish-acc-content {
  max-height: 400px; /* افزایش ارتفاع برای جلوگیری از برش خوردن لیست‌های طولانی */
  padding: 8px 8px 4px 8px;
}

.pish-sub-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: #475569;
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.pish-sub-link:hover {
  background: #f8fafc;
  color: var(--pish-primary);
  padding-right: 16px;
  text-decoration: none;
}

.pish-single-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--pish-text-dark);
  text-decoration: none;
  transition: all 0.2s ease;
}

.pish-single-link:hover {
  background: #f1f5f9;
  color: var(--pish-primary);
}

/* Footer CTA */
.pish-drawer-footer {
  padding: 16px;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}

.pish-cta-button {
  background: linear-gradient(135deg, #f38d2d 0%, #e07b1e 100%);
  color: #ffffff !important;
  text-decoration: none;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 8px 20px -4px var(--pish-primary-glow);
  transition: all 0.2s ease;
}

.pish-cta-button:active {
  transform: scale(0.98);
}
