
.main-header {
    background: linear-gradient(to right, #084db6, #d33f8d);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ✅ تغليف داخلي للهيدر */
.main-header .header-inner {
    width: 1430px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    gap: 15px;
}

/* ✅ تقسيم داخلي 3 أعمدة */
.header-section {
    flex: 1;
}
.header-left {
    text-align: right;
}
.header-center {
    text-align: center; /* هذا ماينفع لحاله مع flex */
    display: flex;
    justify-content: center; /* ← لمحاذاة الروابط يسار */
    align-items: center;
}

.header-section.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
}

/* الشعار */
.logo-container {
    display: flex;
	align-items: center;
}
.logo-link{
    display:inline-flex;
    align-items:center;
    text-decoration:none;
}

.logo-link img{
    display:block;
}

/* روابط الوسط */
.header-nav {
    display: flex;
    justify-content: center;
    gap: 0px;
}
.header-nav a {
    text-decoration: none;
    font-weight: normal;
	font-size: 14px;
    color: #333;
    padding: 6px 12px;
    transition: background-color 0.3s ease;
	font-family: var(--site-font-family);
}
.header-nav a:hover {
    transition: background-color 0.3s ease;
}
.header-nav i {
	text-align: center; /* هذا ماينفع لحاله مع flex */
    display: flex;
    justify-content: flex-start; /* ← لمحاذاة الروابط يسار */
    align-items: center;
    margin-right: 10px;
	margin-left: 0px;
}

.btn-add-ad {
  background-color: #fff;
  color: #000 !important;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* فراغ بين الأيقونة والنص */
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  min-width: auto; /* تثبيت عرض مبدئي */
  height: 48px;
  z-index: 1000;
  margin-left: 15px; margin-right: 15px;
}

.btn-add-ad:hover {
  background-color: orange;
  color: #000 !important;
  border: none;
}
.dropdown-menu {
  position: absolute;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 8px 0;
  min-width: 210px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  margin-top: 10px;
  z-index: 1000;
  margin-right: -75px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s ease;
}

.dropdown-item i {
  width: 25px;
  text-align: center;
  font-size: 15px;
  color: #666;
  margin-left: 5px;
}

.dropdown-item span {
  flex: 1;
  text-align: right;
  font-size: 14px;
  font-family: var(--site-font-family);
}

.dropdown-item:hover {
  background-color: #f5f5f5;
}

.hidden {
  display: none;
}

.btn-account {
  background: transparent;
  border: 1px solid #fff;
  border-radius: 4px;
  padding: 10px 30px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--site-font-family);
  margin-left: 20px;
  height: 48px;
  
}
@media (max-width: 768px) {
  .btn-add-ad { display: none; }
  .logo-container { margin-right: 10px; }
  .header-nav { gap: 20px; }
}
.btn-store-directory{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:46px;
    padding:8px 15px;
    background:#ff2b4a;
    color:#fff;
    border:1px solid #ff2b4a;
    border-radius:5px;
    text-decoration:none;
    font-family: var(--site-font-family);
    font-size:14px;
    line-height:1;
    transition:background 0.2s ease, border-color 0.2s ease;
}

.btn-store-directory:hover{
    background:#000;
    border-color:#000;
    color:#fff;
}

.btn-store-directory i{
    color:#fff;
    font-size:14px;
}

/* ✅ في وضع التوافق يظهر زر دليل المتاجر / العودة للرئيسية كأيقونة فقط */
@media (max-width: 768px) {
  .main-header .btn-store-directory {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    gap: 0;
    flex-shrink: 0;
  }

  .main-header .btn-store-directory span {
    display: none;
  }

  .main-header .btn-store-directory i {
    margin: 0;
    font-size: 16px;
  }
}

/* ✅ إصلاح الخروج الأفقي الطفيف في الهيدر على الجوال
   ملاحظة: التقارب بين زر حسابي وزر دليل المتاجر صار بتقليل المسافة بينهما، وليس بتحريك الزر خارج حدود الشاشة. */
.main-header,
.main-header * {
  box-sizing: border-box;
}

.main-header .header-inner {
  max-width: 100%;
  min-width: 0;
}

.main-header .header-section {
  min-width: 0;
}

@media (max-width: 768px) {
  .main-header {
    width: 100%;
    max-width: 100%;
  }

  .main-header .header-inner {
    width: 100%;
    max-width: 100%;
    padding-inline: 6px;
    gap: 6px;
  }

  .main-header .header-section.header-right {
    gap: 6px !important;
    min-width: 0;
  }

  .main-header .btn-account {
    margin-left: 0;
  }

  .main-header .btn-store-directory {
    transform: none;
  }

  .main-header .logo-container {
    margin-right: 0;
    min-width: 0;
  }

  .main-header .logo-link img {
    max-width: min(200px, 44vw);
    height: auto;
  }
}


/* ✅ زر دخول / حسابي في وضع التوافق يظهر كأيقونة فقط */
@media (max-width: 768px) {
  .main-header .btn-account {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-shrink: 0;
  }

  .main-header .btn-account p,
  .main-header .btn-account .fa-caret-down {
    display: none !important;
  }

  .main-header .btn-account::before {
    content: "\f007";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #ffffff;
    font-size: 17px;
    line-height: 1;
  }
}

/* ✅ إصلاح قائمة دخول / حسابي في الجوال
   القائمة تبقى مرتبطة بزرها مباشرة، بدون fixed وبدون هامش سالب يسبب تمدداً أفقياً. */
.main-header .dropdown {
  position: relative;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .main-header .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    width: 210px;
    min-width: 0;
    max-width: calc(100vw - 12px);
    margin: 0 !important;
    box-sizing: border-box;
    z-index: 5000;
    overflow: hidden;
  }

  .main-header .dropdown-item {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
  }

  .main-header .dropdown-item span {
    min-width: 0;
  }
}
