/* ===== HEADER BASE ===== */
header {
  background-color: #aca8a8;
  padding: 1.5rem 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.4s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ===== CONTAINER ===== */
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;

  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1.5rem;
}

/* ===== LEFT SIDE ===== */
.left-side {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  width: 110px;
  height: auto;
}

.logo-title h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #263d4b;
  margin: 0;
  white-space: nowrap;
}

/* ===== RIGHT SIDE ===== */
.right-side {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 0 0 auto;
}

/* ===== NAV ===== */
/* إجبار القائمة تبقى أفقية */
nav {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
}

nav ul {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.75rem;

  padding: 0;
  margin: 0;

  list-style: none;
  white-space: nowrap;
  flex-wrap: nowrap;
}

/* أهم سطرين */
nav li {
  display: inline-flex;
  width: auto !important;
  flex: 0 0 auto;
}

/* ===== LANGUAGE ===== */
.language-switcher {
  display: flex;
  gap: 0.5rem;
}

button {
  padding: 0.6rem 1rem;
  background-color: #4a505d;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background-color: #1a2357;
}

/* ===== SHRINK ===== */
header.shrink {
  padding: 1rem 0;
}

header.shrink .logo {
  width: 80px;
}

header.shrink .logo-title h1 {
  font-size: 1.6rem;
}
@media (max-width: 768px) {

  header {
    padding: 0.6rem 0;
  }

  /* الهيدر كله سطر واحد */
  .header-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;

    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;

    gap: 0.75rem;
    padding: 0 0.75rem;
  }

  /* منع أي عنصر يتمدد */
  .left-side,
  .right-side {
    flex: 0 0 auto;
    width: auto;
  }

  /* اللوجو والعنوان */
  .logo {
    width: 60px;
    flex-shrink: 0;
  }

  .logo-title {
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .logo-title h1 {
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    white-space: nowrap;
  }

  /* القايمة */
  nav,
  nav ul {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  nav a {
    font-size: clamp(0.85rem, 3vw, 1rem);
  }

  /* اللغة */
  .language-switcher {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
  }

  button {
    padding: 0.35rem 0.6rem;
    font-size: clamp(0.75rem, 2.8vw, 0.9rem);
  }

  /* منع الكسر نهائيًا */
  .header-container * {
    white-space: nowrap;
  }
}

/* شكل شريط التنقل */
.header-container::-webkit-scrollbar {
  height: 4px;
}

.header-container::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
}


.left-side {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  width: 110px;
  height: auto;
  object-fit: contain;
  transition: all 0.4s ease;
}

.logo-title h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #263d4b;
  margin: 0;
  white-space: nowrap;
}

.right-side {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: nowrap;
}

nav ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 30px;
}

nav a {
  color: #1a2357;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
  transition: color 0.3s ease, transform 0.3s ease;
}

nav a:hover {
  text-decoration: underline;
  color: #ffffff;
  transform: translateY(-3px);
}

.language-switcher {
  display: flex;
  gap: 0.5rem;
}

button {
  padding: 0.6rem 1rem;
  background-color: #4a505d;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  font-size: 1rem;
}

button:hover {
  background-color: #1a2357;
}

/* عند التحرك للأسفل */
header.shrink {
  padding: 1rem 0;
}

header.shrink .logo {
  width: 80px;
}

header.shrink .logo-title h1 {
  font-size: 1.6rem;
}

/* تجاوب مع الموبايل مع الحفاظ على التخطيط الأفقي */
@media (max-width: 768px) {
  .header-container {
    flex-wrap: nowrap;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0 1rem;
  }

  .left-side,
  .right-side {
    flex: 1;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
  }

  .logo-title {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .logo {
    width: 70px;
  }

  .logo-title h1 {
    font-size: 1.2rem;
  }

  nav ul {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: auto;
    font-size: 0.9rem;
  }

  nav a {
    font-size: 0.95rem;
  }

  .language-switcher {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  button {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
}