
.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;
  }
}

/* ==================================================
   زر وقائمة مشاركة الصفحة في الهيدر
   ================================================== */
.main-header .site-share{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.main-header .site-share-button{
  width:36px;
  min-width:36px;
  height:48px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:0;
  background:transparent;
  color:#ffffff;
  font-family:var(--site-font-family);
  cursor:pointer;
  box-shadow:none;
  appearance:none;
  -webkit-appearance:none;
  transition:opacity .18s ease,transform .18s ease;
}

.main-header .site-share-button:hover,
.main-header .site-share-button[aria-expanded="true"]{
  background:transparent;
  border-color:transparent;
  opacity:.82;
}

.main-header .site-share-button:focus-visible{
  outline:2px solid rgba(255,255,255,.45);
  outline-offset:3px;
  border-radius:6px;
}

.main-header .site-share-button i{
  margin:0;
  color:#ffffff;
  font-size:28px;
  line-height:1;
}

.main-header .site-share-menu{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  left:auto;
  width:258px;
  min-width:258px;
  margin:0;
  padding:8px;
  border:1px solid #e5e7eb;
  border-radius:7px;
  background:#ffffff;
  box-shadow:0 14px 34px rgba(15,23,42,.20);
  z-index:6000;
  direction:rtl;
  text-align:right;
  overflow:visible;
}

.main-header .site-share-menu::before{
  content:"";
  position:absolute;
  top:-6px;
  right:18px;
  width:11px;
  height:11px;
  border-top:1px solid #e5e7eb;
  border-right:1px solid #e5e7eb;
  background:#ffffff;
  transform:rotate(-45deg);
}

.main-header .site-share-head{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  gap:10px;
  padding:7px 7px 11px;
  border-bottom:1px solid #edf0f3;
}

.main-header .site-share-head-icon{
  width:34px;
  min-width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #e9def3;
  border-radius:6px;
  background:#f7f2fb;
  color:#7f46a4;
}

.main-header .site-share-head-icon i{
  margin:0;
  font-size:15px;
  line-height:1;
}

.main-header .site-share-head-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.main-header .site-share-title{
  color:#172033;
  font-family:var(--site-font-family);
  font-size:13px;
  font-weight:500;
  line-height:1.6;
}

.main-header .site-share-subtitle{
  color:#7b8494;
  font-family:var(--site-font-family);
  font-size:11px;
  font-weight:400;
  line-height:1.6;
}

.main-header .site-share-list{
  padding-top:5px;
}

.main-header .site-share-native[hidden]{
  display:none !important;
}

.main-header .site-share-item{
  width:100%;
  min-height:43px;
  margin:0;
  padding:6px 7px;
  border:0;
  border-bottom:1px solid #f0f2f4;
  border-radius:0;
  background:#ffffff;
  color:#334155;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  font-family:var(--site-font-family);
  font-size:12.5px;
  font-weight:400;
  line-height:1.5;
  text-align:right;
  cursor:pointer;
  box-shadow:none;
  appearance:none;
  -webkit-appearance:none;
  transition:background-color .16s ease,color .16s ease;
}

.main-header .site-share-item:last-child{
  border-bottom:0;
}

.main-header .site-share-item:hover,
.main-header .site-share-item:focus-visible{
  background:#f8fafc;
  color:#111827;
  outline:none;
}

.main-header .site-share-item i{
  width:30px;
  min-width:30px;
  height:30px;
  margin:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid transparent;
  border-radius:6px;
  font-size:14px;
  line-height:1;
}

.main-header .site-share-item span{
  flex:1;
  min-width:0;
}

.main-header .site-share-native i{color:#7f46a4;background:#f7f2fb;border-color:#eadcf3}
.main-header .site-share-whatsapp i{color:#15803d;background:#f0fdf4;border-color:#dcfce7}
.main-header .site-share-x i{color:#111827;background:#f8fafc;border-color:#e5e7eb}
.main-header .site-share-facebook i{color:#1877f2;background:#eff6ff;border-color:#dbeafe}
.main-header .site-share-telegram i{color:#0284c7;background:#f0f9ff;border-color:#dbeafe}
.main-header .site-share-copy i{color:#64748b;background:#f8fafc;border-color:#e5e7eb}

.main-header .site-share-copy.is-success{
  background:#ecfdf5;
  color:#166534;
}

.main-header .site-share-copy.is-success i{
  color:#15803d;
  background:#f0fdf4;
  border-color:#bbf7d0;
}

@media (max-width:768px){
  .main-header .site-share-button{
    width:32px;
    min-width:32px;
    height:46px;
  }

  .main-header .site-share-menu{
    top:calc(100% + 8px);
    right:0;
    left:auto;
    width:252px;
    min-width:0;
    max-width:calc(100vw - 12px);
  }
}

