/* --- CSS VARIABLES & THEME SETUP (Slate & Gold Metal Theme) --- */
:root {
  --primary-color: #1e293b;   /* رمادي حديدي داكن وراقي */
  --secondary-color: #d97706; /* لون أمبر ذهبي دافئ للتحويلات والأزرار التفاعلية */
  --dark-color: #0f172a;      /* لون النصوص الأساسي الداكن */
  --light-color: #f8fafc;     /* الخلفية الفاتحة المريحة للعين */
  --white: #ffffff;
  --text-gray: #475569;
  --transition-fast: 0.25s ease-in-out;
  --border-radius: 12px;
  --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* --- MOBILE-FIRST RESPONSIVE RESET (قواعد حاسمة لمنع التضخم والاهتزاز) --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  max-width: 100% !important;
  overflow-x: hidden !important; /* يمنع أي انزياح أو ظهور شريط تمرير أفقي على الجوال نهائياً */
  -webkit-text-size-adjust: 100%; /* يمنع متصفحات آبل من تكبير الخطوط تلقائياً */
  background-color: var(--light-color);
  color: var(--dark-color);
}

img, video, svg {
  max-width: 100% !important; /* إجبار الصور على البقاء داخل نطاق الشاشة مهما كان مقاسها الأصلي */
  height: auto !important;
  display: block;
}

html {
  scroll-behavior: smooth;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  direction: rtl;
}

/* --- CLS PREVENTION & HEADER --- */
#globalHeader {
  display: block;
  min-height: 75px; 
  background-color: var(--white);
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

/* --- NAVIGATION BAR & CONTAINER (الإصلاح الجذري للهيدر) --- */
.nav-bar {
  width: 100%;
  background-color: var(--white);
}

.nav-container {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important; /* توزيع العناصر على الأطراف أفقياً بالتساوي */
  padding: 15px 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-color);
  text-decoration: none;
  white-space: nowrap;
}

/* NAVIGATION LINKS */
.nav-links {
  display: flex;
  list-style: none;
  gap: 15px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-gray);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
  padding: 8px 10px;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--secondary-color);
}

/* Hamburger menu button for mobile rendering */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.menu-toggle .bar {
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* --- ACCESSIBLE DROPDOWN --- */
.dropdown {
  position: relative;
}

.dropdown-trigger {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-gray);
  cursor: pointer;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dropdown-trigger:hover,
.dropdown-trigger:focus {
  color: var(--secondary-color);
}

.dropdown-content {
  display: none;
  position: absolute !important;
  top: 100%;
  right: 0 !important;
  left: auto !important;
  background-color: var(--white);
  min-width: 200px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
  z-index: 1010;
  list-style: none;
  padding: 8px 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.dropdown-content li a {
  display: block;
  padding: 10px 16px;
  color: var(--dark-color);
  font-size: 0.9rem;
  transition: background var(--transition-fast);
}

.dropdown-content li a:hover {
  background-color: var(--light-color);
  color: var(--secondary-color);
}

/* --- HERO BANNER --- */
.hero-section {
  position: relative;
  background-color: var(--primary-color);
  color: var(--white);
  padding: 60px 20px;
  text-align: center;
  overflow: hidden;
  width: 100%;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  opacity: 0.3;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero-content h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 15px;
  line-height: 1.4;
}

.hero-content p {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 25px;
  color: #f1f5f9;
}

/* --- BUTTONS --- */
.btn-primary {
  display: inline-block;
  background-color: var(--secondary-color);
  color: var(--white);
  padding: 12px 28px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.btn-primary:hover {
  background-color: #b45309;
  transform: translateY(-2px);
}

/* --- MAIN SECTIONS LAYOUT --- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  width: 100%;
}

main p {
  line-height: 1.8 !important;
  color: var(--text-gray);
  margin-bottom: 15px;
  font-size: 0.95rem;
}

/* --- SERVICES GALLERY & CARDS --- */
.section-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 35px;
  position: relative;
  padding-bottom: 12px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 4px;
  background-color: var(--secondary-color);
  border-radius: 2px;
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
  width: 100%;
}

.card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-fast);
  display: flex;
  flex-direction: column;
  width: 100%;
}

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

.card-img-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #e2e8f0;
}

.card img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card-content {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-content h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.card-content p {
  font-size: 0.85rem;
  color: var(--text-gray);
  line-height: 1.6;
  margin-bottom: 15px;
}

.card-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
}

/* --- CONVERSION CONTACT FORM --- */
.form-section {
  background-color: var(--white);
  padding: 30px 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  max-width: 600px;
  margin: 50px auto 0 auto;
  width: 100%;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--secondary-color);
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background-color: var(--secondary-color);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--box-shadow);
  transition: background var(--transition-fast);
}

.btn-submit:hover {
  background-color: #b45309;
}

/* --- DYNAMIC INJECTED COMPONENT CONTROLS (CRITICAL OVERRIDES) --- */

/* 1. Floating Actions (Fixed to the Right) */
.floating-actions {
  position: fixed !important;
  bottom: 20px !important;
  right: 15px !important; /* تثبيت في اليمين تماماً */
  left: auto !important;  /* إلغاء الارتكاز لليسار */
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  z-index: 9999 !important;
}

.btn-float {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 10px 16px !important;
  border-radius: 50px !important;
  color: var(--white) !important;
  text-decoration: none !important;
  font-weight: bold !important;
  font-size: 0.85rem !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
}

.btn-whatsapp {
  background-color: #25d366 !important;
}

.btn-call {
  background-color: #0284c7 !important;
}

/* 2. Back To Top Button (Fixed to the Left) */
.btn-back-to-top {
  position: fixed !important;
  bottom: 20px !important;
  left: 15px !important;  /* تثبيت في اليسار تماماً */
  right: auto !important; /* إلغاء الارتكاز لليمين */
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background-color: var(--primary-color) !important;
  color: var(--white) !important;
  border: none !important;
  cursor: pointer !important;
  display: none; 
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.1rem !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
  z-index: 9999 !important;
}

/* --- FOOTER DESIGN --- */
.site-footer {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 50px 20px 20px 20px;
  margin-top: 50px;
  width: 100%;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
}

.footer-column h3 {
  font-size: 1.05rem;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 6px;
  display: inline-block;
}

.footer-column p {
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.7;
}

.footer-column ul {
  list-style: none;
}

.footer-column ul li {
  margin-bottom: 10px;
}

.footer-column ul li a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

.footer-column ul li a:hover {
  color: var(--secondary-color);
}

.footer-phone, .footer-whatsapp {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  margin-top: 8px;
  font-size: 0.9rem;
}

.footer-bottom {
  max-width: 1200px;
  margin: 30px auto 0 auto;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.8rem;
  color: #94a3b8;
}

.developer-text {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #cbd5e1 !important;
}

.developer-text a {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
}

/* --- RESPONSIVE MEDIA QUERIES (تحسينات الجوال الشاملة للهيدر) --- */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex !important; /* إظهار زر الهمبرغر على الجوال */
  }

  .nav-container {
    padding: 10px 15px !important;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--white);
    padding: 20px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 999;
    gap: 15px;
  }

  .nav-links.active {
    display: flex;
  }

  .dropdown-content {
    position: static !important;
    box-shadow: none;
    border: none;
    background-color: var(--light-color);
    width: 100%;
    padding: 10px 0;
  }

  .hero-content h1 {
    font-size: 1.4rem;
  }

  .hero-content p {
    font-size: 0.85rem;
  }
}
