/* منوی دسته‌بندی ساده آبشاری - مدرن و شیک */

/* حذف باکس پس‌زمینه مگامنو */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown:before {
  display: none !important;
}

/* منوی سطح اول - هم‌پوشانی با لینک دسته‌بندی تا ماوس محو نشه */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul {
  width: 240px;
  min-width: 220px;
  min-height: 0 !important;
  padding: 8px 0;
  padding-top: 12px;
  margin-top: -4px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  background: #fff;
}

/* آیتم‌های سطح اول: ارتفاع بیشتر + خط زیر هر کدوم */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li {
  border-bottom: 1px solid #f0f0f0;
}
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li:last-child {
  border-bottom: none;
}

header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > a {
  line-height: 1.4 !important;
  padding: 14px 16px !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease;
}

/* فقط آیتم‌هایی که زیرشاخه دارند: علامت > (در RTL سمت چپ لینک) */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li:has(> ul) > a:after {
  content: ">";
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  margin-right: 4px;
}
/* آیتم‌های بدون زیرشاخه: بدون علامت */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li:not(:has(> ul)) > a:after {
  content: none !important;
}

/* زیرمنوها */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li {
  position: relative;
}

/* RTL: زیرمنو سمت چپ باز شود - بدون فاصله تا هاور قطع نشه */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > ul {
  position: absolute !important;
  right: 100% !important;
  left: auto !important;
  top: 0 !important;
  width: 240px !important;
  min-width: 220px !important;
  height: auto !important;
  max-height: 80vh;
  overflow: visible !important;
  margin-right: -2px;
  padding: 8px 0 !important;
  background: #fff !important;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  display: none;
  z-index: 100;
}

header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li:hover > ul {
  display: block !important;
}

/* آیتم‌های سطح ۲ باید position داشته باشن تا زیرمنوی سطح ۳ درست باز بشه */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > ul > li {
  position: relative;
  border-bottom: 1px solid #f0f0f0;
}
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > ul > li:last-child {
  border-bottom: none;
}

header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > ul > li > a {
  line-height: 1.4 !important;
  padding: 14px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 14px !important;
  font-weight: normal !important;
  transition: background 0.2s ease, color 0.2s ease;
}

/* فقط آیتم‌های دارای زیرشاخه در سطح ۲: علامت > */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > ul > li:has(> ul) > a:after {
  content: ">";
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  margin-right: 4px;
}
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > ul > li:not(:has(> ul)) > a:after {
  content: none !important;
}

/* سطح سوم - بدون فاصله با والد، با z-index بالاتر تا دیده بشه */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > ul > li > ul {
  position: absolute !important;
  right: 100% !important;
  left: auto !important;
  top: 0 !important;
  width: 220px !important;
  height: auto !important;
  padding: 8px 0 !important;
  margin-right: -2px;
  background: #fff !important;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  display: none !important;
  z-index: 101;
}

header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > ul > li:hover > ul {
  display: block !important;
}

/* خط بین آیتم‌ها در سطح سوم */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > ul > li > ul > li {
  border-bottom: 1px solid #f0f0f0;
}
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > ul > li > ul > li:last-child {
  border-bottom: none;
}

header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul > li > ul > li > ul li a {
  line-height: 1.4 !important;
  padding: 14px 16px !important;
  display: block !important;
  font-size: 14px !important;
  font-weight: normal !important;
  transition: background 0.2s ease, color 0.2s ease;
}
/* سطح سوم فقط لینک ساده است، بدون علامت > */

/* هاور مدرن */
header.page-header .nav-wrapper > ul > li.category-list.simple-dropdown > ul li a:hover {
  background: #f8fafc !important;
  color: #007bff !important;
}
