/*
 * Zein Publisher Child v0.5.5
 * RTL navigation polish and stable desktop dropdowns.
 */

/* إزالة أي نقاط أو علامات قائمة موروثة من ملفات أقدم */
body .zl-mobile-menu-panel__links,
body .zl-mobile-menu-panel__links ul,
body .zl-mobile-menu-panel__links li {
  list-style: none !important;
}

body .zl-mobile-menu-panel__links li::marker {
  content: "" !important;
  font-size: 0 !important;
}

body .zl-mobile-menu-panel__links .menu-item > a::before,
body .zl-mobile-menu-panel__links .aw-subnav__link::before {
  content: none !important;
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────
   الكمبيوتر: قائمة ثابتة بلا سهم إنزال وبلا فجوة هروب
───────────────────────────────────────────────────────────── */
@media (min-width: 861px) {
  body .zl-mobile-menu-panel__links > .menu-item-has-children > a {
    padding-inline-end: 15px !important;
  }

  body .zl-mobile-menu-panel__links > .menu-item-has-children > a::after {
    content: none !important;
    display: none !important;
  }

  body .zl-mobile-menu-panel__links .sub-menu {
    top: calc(100% - 1px) !important;
    padding: 10px !important;
    border: 1px solid #E7D7CA !important;
    border-top: 3px solid #C8A46A !important;
    border-radius: 0 0 17px 17px !important;
    background:
      linear-gradient(180deg, rgba(255,255,255,.99), rgba(252,247,242,.99)) !important;
    box-shadow:
      0 20px 46px rgba(53,7,13,.16),
      0 4px 14px rgba(53,7,13,.07) !important;
    transform: translateY(5px) !important;
    transition:
      opacity .16s ease,
      visibility .16s ease,
      transform .16s ease !important;
  }

  /* مساحة شفافة متصلة بالعنصر الأب لمنع اختفاء القائمة أثناء تحريك الفأرة */
  body .zl-mobile-menu-panel__links .sub-menu::before {
    content: "" !important;
    position: absolute !important;
    top: -11px !important;
    right: 0 !important;
    left: 0 !important;
    height: 12px !important;
    background: transparent !important;
  }

  body .zl-mobile-menu-panel__links .menu-item-has-children:hover > .sub-menu,
  body .zl-mobile-menu-panel__links .menu-item-has-children:focus-within > .sub-menu,
  body .zl-mobile-menu-panel__links .menu-item-has-children.zl-desktop-submenu-open > .sub-menu {
    transform: translateY(0) !important;
  }

  body .zl-mobile-menu-panel__links .sub-menu .menu-item > a {
    min-height: 42px !important;
    margin: 2px 0 !important;
    padding: 9px 13px !important;
    border: 1px solid transparent !important;
    border-radius: 11px !important;
    background: transparent !important;
    color: #4F2B32 !important;
    font-size: 13px !important;
    font-weight: 550 !important;
    line-height: 1.65 !important;
    transition:
      background .15s ease,
      color .15s ease,
      border-color .15s ease,
      transform .15s ease !important;
  }

  body .zl-mobile-menu-panel__links .sub-menu .menu-item:nth-child(odd) > a {
    background: rgba(250,245,239,.72) !important;
  }

  body .zl-mobile-menu-panel__links .sub-menu .menu-item > a:hover,
  body .zl-mobile-menu-panel__links .sub-menu .menu-item > a:focus-visible,
  body .zl-mobile-menu-panel__links .sub-menu .current-menu-item > a {
    background: linear-gradient(135deg, #F6E9DF, #FFF9F3) !important;
    color: #5B0F1A !important;
    border-color: #E4CDBB !important;
    transform: translateX(-3px) !important;
  }

  /* المستوى الثالث: يبقى قريبًا وثابتًا */
  body .zl-mobile-menu-panel__links .sub-menu .sub-menu {
    top: -10px !important;
    border-radius: 15px !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   الهاتف: روح لونية، بلا نقاط، وسهم RTL
───────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  body .zl-mobile-menu-panel__links {
    gap: 7px !important;
    padding: 10px !important;
    border-top: 0 !important;
    background:
      radial-gradient(circle at 100% 0, rgba(200,164,106,.12), transparent 34%),
      #FBF8F5 !important;
  }

  body .zl-mobile-menu-panel__links > .menu-item {
    margin: 0 !important;
    border: 1px solid #E8DCD2 !important;
    border-radius: 15px !important;
    background: #fff !important;
    box-shadow: 0 6px 18px rgba(53,7,13,.055) !important;
    overflow: hidden !important;
  }

  body .zl-mobile-menu-panel__links > .menu-item > a {
    min-height: 58px !important;
    margin: 0 !important;
    padding: 13px 18px 13px 60px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: linear-gradient(135deg, #FFFFFF, #FCF8F4) !important;
    color: #3D161D !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.65 !important;
    text-align: right !important;
  }

  body .zl-mobile-menu-panel__links > .menu-item:nth-child(even) > a {
    background: linear-gradient(135deg, #FFFDFC, #F9F1EB) !important;
  }

  body .zl-mobile-menu-panel__links > .menu-item.current-menu-item,
  body .zl-mobile-menu-panel__links > .menu-item.current-menu-ancestor,
  body .zl-mobile-menu-panel__links > .menu-item.zl-submenu-open {
    border-color: #DABFA9 !important;
    box-shadow: 0 9px 24px rgba(91,15,26,.10) !important;
  }

  body .zl-mobile-menu-panel__links > .menu-item.current-menu-item > a,
  body .zl-mobile-menu-panel__links > .menu-item.current-menu-ancestor > a,
  body .zl-mobile-menu-panel__links > .menu-item.zl-submenu-open > a {
    background: linear-gradient(135deg, #F4E4DA, #FFF9F4) !important;
    color: #5B0F1A !important;
  }

  /* زر السهم على اليسار، والسهم المغلق يتجه لليسار بما يناسب RTL */
  body .zl-submenu-toggle {
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
    inset-inline-start: auto !important;
    inset-inline-end: auto !important;
    width: 42px !important;
    height: 42px !important;
    border: 1px solid #E3CFC0 !important;
    border-radius: 12px !important;
    background: #F8EEE7 !important;
    color: #6C1621 !important;
    box-shadow: 0 4px 12px rgba(53,7,13,.06) !important;
  }

  body .zl-submenu-toggle::before {
    content: "‹" !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    border: 0 !important;
    color: currentColor !important;
    font-family: Arial, sans-serif !important;
    font-size: 31px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    transform: none !important;
    transition: transform .18s ease !important;
  }

  body .menu-item-has-children.zl-submenu-open > .zl-submenu-toggle {
    background: #5B0F1A !important;
    color: #fff !important;
    border-color: #5B0F1A !important;
  }

  body .menu-item-has-children.zl-submenu-open > .zl-submenu-toggle::before {
    transform: rotate(-90deg) !important;
  }

  body .zl-mobile-menu-panel__links .menu-item-has-children > .sub-menu {
    margin: 0 9px 10px !important;
    padding: 8px !important;
    border: 0 !important;
    border-right: 3px solid #C8A46A !important;
    border-radius: 13px !important;
    background:
      linear-gradient(180deg, #FFFDFB, #F9F1EA) !important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.9),
      0 5px 14px rgba(53,7,13,.05) !important;
  }

  body .zl-mobile-menu-panel__links .sub-menu .menu-item {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body .zl-mobile-menu-panel__links .sub-menu .menu-item > a {
    min-height: 46px !important;
    margin: 4px 0 !important;
    padding: 9px 14px 9px 52px !important;
    border: 1px solid #EEE1D7 !important;
    border-radius: 11px !important;
    background: rgba(255,255,255,.84) !important;
    color: #513239 !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: 1.75 !important;
    text-align: right !important;
  }

  body .zl-mobile-menu-panel__links .sub-menu .menu-item:nth-child(even) > a {
    background: #F8EEE7 !important;
  }

  body .zl-mobile-menu-panel__links .sub-menu .menu-item > a:active,
  body .zl-mobile-menu-panel__links .sub-menu .menu-item > a:hover,
  body .zl-mobile-menu-panel__links .sub-menu .current-menu-item > a {
    background: linear-gradient(135deg, #EEDBD0, #FFF8F1) !important;
    border-color: #DABFA9 !important;
    color: #5B0F1A !important;
  }

  body .zl-mobile-menu-panel__links .sub-menu .zl-submenu-toggle {
    top: 6px !important;
    left: 5px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }

  body .zl-mobile-menu-panel__links .sub-menu .zl-submenu-toggle::before {
    font-size: 27px !important;
  }

  body .zl-mobile-menu-panel__links .sub-menu .sub-menu {
    margin: 5px 5px 7px !important;
    padding: 6px !important;
    border-right-color: #7A1E27 !important;
    background: #F6ECE5 !important;
  }
}
