/* ========================================== */
/* تنسيقات الناف بار */
/* ========================================== */

.main-nav {
  background-color: #fff;
  border-bottom: 1px solid #eee;
  direction: rtl;
  position: relative;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: center;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
  padding: 15px 0;
  margin: 0;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s;
  display: block;
}

.nav-links a:hover {
  color: #000;
  font-weight: 600;
}

/* القائمة المنسدلة العادية */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 250px;
  padding: 10px;
  border-radius: 8px;
  z-index: 101;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

/* Mega Menu للتصنيفات الكبيرة */
.dropdown-menu.mega {
  min-width: 600px;
  padding: 20px;
}

.mega-columns {
  display: flex;
  gap: 30px;
}

.mega-column {
  flex: 1;
}

.mega-column h4 {
  font-size: 14px;
  font-weight: 700;
  color: #000;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #000;
}

.mega-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mega-column ul li {
  padding: 0;
  margin-bottom: 6px;
}

.mega-column ul li a {
  font-size: 13px;
  color: #555;
  padding: 6px 0;
  display: block;
}

.mega-column ul li a:hover {
  color: #000;
  padding-right: 5px;
}

/* قائمة الدول */
.country-search {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.country-search input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  text-align: right;
}

.country-list {
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
}

.country-list li {
  padding: 0;
}

.country-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  font-size: 14px;
  color: #444;
}

.country-list a:hover {
  background-color: #f9f9f9;
}

.country-flag {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid #eee;
}

/* ========================================== */
/* الموبايل والآيباد */
/* ========================================== */

@media (max-width: 992px) {
  :root {
    --topbar-height: 70px;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: var(--topbar-height);
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #ddd;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 999;
  }

  .main-nav.active {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    text-align: right;
  }

  .dropdown:hover .dropdown-menu {
    display: none;
  }

  .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-right: 20px;
    padding-left: 0;
    display: none;
    min-width: 100%;
  }

  .dropdown.active .dropdown-menu {
    display: block;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Mega Menu في الموبايل */
  .dropdown-menu.mega {
    min-width: 100%;
    padding: 15px;
  }

  .mega-columns {
    flex-direction: column;
    gap: 20px;
  }

  .country-list {
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
