/* =====================================================
   نظام الطيبات - Navigation Dropdown
   قائمة منسدلة تحت "الدكتور" تحتوي:
   - سيرة الدكتور
   - النظريات
   - تجارب الزوار
   ===================================================== */

/* 🚨 إصلاح حرج: header-main في app-bundle عنده overflow:hidden
   هذا يقص الـ dropdown. نتجاوزه فقط على الـ desktop (الـ drawer mobile مختلف) */
@media (min-width: 1025px) {
  .site-header,
  .site-header .header-main,
  .site-header .header-top {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
  }
}

/* Dropdown container */
.nav-dropdown {
  position: relative;
  display: inline-block;
  z-index: 1002;
}

/* Dropdown trigger (الرابط الأساسي "الدكتور") */
.nav-link--has-dropdown {
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 1003;
}

.nav-dropdown-arrow {
  font-size: 0.75em;
  transition: transform 0.2s ease;
  display: inline-block;
  margin-right: 2px;
}

.nav-dropdown:hover .nav-dropdown-arrow,
.nav-dropdown:focus-within .nav-dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown menu */
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: #faf8f2;
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px;
  margin-top: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 99999; /* أعلى من أي عنصر آخر مثل hero */
  pointer-events: none;
}

/* تأكد إن header كاملاً فوق المحتوى */
.site-header {
  position: relative;
  z-index: 1000;
}

.main-nav {
  position: relative;
  z-index: 1001;
}

/* جسر شفاف يمنع الـ dropdown من الإغلاق عند الانتقال للقائمة */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 12px;
  z-index: 999;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Dropdown items */
.nav-dropdown-item {
  display: block;
  padding: 10px 14px;
  color: #1a3d2b !important;
  text-decoration: none !important;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s, padding-right 0.2s;
  font-family: 'Tajawal', sans-serif;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  background: linear-gradient(135deg,
    rgba(201, 168, 76, 0.15) 0%,
    rgba(201, 168, 76, 0.05) 100%);
  padding-right: 20px;
  color: #c9a84c !important;
}

.nav-dropdown-item:not(:last-child) {
  margin-bottom: 2px;
}

/* ===== Mobile responsive ===== */
@media (max-width: 968px) {
  /* في الموبايل، الـ dropdown يصير ظاهر مباشرة كقائمة عادية */
  .nav-dropdown {
    display: block;
    width: 100%;
  }

  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(201, 168, 76, 0.05);
    border: none;
    margin-top: 4px;
    padding: 4px 12px;
  }

  .nav-dropdown-arrow {
    display: none;
  }

  .nav-dropdown-item {
    padding: 8px 14px;
    font-size: 0.88rem;
  }

  .nav-dropdown-item:hover {
    padding-right: 14px;
  }
}

/* ===== Dark theme ===== */
:root[data-theme="dark"] .nav-dropdown-menu,
[data-theme="dark"] .nav-dropdown-menu,
body.dark .nav-dropdown-menu {
  background: #1a1a1a;
  border-color: rgba(201, 168, 76, 0.4);
}

:root[data-theme="dark"] .nav-dropdown-item,
[data-theme="dark"] .nav-dropdown-item,
body.dark .nav-dropdown-item {
  color: #e8c96a !important;
}

:root[data-theme="dark"] .nav-dropdown-item:hover,
[data-theme="dark"] .nav-dropdown-item:hover,
body.dark .nav-dropdown-item:hover {
  background: rgba(201, 168, 76, 0.15);
  color: #f5d97a !important;
}

/* ===== Awadi theme ===== */
:root[data-theme="awadi"] .nav-dropdown-menu,
[data-theme="awadi"] .nav-dropdown-menu,
body.awadi .nav-dropdown-menu {
  background: #faf8f2;
  border-color: rgba(201, 168, 76, 0.4);
}

/* ===== Print: hide dropdown arrow ===== */
@media print {
  .nav-dropdown-arrow {
    display: none;
  }
  .nav-dropdown-menu {
    display: none;
  }
}
