/* Image URLs - Edit these paths as needed */
:root {
  --hero-bg: url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
  --about-bg-left: url('https://images.unsplash.com/photo-1560472354-b33ff0c44a43?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
  --about-bg-right: url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
  --subsidiaries-bg-left: url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
  --subsidiaries-bg-right: url('https://images.unsplash.com/photo-1556761175-b413da4baf72?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
  --services-bg-left: url('https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
  --services-bg-right: url('https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
  --contact-bg: url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
  
  --primary-color: #1a365d;
  --secondary-color: #2c5282;
  --accent-color: #3182ce;
  --text-dark: #1a202c;
  --text-gray: #4a5568;
  --text-light: #718096;
  --bg-white: #ffffff;
  --bg-gray: #f7fafc;
  --bg-light: #edf2f7;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --font-family: 'Cairo', sans-serif;
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-white);
  scroll-behavior: smooth;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header - Transparent */
.header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(226, 232, 240, 0.3);
  transition: all 0.3s ease;
  padding: 0.5rem 0; /* تقليل الحشو */
}

.header {
  transition: top 0.3s; /* إضافة تأثير الانتقال */
}

.header.hidden {
  top: -100px; /* إخفاء الهيدر عن طريق تحريكه للأعلى */
}

.header-toggle, .header-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--primary-color);
  font-size: 1.5rem; /* حجم الأيقونة */
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem; /* تقليل الحشو */
  gap: 1rem; /* تقليل الفجوة */
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* تقليل الفجوة */
}

.logo {
  width: 40px; /* تقليل حجم الشعار */
  height: 40px; /* تقليل حجم الشعار */
}

.company-name {
  font-size: 1.2rem; /* تقليل حجم الخط */
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

.tagline {
  font-size: 0.7rem; /* تقليل حجم الخط */
  color: var(--text-gray);
  margin: 0;
}

.main-nav {
  display: flex;
  flex-wrap: wrap; /* السماح بالتفاف العناصر */
  gap: 0.5rem; /* تقليل الفجوة */
}

.nav-item {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  padding: 0.5rem 1rem; /* تقليل الحشو */
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  position: relative;
  font-size: 0.9rem; /* تقليل حجم الخط */
}

.nav-item:hover {
  color: var(--primary-color);
  background: var(--bg-light);
  transform: translateY(-1px);
}

.lang-toggle {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem; /* تقليل الحشو */
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  font-size: 0.9rem; /* تقليل حجم الخط */
}

/* Hero Section with Background Image */
.hero {
  min-height: 100vh;
  padding: 8rem 0 3rem;
  background-image: linear-gradient(rgba(26, 54, 93, 0.7), rgba(26, 54, 93, 0.7)), var(--hero-bg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  color: white;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(26, 54, 93, 0.8), rgba(49, 130, 206, 0.6));
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-desc {
  font-size: 1.3rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 2.5rem;
  line-height: 1.7;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.2rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #2b6cb0 100%);
  color: #fff;
  box-shadow: 0 8px 25px rgba(43,108,176,0.22);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(238, 90, 36, 0.6);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
  transform: translateY(-3px);
}

.hero-stats {
  display: flex;
  gap: 2rem;
}

.stat-item {
  text-align: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item:hover {
  transform: translateY(-5px);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  margin-top: 0.5rem;
  font-weight: 500;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image {
  width: 400px;
  height: 300px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  background-image: url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(26, 54, 93, 0.3), rgba(49, 130, 206, 0.3));
}

.hero-image img {
  display: none;
}

/* Sections */
.about, .subsidiaries, .services, .contact {
  padding: 6rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* About Section with Side Backgrounds */
.about {
  min-height: 100vh;
  padding: 6rem 0;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-white);
}

.about::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 30%;
  height: 100%;
  background-image: var(--about-bg-left);
  background-size: cover;
  background-position: center;
  opacity: 0.1;
  z-index: 1;
}

.about::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 30%;
  height: 100%;
  background-image: var(--about-bg-right);
  background-size: cover;
  background-position: center;
  opacity: 0.1;
  z-index: 1;
}

.about .container {
  position: relative;
  z-index: 2;
}

.about-content {
  display: block;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.about-description {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-gray);
  margin-bottom: 3rem;
}

.mission-vision {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.mission, .vision {
  padding: 2.5rem;
  background: linear-gradient(135deg, var(--bg-light), var(--bg-white));
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  text-align: center;
  border-left: 4px solid var(--primary-color);
}

.mission:hover, .vision:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.mission i, .vision i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.mission h4, .vision h4 {
  color: var(--primary-color);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.about-image {
  display: none;
}

/* Subsidiaries Section - Vertical Layout */
.subsidiaries {
  min-height: 100vh;
  padding: 6rem 0;
  position: relative;
  background: var(--bg-gray);
  display: flex;
  align-items: center;
}

.subsidiaries::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 25%;
  height: 100%;
  background-image: var(--subsidiaries-bg-left);
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  z-index: 1;
}

.subsidiaries::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 25%;
  height: 100%;
  background-image: var(--subsidiaries-bg-right);
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  z-index: 1;
}

.subsidiaries .container {
  position: relative;
  z-index: 2;
}

.subsidiaries-showcase {
  display: block;
  margin: 0;
  padding: 0;
}

.subsidiary-section {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-color);
  background: transparent; /* no side backgrounds */
}

/* reverse class flips image/content columns */
.subsidiary-section .subsidiary-image {
  width: 100%;
  height: 60vh;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-lg);
}

.subsidiary-section .subsidiary-content {
  padding: 1rem 2rem;
}

/* normal: image on right (because dir=rtl), content on left */
.subsidiary-section .subsidiary-image { grid-column: 2; grid-row: 1; }
.subsidiary-section .subsidiary-content { grid-column: 1; grid-row: 1; }

/* reverse: image on left, content on right */
.subsidiary-section.reverse .subsidiary-image { grid-column: 1; }
.subsidiary-section.reverse .subsidiary-content { grid-column: 2; }

/* Make text visually stronger */
.subsidiary-name { font-size: 2rem; font-weight: 800; color: var(--primary-color); margin-bottom: 1rem; }
.subsidiary-desc { color: var(--text-gray); line-height: 1.8; font-size: 1.05rem; margin-bottom: 1.5rem; }
.subsidiary-services { margin-top: 1rem; }

/* Remove small-card styling used before */
.subsidiary-showcase .subsidiary-showcase-item,
.subsidiary-showcase .subsidiary-image .subsidiary-overlay { display: none; }

/* Services Section - Tabbed Interface */
.services {
  min-height: 100vh;
  padding: 6rem 0;
  position: relative;
  background: var(--bg-white);
  display: flex;
  align-items: center;
}

.services::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 20%;
  height: 100%;
  background-image: var(--services-bg-left);
  background-size: cover;
  background-position: center;
  opacity: 0.1;
  z-index: 1;
}

.services::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 20%;
  height: 100%;
  background-image: var(--services-bg-right);
  background-size: cover;
  background-position: center;
  opacity: 0.1;
  z-index: 1;
}

.services .container {
  position: relative;
  z-index: 2;
}

.services-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.services-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.service-tab {
  padding: 1rem 2rem;
  background: var(--bg-light);
  color: var(--text-gray);
  border: none;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.service-tab.active,
.service-tab:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.service-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.service-content.active {
  display: block;
}

.service-details {
  background: var(--bg-white);
  padding: 3rem;
  border-radius: 25px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  border: 1px solid var(--border-color);
}

.service-icon-large {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 25px;
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.service-details h3 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.service-details p {
  font-size: 1.1rem;
  color: var(--text-gray);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.service-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-item {
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-item i {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.feature-item h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* Contact Section - Horizontal Layout */
.contact {
  min-height: 100vh;
  padding: 6rem 0;
  background-image: linear-gradient(rgba(26, 54, 93, 0.9), rgba(26, 54, 93, 0.9)), var(--contact-bg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  color: white;
}

.contact-content {
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.contact-title {
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.contact-desc {
  font-size: 1.3rem;
  text-align: center;
  margin-bottom: 4rem;
  color: rgba(255,255,255,0.9);
}

.contact-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 4rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  text-align: center;
}

.contact-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
}

.contact-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.contact-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-label {
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
}

.contact-value {
  font-size: 1.1rem;
  font-weight: 500;
}

/* Footer - Simplified */
.footer {
  background: var(--text-dark);
  color: white;
  padding: 1.2rem 0;
  text-align: center;
}

.footer-bottom {
  padding: 1rem 0;
}

/* Animation for service content */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column; /* تغيير الاتجاه إلى عمودي */
    align-items: flex-start; /* محاذاة العناصر إلى اليسار */
  }

  .main-nav {
    flex-direction: column; /* تغيير الاتجاه إلى عمودي */
    width: 100%; /* جعل القائمة تأخذ عرض كامل */
  }

  .nav-item {
    width: 100%; /* جعل العناصر تأخذ عرض كامل */
    text-align: center; /* محاذاة النص إلى الوسط */
  }

  .lang-toggle {
    width: 100%; /* جعل الزر يأخذ عرض كامل */
    margin-top: 0.5rem; /* إضافة مسافة بين الزر والقائمة */
  }

  /* Hero - stack and center everything */
  .hero-content { text-align: center; }
  .hero-buttons { align-items: center; justify-content: center; margin: 1rem auto 1.5rem; }
  .hero-buttons .btn { width: 100%; max-width: 420px; }

  /* Center and style hero stats */
  .hero-stats {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 0.6rem;
    flex-wrap: wrap;
  }
  .stat-item {
    min-width: 120px;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    color: white;
  }
  .stat-number { font-size: 1.6rem; }
  .stat-label { font-size: 0.85rem; }

  /* About: center CTA buttons */
  .about .about-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
  }
  .about .about-cta .btn {
    width: 100%;
    max-width: 380px;
  }

  /* Services: center tabs as stacked pills (already applied) and center content */
  .services .services-tabs { align-items: center; justify-content: center; }
  .service-tab { width: 100%; max-width: 420px; margin: 0 auto; }

  /* Subsidiaries: keep action buttons centered on image */
  .subsidiary-section .btn { margin: 0.5rem auto 0; display: inline-block; }

  /* Ensure mobile menu language button visible and works */
  #lang-toggle { display: none !important; }
  #lang-toggle-mobile { display: inline-flex !important; }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav {
    flex-direction: column;
    width: 100%;
  }

  .nav-item {
    padding: 0.5rem 1rem;
    width: 100%;
    text-align: center;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .btn {
    width: 100%;
    margin-bottom: 1rem;
  }

  .about-content {
    flex-direction: column;
    align-items: center;
  }

  .services-container {
    flex-direction: column;
  }

  .services-tabs {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .service-tab {
    width: 100%;
    text-align: center;
  }

  .contact-content {
    flex-direction: column;
    align-items: center;
  }

  .contact-item {
    width: 100%;
    text-align: center;
  }
}

/* تحسينات إضافية للأجهزة الصغيرة */
@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-desc {
    font-size: 0.9rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }
}

/* Mobile / Tablet improvements */
@media (max-width: 992px) {
  /* Reduce header height and ensure page content not hidden under fixed header */
  .header {
    padding: 0.6rem 0;
  }
  body {
    padding-top: 72px; /* safe space for fixed header on smaller screens */
  }

  /* Hero: less vertical space, stack content */
  .hero {
    min-height: 70vh;
    padding: 6rem 0 2.5rem;
    background-attachment: scroll;
  }
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .hero-image {
    width: 320px;
    height: 220px;
    margin: 0 auto;
  }
  .hero-title { font-size: 2.2rem; }
  .hero-desc { font-size: 1rem; }

  /* Buttons stack on small tablets */
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  .hero-buttons .btn { width: 100%; max-width: 360px; }

  /* Services: narrower container and tighter paddings */
  .services-container { max-width: 850px; padding: 0 12px; }
  .service-details { padding: 1.5rem; border-radius: 14px; }
  .service-icon-large { width: 72px; height: 72px; font-size: 1.6rem; }
  .service-details h3 { font-size: 1.4rem; }
  .service-details p { font-size: 0.98rem; }

  /* Make service tabs horizontally scrollable on small screens */
  .services-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    justify-content: flex-start;
  }
  .service-tab { flex: 0 0 auto; margin-right: 0.5rem; }

  /* Contact: ensure grid stacks earlier */
  .contact-details { grid-template-columns: 1fr; }
}

/* Small phones */
@media (max-width: 768px) {
  /* Subsidiaries: single column stacked */
  .subsidiary-section {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 2rem 0;
    gap: 1.5rem;
  }
  .subsidiary-section .subsidiary-image {
    height: 220px;
    border-radius: 12px;
    width: 100%;
  }
  .subsidiary-section .subsidiary-content {
    padding: 0 0.5rem;
  }
  .subsidiary-section.reverse .subsidiary-image,
  .subsidiary-section.reverse .subsidiary-content {
    grid-column: 1;
  }

  /* Reduce hero typography */
  .hero-title { font-size: 1.8rem; }
  .hero-desc { font-size: 0.95rem; }

  /* Buttons: slightly smaller */
  .btn { padding: 0.8rem 1.2rem; font-size: 0.95rem; }
  .btn-primary, .btn-outline { width: auto; }

  /* Services: compact feature items */
  .service-features-grid { gap: 1rem; }
  .feature-item { padding: 0.9rem; }
}

/* Extra small devices */
@media (max-width: 480px) {
  body { padding-top: 64px; }

  .header-content { padding: 0.5rem 0; }
  .logo { width: 44px; height: 44px; }

  .section-title { font-size: 1.6rem; }
  .hero-image { width: 260px; height: 160px; }

  .stat-number { font-size: 1.6rem; }
  .stat-label { font-size: 0.8rem; }

  .subsidiary-section .subsidiary-image { height: 180px; }
  .subsidiary-name { font-size: 1.4rem; }
  .subsidiary-desc { font-size: 0.95rem; }

  .service-tab { padding: 0.5rem 0.9rem; font-size: 0.85rem; }

  /* Ensure hero inline logo remains visible and not oversized */
  .hero-image img { max-width: 220px; }
}

/* Small accessibility / touch targets */
@media (hover: none) {
  .service-tab, .btn { box-shadow: none; }
}

/* Loading animation */
.subsidiary-image,
.about-image {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

/* Remove side/background pseudo elements for all sections except hero */
.about::before,
.about::after,
.subsidiaries::before,
.subsidiaries::after,
.services::before,
.services::after,
.contact::before,
.contact::after {
  display: none !important;
}

/* About: make single professional column (remove side image) */
.about-content {
  display: block;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Remove about-image visual (no image beside text) */
.about-visual,
.about-image {
  display: none;
}

/* Subsidiary - full page sections stacked, image left/right alternation */
.subsidiaries-showcase {
  display: block;
  margin: 0;
  padding: 0;
}

.subsidiary-section {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-color);
  background: transparent; /* no side backgrounds */
}

/* reverse class flips image/content columns */
.subsidiary-section .subsidiary-image {
  width: 100%;
  height: 60vh;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-lg);
}

.subsidiary-section .subsidiary-content {
  padding: 1rem 2rem;
}

/* normal: image on right (because dir=rtl), content on left */
.subsidiary-section .subsidiary-image { grid-column: 2; grid-row: 1; }
.subsidiary-section .subsidiary-content { grid-column: 1; grid-row: 1; }

/* reverse: image on left, content on right */
.subsidiary-section.reverse .subsidiary-image { grid-column: 1; }
.subsidiary-section.reverse .subsidiary-content { grid-column: 2; }

/* Make text visually stronger */
.subsidiary-name { font-size: 2rem; font-weight: 800; color: var(--primary-color); margin-bottom: 1rem; }
.subsidiary-desc { color: var(--text-gray); line-height: 1.8; font-size: 1.05rem; margin-bottom: 1.5rem; }
.subsidiary-services { margin-top: 1rem; }

/* Remove small-card styling used before */
.subsidiary-showcase .subsidiary-showcase-item,
.subsidiary-showcase .subsidiary-image .subsidiary-overlay { display: none; }

/* Services: improve layout and visuals, single page tabbed area kept */
.services-container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Buttons: make primary blue to match logo */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #2b6cb0 100%);
  color: #fff;
  box-shadow: 0 8px 25px rgba(43,108,176,0.22);
}

/* smaller footer */
.footer { padding: 1.2rem 0; }

/* Accessibility: ensure each full-section occupies focusable area */
.subsidiary-section:focus { outline: none; }

/* Make outline buttons visible on light/white sections (About, Services, Subsidiaries, Contact) */
.about .btn-outline,
.services .btn-outline,
.subsidiaries .btn-outline,
.contact .btn-outline {
  color: var(--primary-color);
  border: 2px solid rgba(26,54,93,0.14);
  background: transparent;
  box-shadow: none;
}

.about .btn-outline:hover,
.services .btn-outline:hover,
.subsidiaries .btn-outline:hover,
.contact .btn-outline:hover {
  background: rgba(26,54,93,0.06);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* Ensure hero outline button stays white on dark hero background */
.hero .btn-outline {
  color: white;
  border: 2px solid rgba(255,255,255,0.5);
}

/* Desktop Header (min-width: 769px) */
@media (min-width: 769px) {
  .header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(226, 232, 240, 0.3);
    padding: 1rem 0;
  }

  .desktop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    gap: 2rem;
  }

  .logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .logo {
    width: 50px;
    height: 50px;
  }

  .company-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
  }

  .tagline {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin: 0;
  }

  .main-nav {
    display: flex;
    gap: 1rem;
  }

  .nav-item {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
  }

  .nav-item:hover {
    color: var(--primary-color);
    background: var(--bg-light);
  }

  .lang-toggle {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
  }

  /* Hide mobile elements on desktop */
  .mobile-header,
  .mobile-menu-overlay {
    display: none !important;
  }
}

/* Mobile Header */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

/* Adjust header-toggle button */
.header-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--primary-color);
  font-size: 1.5rem; /* حجم الأيقونة */
  margin-left: auto; /* لضمان وجوده على اليمين */
}

/* Mobile Menu Overlay
   Replaced full-screen overlay with a dropdown panel attached to header
   (keeps header as the main visible element and shows menu as its extension) */
.mobile-menu-overlay {
  position: absolute;
  top: 100%;               /* مباشرة تحت الهيدر */
  left: 0;
  right: 0;
  background: transparent; /* الخلفية البيضاء يُوفّرها اللوحة عند التفعيل */
  max-height: 0;           /* مخفية بشكل افتراضي */
  overflow: hidden;
  z-index: 998;
  transition: max-height 0.32s ease, opacity 0.25s ease, padding 0.25s ease;
  opacity: 0;
  padding: 0;
  display: block;
}

/* عندما تُفعل، تمتد اللوحة تحت الهيدر بدل تغطية الصفحة */
.mobile-menu-overlay.active {
  max-height: 520px; /* اضبط إن أردت أقل/أكثر */
  opacity: 1;
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(250,250,250,0.98));
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  padding: 1rem 0;
}

/* تجعل محتوى الـ menu يبدو كامتداد للهيدر: مركزي، بعرض محدود */
.mobile-nav {
  margin: 0 auto;
  width: 100%;
  max-width: 440px;
  background: transparent;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
  padding: 0 0.8rem;
}

/* كل رابط يصبح زر واسع وواضح للضغط باللمس */
.mobile-nav .nav-item {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  text-align: center;
  background: #fff;
  border-radius: 10px;
  color: var(--text-dark);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  border: 1px solid var(--border-color);
}

/* زر الإغلاق لا يظهر كـ "هيدر مصطنع" — نستخدم التفعيل/إلغاء التفعيل */
.header-close {
  display: none; /* نُخفي زر الإغلاق الثانوي إن لم نرغب به */
}

/* ضمان إخفاء عناصر الجوال على ديسكتوب كما كانت */
@media (min-width: 769px) {
  .mobile-header,
  .mobile-menu-overlay {
    display: none !important;
  }
}

/* remove any .mobile-header styles if present (we use unified header) */
.mobile-header { display: none !important; }

/* header-actions wrapper */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* header-toggle: only visible on small screens */
.header-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--primary-color);
  font-size: 1.5rem;
  display: none; /* hidden by default; shown on mobile below */
  padding: 0.4rem;
  border-radius: 8px;
}

/* ensure mobile menu overlay is attached under header (already present) */
.mobile-menu-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: transparent;
  max-height: 0;
  overflow: hidden;
  z-index: 998;
  transition: max-height 0.28s cubic-bezier(.2,.9,.2,1), opacity 0.22s ease, padding 0.22s ease;
  opacity: 0;
  padding: 0;
  display: block;
}
.mobile-menu-overlay.active {
  max-height: 520px;
  opacity: 1;
  background: linear-gradient(180deg, rgba(255,255,255,0.995), rgba(250,250,250,0.98));
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  padding: 0.8rem 0 1rem;
}

/* Responsive: make unified header adapt on mobile */
@media (max-width: 768px) {
  .desktop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0 0.6rem;
  }

  /* stack nav hidden by default (we use panel) */
  .main-nav { display: none; }

  /* show toggle on mobile */
  .header-toggle { display: inline-flex; }

  /* ensure brand compact */
  .logo { width: 40px; height: 40px; }
  .company-name { font-size: 1rem; }
  .tagline { font-size: 0.7rem; }

  /* header actions order depending on direction */
  html[dir="rtl"] .desktop-header .header-actions { order: 2; }
  html[dir="rtl"] .desktop-header .logo-section   { order: 1; }

  html[dir="ltr"] .desktop-header .header-actions { order: 1; }
  html[dir="ltr"] .desktop-header .logo-section   { order: 2; }
}

/* Desktop: show full nav, hide mobile toggle */
@media (min-width: 769px) {
  .main-nav { display: flex; }
  .header-toggle { display: none; }
  .mobile-menu-overlay { display: none !important; }
}

/* Mobile: hide header language button, use only mobile menu language button */
#lang-toggle-mobile { display: none; }

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  /* hide header language toggle on mobile (keep mobile menu's one) */
  #lang-toggle { display: none !important; }
  #lang-toggle-mobile { display: inline-flex !important; }

  /* ensure header actions layout is compact */
  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: auto;
  }

  /* Position menu toggle based on document direction:
     - Arabic (dir=rtl): place toggle on the left of the header (user requested)
     - English (dir=ltr): place toggle on the right of the header */
  html[dir="rtl"] .header-toggle {
    order: -1;             /* appear before logo-section */
    margin-left: 0;
    margin-right: 0.6rem;
  }
  html[dir="rtl"] .logo-section {
    order: 0;
  }

  html[dir="ltr"] .header-toggle {
    order: 1;              /* appear after logo-section */
    margin-right: 0;
    margin-left: 0.6rem;
  }
  html[dir="ltr"] .logo-section {
    order: 0;
  }
}

/* Final override: place mobile menu toggle right of brand in LTR, left in RTL */
@media (max-width: 768px) {
  /* ensure header is one row and items ordered explicitly */
  .desktop-header {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.6rem;
  }

  /* hide main nav on mobile (we use the attached panel) */
  .main-nav { display: none !important; }

  /* default order: brand first, actions after (will be overridden per dir) */
  .desktop-header .logo-section { order: 0; }
  .desktop-header .header-actions { order: 1; }

  /* LTR: push actions to the right (after brand) */
  html[dir="ltr"] .desktop-header { justify-content: flex-start; }
  html[dir="ltr"] .desktop-header .logo-section { order: 0; }
  html[dir="ltr"] .desktop-header .header-actions {
    order: 1;
    margin-left: auto; /* pushes actions to the far right */
    margin-right: 0;
  }
  html[dir="ltr"] .header-toggle { order: 0; } /* inside actions keep natural order */

  /* RTL: show actions on the left of brand (user requested) */
  html[dir="rtl"] .desktop-header { justify-content: flex-start; }
  html[dir="rtl"] .desktop-header .header-actions {
    order: -1; /* appear before brand */
    margin-left: 0;
    margin-right: 0.6rem;
  }
  html[dir="rtl"] .header-toggle { order: 0; }

  /* ensure header language button hidden on mobile (kept in mobile panel) */
  #lang-toggle { display: none !important; }
  #lang-toggle-mobile { display: inline-flex !important; }

  /* show toggle button on mobile */
  .header-toggle { display: inline-flex !important; }
}

/* Subsidiaries: use company image as background with dim overlay on mobile and place text above it */
@media (max-width: 768px) {
  .subsidiary-section {
    position: relative;
    display: block;
    min-height: 320px;
    padding: 0;
    margin-bottom: 1.25rem;
    border-bottom: none;
    overflow: hidden;
    border-radius: 12px;
  }

  /* make the image fill the section and dim it for legibility */
  .subsidiary-section .subsidiary-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.55) saturate(0.95);
    transform-origin: center;
    z-index: 1;
    border-radius: 12px;
  }

  /* overlay gradient to further improve contrast */
  .subsidiary-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,10,0.28) 0%, rgba(10,10,10,0.45) 60%, rgba(10,10,10,0.55) 100%);
    z-index: 2;
    pointer-events: none;
  }

  /* place content above the image and center it */
  .subsidiary-section .subsidiary-content {
    position: relative;
    z-index: 3;
    padding: 1.25rem;
    color: #fff; /* text on top of dimmed image */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    min-height: 320px;
    text-align: center;
    align-items: center;
    background: transparent;
  }

  .subsidiary-section .subsidiary-name {
    color: #fff;
    text-shadow: 0 6px 18px rgba(0,0,0,0.6);
    font-size: 1.4rem;
  }

  .subsidiary-section .subsidiary-desc {
    color: rgba(255,255,255,0.92);
    font-size: 0.98rem;
    line-height: 1.6;
    max-width: 92%;
    margin: 0 auto;
  }

  .subsidiary-section .subsidiary-services h4 {
    color: rgba(255,255,255,0.95);
    margin-top: 0.75rem;
  }

  .subsidiary-section .services-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
  }

  .service-tag {
    background: rgba(255,255,255,0.12);
    color: #fff;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(255,255,255,0.08);
  }

  /* make action buttons visible and readable on image */
  .subsidiary-section .btn {
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  }

  /* remove large image element spacing */
  .subsidiary-section .subsidiary-image img,
  .subsidiary-section .subsidiary-image .subsidiary-overlay {
    display: none;
  }
}

/* Mobile: improve buttons, center them and make 'اطلع على خدمات ذات صلة' readable */
@media (max-width: 768px) {
  /* Hero / main CTAs: full-width, centered, larger touch target */
  .hero-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
  }
  .hero-buttons .btn {
    width: 100%;
    max-width: 420px;
    padding: 0.95rem 1.2rem;
    font-size: 1rem;
    border-radius: 12px;
    text-align: center;
  }

  /* About: center CTA buttons and give consistent sizing */
  .about .about-cta,
  .about .btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }
  .about .about-cta .btn {
    width: 100%;
    max-width: 380px;
    padding: 0.9rem 1rem;
    font-size: 0.98rem;
    border-radius: 10px;
  }

  /* Subsidiaries: ensure action buttons visible on top of dimmed image */
  .subsidiary-section .btn {
    min-width: 160px;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-weight: 700;
  }

  /* Make 'اطلع على خدمات ذات صلة' (outline) clear on dimmed background */
  .subsidiary-section .btn-outline {
    background: rgba(255,255,255,0.95); /* light background for contrast */
    color: var(--primary-color);
    border: 1px solid rgba(26,54,93,0.12);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  }
  .subsidiary-section .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2b6cb0 100%);
    color: #fff;
    box-shadow: 0 10px 26px rgba(26,54,93,0.25);
  }
  .subsidiary-section .btn + .btn { margin-top: 0.6rem; }

  /* Mobile nav items: bigger, centered and touch-friendly */
  .mobile-nav .nav-item {
    padding: 1rem 1.1rem;
    font-size: 1rem;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
  }

  /* Services: tabs become stacked centered pills on mobile for easier tapping */
  .services .services-tabs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }
  .service-tab {
    width: 100%;
    max-width: 420px;
    padding: 0.85rem 1rem;
    border-radius: 999px;
    text-align: center;
    font-size: 0.98rem;
  }
  .service-content .service-details { padding: 1.25rem; }

  /* Slight spacing and visual polish for buttons on very small screens */
  @media (max-width: 420px) {
    .hero-buttons .btn,
    .about .about-cta .btn,
    .mobile-nav .nav-item,
    .service-tab {
      font-size: 0.95rem;
      padding: 0.8rem 0.9rem;
    }
  }
}

/* center mobile language button and header brand text on small screens */
@media (max-width: 768px) {
  /* mobile menu language button: centered and full-width-friendly */
  #lang-toggle-mobile {
    display: inline-flex !important;
    margin: 1rem auto 0;
    justify-content: center;
    align-items: center;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-md);
    max-width: 220px;
    width: calc(100% - 48px);
  }

  /* center brand (company name + tagline) on mobile to reflect language change visually */
  .desktop-header .brand-info {
    text-align: center;
    margin: 0 auto;
  }

  /* ensure header-actions stay compact to the right/left as configured */
  .desktop-header { align-items: center; }
}
