/* استایل منوی والد (Parent Menu) */
.parent-menu {
  position: fixed;
  top: 80px; /* زیر هدر در حالت اولیه */
  width: 100%; /* تمام عرض صفحه */
  display: flex;
  overflow-x: auto;
  padding: 12px 12px;
  z-index: 999;
  background: rgba(var(--theme-color-rgb), 0.94); /* شفافیت کمتر برای جذابیت */
  backdrop-filter: blur(16px); /* بلور قوی‌تر */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); /* سایه قوی‌تر */
  scroll-behavior: smooth;
  gap: 16px; /* فاصله بیشتر بین آیتم‌ها */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}
.parent-menu.shrink {
  top: 0; /* چسبیده به بالای صفحه */
  width: 100%; /* تمام عرض صفحه */
  padding: 8px 12px;
  transform: scale(0.9); /* 10 درصد کوچک‌تر */
  transform-origin: center top;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}
/* آیتم‌های منوی والد */
.parent-item {
  display: flex;
  align-items: center;
  padding: 10px 24px; /* پدینگ بیشتر برای ظاهر مستطیلی */
  border-radius: 12px; /* گوشه‌های مستطیلی با انحنای کم */
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(
    135deg,
    var(--items-color-adjusted-20) 0%,
    var(--items-color-adjusted-30) 100%
  ); /* گرادیان برای جذابیت */
  color: var(--text-color);
  gap: 14px;
}
.parent-menu.shrink .parent-item {
  padding: 6px 18px;
  font-size: 0.945rem; /* 10 درصد کوچک‌تر */
}
.parent-item.active {
  background: linear-gradient(
    135deg,
    var(--items-color) 0%,
    var(--items-color-adjusted-10) 100%
  );
  color: var(--text-color-adjusted-10);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); /* سایه قوی‌تر */
  transform: translateY(-1px);
}
.parent-item:hover {
  background: linear-gradient(
    135deg,
    var(--items-color-adjusted-30) 0%,
    var(--items-color-adjusted-20) 100%
  );
  transform: scale(1.02) translateY(-1px); /* افکت مقیاس برای جذابیت */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.parent-item.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%; /* خط نازک کمی عریض‌تر */
  height: 2px;
  background: var(--theme-color-adjusted-10);
  border-radius: 1px;
}
.parent-item::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(var(--text-color-rgb), 0.2),
    transparent
  ); /* گرادیان ظریف‌تر */
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
}
.parent-item:hover::before,
.parent-item.active::before {
  opacity: 1;
}
.parent-item .menu-icon {
  width: 34px;
  height: 34px;
  margin-left: 0;
  border-radius: 6px; /* گوشه‌های کمتر گرد برای هماهنگی با مستطیل */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.parent-menu.shrink .menu-icon {
  width: 30.6px; /* 10 درصد کوچک‌تر */
  height: 30.6px;
}
.parent-item.active .menu-icon,
.parent-item:hover .menu-icon {
  transform: scale(1.1);
}
.parent-item .check-icon {
  font-size: 0.95rem;
  margin-right: 8px;
  color: var(--theme-color-adjusted-10);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.parent-menu.shrink .check-icon {
  font-size: 0.855rem; /* 10 درصد کوچک‌تر */
}
/* استایل منوی فرزند (Child Menu) */
.child-menu {
  position: fixed;
  top: 170px; /* فاصله بیشتر از parent-menu */
  width: 100%; /* تمام عرض صفحه */
  display: flex;
  overflow-x: auto;
  padding: 10px 12px;
  z-index: 998;
  background: rgba(var(--theme-color-rgb), 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  scroll-behavior: smooth;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}
.child-menu.shrink {
  top: 56px; /* فاصله بیشتر از parent-menu در حالت shrink */
  width: 100%; /* تمام عرض صفحه */
  padding: 8px 12px;
  transform: scale(0.9); /* 10 درصد کوچک‌تر */
  transform-origin: center top;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}
/* آیتم‌های منوی فرزند */
.child-item {
  display: flex;
  align-items: center;
  padding: 8px 22px;
  border-radius: 12px; /* گوشه‌های مستطیلی با انحنای کم */
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(
    135deg,
    var(--items-color-adjusted-30) 0%,
    var(--items-color-adjusted-20) 100%
  );
  color: var(--text-color);
  gap: 12px;
}
.child-menu.shrink .child-item {
  padding: 6px 16px;
  font-size: 0.9rem; /* 10 درصد کوچک‌تر */
}
.child-item.active {
  background: linear-gradient(
    135deg,
    var(--items-color) 0%,
    var(--items-color-adjusted-10) 100%
  );
  color: var(--text-color-adjusted-10);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}
.child-item:hover {
  background: linear-gradient(
    135deg,
    var(--items-color-adjusted-30) 0%,
    var(--items-color-adjusted-20) 100%
  );
  transform: scale(1.02) translateY(-1px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}
.child-item.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 2px;
  background: var(--theme-color-adjusted-10);
  border-radius: 1px;
}
.child-item::before {
  content: "";
 σαν: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(var(--text-color-rgb), 0.2),
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
}
.child-item:hover::before,
.child-item.active::before {
  opacity: 1;
}
.child-item .menu-icon {
  width: 30px;
  height: 30px;
  margin-left: 0;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.child-menu.shrink .menu-icon {
  width: 27px; /* 10 درصد کوچک‌تر */
  height: 27px;
}
.child-item.active .menu-icon,
.child-item:hover .menu-icon {
  transform: scale(1.1);
}
.child-item .check-icon {
  font-size: 0.9rem;
  margin-right: 8px;
  color: var(--theme-color-adjusted-10);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.child-menu.shrink .check-icon {
  font-size: 0.81rem; /* 10 درصد کوچک‌تر */
}
/* اسکرول‌بار برای منوها */
.parent-menu::-webkit-scrollbar,
.child-menu::-webkit-scrollbar {
  height: 6px;
}
.parent-menu::-webkit-scrollbar-thumb,
.child-menu::-webkit-scrollbar-thumb {
  background: rgba(var(--text-color-rgb), 0.35);
  border-radius: 3px;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.parent-menu::-webkit-scrollbar-thumb:hover,
.child-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--text-color-rgb), 0.6);
}
