/**
 * Astra Child — ثيم فرعي
 * Template: astra
 */

/* ✅ sidebar ثابت على اليمين */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 250px;
  height: 100vh;
  background: #191919;
  z-index: 999;
  overflow-y: auto;
}

/* ✅ غلاف المحتوى يتحرّك بعيدًا عن الـ sidebar */
#page-content {
  margin-right: 250px;
  background: #191919;
  color: white;
  min-height: 100vh;
}

/* اختياري: ضبط الجسم بالكامل */
body {
  margin: 0;
  padding: 0;
  background: #191919;
  color: white;
  font-family: 'Cairo', sans-serif;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="reset"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ========== TOPBAR COMPACT MENU ========== */
/* القائمة العادية للكمبيوتر */
.desktop-menu {
  display: flex;
  gap: 1.456vw;
  margin-left: auto;
}

/* القائمة المضغوطة للهاتف (مخفية افتراضياً) */
.mobile-menu {
  display: none;
}

.compact-menu-toggle {
  background: none;
  border: 1px solid #E7BC0F;
  color: #E7BC0F;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.compact-menu-toggle:hover,
.compact-menu-toggle.active {
  background: #E7BC0F;
  color: #191919;
}

.compact-menu-toggle .dropdown-icon {
  font-size: 10px;
  transition: transform 0.3s ease;
}

.compact-menu-toggle.active .dropdown-icon {
  transform: rotate(180deg);
}

.compact-submenu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  min-width: 160px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.compact-submenu.active {
  display: block;
}

.compact-menu-item,
.compact-menu-subitem {
  display: block;
  color: #E5E5E5;
  padding: 8px 12px;
  text-decoration: none;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  border-bottom: 1px solid #333;
  transition: all 0.3s ease;
}

.compact-menu-item:hover,
.compact-menu-subitem:hover {
  background: #333;
  color: #E7BC0F;
}

.compact-menu-item {
  font-weight: 600;
  background: rgba(231, 188, 15, 0.05);
}

.compact-menu-subitem {
  padding-right: 20px;
  font-size: 12px;
  color: #B8B8B8;
}

.compact-menu-subitem:hover {
  color: #E7BC0F;
  padding-right: 24px;
}

/* ✅ استجابة للجوال */
@media (max-width: 768px) {
  /* إخفاء sidebar افتراضياً على الهاتف */
  .sidebar {
    width: 280px;
    transform: translateX(100%);
    z-index: 1001;
    transition: transform 0.3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* إزالة margin للمحتوى الرئيسي على الهاتف */
  #page-content {
    margin-right: 0;
  }

  /* ========== تبديل القوائم على الهاتف ========== */
  /* إخفاء القائمة العادية */
  .desktop-menu {
    display: none !important;
  }

  /* إظهار القائمة المضغوطة */
  .mobile-menu {
    display: block !important;
  }

  /* ========== ترتيب Topbar الصحيح للهاتف ========== */
  .topbar {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 12px !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    height: auto !important;
    min-height: 50px !important;
  }

  /* ترتيب العناصر من اليمين لليسار */
  .hamburger-btn {
    order: 1 !important;
    flex-shrink: 0 !important;
    display: block !important;
    font-size: 16px !important;
    padding: 6px !important;
  }

  .mobile-menu {
    order: 2 !important;
    flex-shrink: 0 !important;
    margin-left: 0 !important;
  }

  .search-box {
    order: 3 !important;
    flex: 1 !important;
    width: auto !important;
    max-width: none !important;
    height: 36px !important;
    margin: 0 8px !important;
    border-radius: 8px !important;
  }

  .notify-icon {
    order: 4 !important;
    flex-shrink: 0 !important;
  }

  .profile-pic {
    order: 5 !important;
    flex-shrink: 0 !important;
  }

  /* أحجام العناصر المحسنة للهاتف */
  .search-box .search-icon,
  .search-box .filter-btn img {
    width: 16px !important;
    height: 16px !important;
  }

  .search-box input {
    font-size: 13px !important;
    padding: 0 6px !important;
  }

  .search-box input::placeholder {
    font-size: 12px !important;
  }

  .profile-pic img {
    width: 32px !important;
    height: 32px !important;
    border-width: 1px !important;
    padding: 1px !important;
  }

  .notify-icon img {
    width: 28px !important;
    height: 28px !important;
  }

  .notification-menu {
    width: 180px !important;
    left: -140px !important;
    font-size: 11px !important;
    padding: 8px !important;
    top: 35px !important;
  }

  .filter-menu {
    width: 140px !important;
    font-size: 12px !important;
    padding: 8px !important;
  }

  /* تحسين القائمة المضغوطة للهاتف */
  .compact-submenu {
    min-width: 140px !important;
    right: 0 !important;
    max-height: 250px !important;
  }

  .compact-menu-item,
  .compact-menu-subitem {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .compact-menu-subitem {
    padding-right: 16px !important;
    font-size: 11px !important;
  }

  /* الحاويات العامة */
  .home-container {
    padding: 16px !important;
  }

  .flex {
    flex-direction: column !important;
    gap: 30px !important;
  }

  /* السلايدر */
  .main-slider {
    width: 100% !important;
    height: 58vw !important;
    border-radius: 14px !important;
  }

  .info-box {
    width: 90% !important;
    padding: 14px !important;
    right: 10px !important;
    bottom: 10px !important;
  }

  .info-box h2 {
    font-size: 20px !important;
  }

  .info-box p {
    font-size: 13px !important;
    line-height: 1.6 !important;
  }

  .meta-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }

  .btn-row {
    flex-direction: column !important;
    gap: 10px !important;
  }

  /* توصيات */
  .trending-desktop {
    display: none !important;
  }

  .trending-mobile {
    display: block !important;
  }

  /* الشريط الجانبي */
  .close-btn {
    display: block !important;
    font-size: 1.5rem !important;
    padding: 0.5rem !important;
  }

  .menu a span {
    font-size: 14px !important;
  }

  .swiper-slide {
    width: 193px !important;
  }

  .hot-slide img {
    width: 100% !important;
    height: auto !important;
  }
}

/* للشاشات الصغيرة جداً */
@media (max-width: 480px) {
  .topbar {
    padding: 6px 8px !important;
    gap: 6px !important;
  }

  .search-box {
    height: 32px !important;
    margin: 0 6px !important;
  }

  .search-box input {
    font-size: 12px !important;
  }

  .compact-menu-toggle {
    font-size: 11px !important;
    padding: 4px 6px !important;
  }

  .profile-pic img {
    width: 28px !important;
    height: 28px !important;
  }

  .notify-icon img {
    width: 24px !important;
    height: 24px !important;
  }
}

/* Overlay للهاتف */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* زر الهامبرجر (مخفي افتراضياً) */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: #E7BC0F;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.hamburger-btn:hover {
  background: rgba(231, 188, 15, 0.1);
}