/* ========== مگامنو وسط‌چین ========== */
.menu-item {
  position: static;
}

.megamenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  margin-top: 0.5rem;
  max-width: 1200px;
  width: calc(100vw - 40px); /* عرض 100% منهای padding */
}

.menu-item:hover .megamenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* هدر باید position: relative باشه */
header {
  position: relative;
}

/* ========== ریسپانسیو ========== */
@media (min-width: 1200px) {
  .megamenu {
    width: 1200px; /* عرض ثابت برای صفحات بزرگ */
  }
}

@media (max-width: 1199px) {
  .megamenu {
    width: calc(100vw - 40px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
  }

  .menu-item:hover .megamenu {
    transform: translateX(-50%) translateY(0);
  }

  /* مخفی کردن منوی دسکتاپ و نمایش همبرگر */
  nav.lg\:flex {
    display: none !important;
  }

  button.lg\:hidden {
    display: block !important;
  }
}
.chevron {
  transition: transform 0.2s ease;
}
.menu-item:hover .chevron {
  transform: rotate(180deg);
}

.category-item {
  min-height: 56px;
}

/* ========== منوی خدمات تک‌ستونه ========== */
.services-menu {
  position: absolute;
  top: 100%;
  right: 0;
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  margin-top: 0.5rem;
}

.services-item:hover .services-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.services-item:hover .chevron {
  transform: rotate(180deg);
}
.menu-item:hover button,
.services-item:hover button {
  box-shadow: inset 0 -2px 0 #16a34a;
}

/*======*/
/* تنظیمات اضافه برای Swiper */
.heroSwiper {
  direction: ltr;
}
.heroSwiper .swiper-slide {
  direction: rtl;
}
.swiper-pagination-bullet-active {
  background-color: #2d6a4f !important;
}
.swiper-button-next,
.swiper-button-prev {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  width: 40px;
  height: 40px;
}
.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 16px;
  font-weight: bold;
}
@media (max-width: 768px) {
  .swiper-button-next,
  .swiper-button-prev {
    display: none;
  }
}
.rotate-180 {
  transform: rotate(180deg);
}
