/* ==========================================================================
   1. Base & Reset (جلوگیری از آب رفتن و به هم ریختگی)
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: hidden;
  width: 100%;
  direction: rtl; /* برای چیدمان درست فارسی */
  font-family: var(--font-body)
}

/* ==========================================================================
   2. Main Header (Desktop)
   ========================================================================== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 6%;
  background-color: #fff;
  box-shadow: 0 4px 20px rgb(0 0 0 / 7%);
  position: sticky;
  top: 0;
  z-index: 2000;
}

.logo img {
  height: 40px;
  width: auto;
}

.nav-menu ul {
  display: flex;
  gap: 25px;
  list-style: none;
}

.nav-menu a {
  text-decoration: none;
  color: var(--co3);
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  padding-bottom: 5px;
  transition: 0.3s;
}

/* افکت خط طلایی متحرک زیر لینک‌ها */
.nav-menu ul li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background-color: var(--co1);
  transition: width 0.3s ease;
}

.nav-menu ul li a:hover::after,
.nav-menu ul li a.active::after {
  width: 100%;
}

/* ==========================================================================
   3. Hamburger & Close Button (X Effect)
   ========================================================================== */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 6px;
  z-index: 10000; /* همیشه روی منو باشد */
  position: relative;
}

.menu-toggle .bar {
  width: 28px;
  height: 3px;
  background-color: var(--co3);
  transition: all 0.3s ease-in-out;
  border-radius: 2px;
}

/* وقتی منو باز است (ضربدر سفید) */
.menu-toggle.is-active .bar {
  background-color: #fff !important;
}

.menu-toggle.is-active .bar:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.menu-toggle.is-active .bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ==========================================================================
   4. Mobile Menu & Social Icons (Fixed)
   ========================================================================== */
@media (width <= 992px) {
  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    inset: 1px;
    background-color: rgb(26 26 26 / 98%); /* تم تیره لوکس */
    backdrop-filter: blur(15px);
    z-index: 9000;
    opacity: 0;
    visibility: hidden;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    padding-top: 30px;
  }

  .nav-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-menu ul {
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
  }

  .nav-menu ul li a {
    color: #fff;
    font-size: 1.2rem;
  }

  /* آیکون‌های اجتماعی در پایین منوی موبایل */
  .menu-socials {
    display: flex !important;
    gap: 25px;
    padding-top: 25px;
    border-top: 1px solid rgb(255 255 255 / 10%);
  }

  .social-item {
    display: block !important;
    width: 35px !important;
    height: 35px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    filter: brightness(0) invert(1); /* سفید کردن آیکون‌های تیره */
    transition: 0.3s;
  }

  /* حذف خط زیرین برای آیکون‌ها */
  .social-item::after {
    display: none !important;
  }
}

/* ست کردن تصاویر آیکون‌ها از متغیرها */
.instagram {
  background-image: var(--logo-instagram) !important;
}

.telegram {
  background-image: var(--logo-telegram) !important;
}

.whatsapp {
  background-image: var(--logo-whatsapp) !important;
}

/* ==========================================================================
   5. Actions & Footer (بازگردانی استایل‌های قبلی)
   ========================================================================== */
.header-actions .cta-button {
  padding: 8px 18px;
  background-color: var(--co1);
  color: var(--co3) !important;
  font-weight: bold;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.2s;
}

@media (width <= 992px) {
  .hide-on-mobile {
    display: none;
  }
}

/* اگر استایل‌های فوترت را داشتی، اینجا اضافه شده‌اند تا پاک نشوند */
.main-footer {
  background-color: var(--co3);
  color: #fff;
  padding: 40px 0;
  margin-top: 50px;
}
