/* =========================================================
   شركة البُعد الهندسي الحديث للمقاولات والاستشارات الهندسية
   Modern Engineering Dimension - Master Stylesheet
   ========================================================= */

:root {
  --primary-navy: #0B1528;
  --secondary-navy: #132238;
  --accent-gold: #C5A059;
  --accent-gold-hover: #b08d48;
  --accent-gold-light: #f5eedf;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --bg-light: #F8FAFC;
  --bg-white: #FFFFFF;
  --border-color: #E2E8F0;
  --success-green: #0D9488;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(11, 21, 40, 0.08);
  --shadow-lg: 0 12px 30px rgba(11, 21, 40, 0.12);
  --font-ar: 'Cairo', sans-serif;
  --font-en: 'Outfit', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-ar);
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
  overflow-x: hidden;
}

/* تنسيق النسخة الإنجليزية عند التبديل */
body.en-lang {
  font-family: var(--font-en);
  direction: ltr !important;
  text-align: left !important;
}

body.en-lang .icon-flip {
  transform: rotate(180deg);
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 1. الشريط العلوي الرئاسي */
.top-bar {
  background-color: var(--primary-navy);
  color: #94A3B8;
  font-size: 0.78rem;
  border-bottom: 2px solid rgba(197, 160, 89, 0.2);
  padding: 6px 0;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-info {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.top-info span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #94A3B8;
  font-size: 0.76rem;
  padding: 2px 8px;
  border-radius: 4px;
  transition: var(--transition);
}

.top-info span:hover {
  color: var(--accent-gold);
}

.top-info i {
  color: var(--accent-gold);
  font-size: 0.75rem;
}

/* فاصل بين عناصر الشريط */
.top-info span + span {
  border-right: 1px solid rgba(255,255,255,0.1);
  padding-right: 18px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.compliance-badge {
  background: rgba(197, 160, 89, 0.15);
  color: var(--accent-gold);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(197, 160, 89, 0.3);
}

.lang-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  transition: var(--transition);
}

.lang-btn:hover {
  background: var(--accent-gold);
  color: var(--primary-navy);
}

/* 2. الهيدر وشريط التنقل */
.main-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-emblem {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-navy), #1e3a63);
  border: 2px solid var(--accent-gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 1px;
  box-shadow: 0 4px 10px rgba(11, 21, 40, 0.15);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name-ar {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--primary-navy);
  line-height: 1.2;
}

.brand-sub-ar {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.brand-en {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* ===== القائمة المنسدلة الذكية ===== */
.nav-dropdown-wrapper {
  position: relative;
}

.nav-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-navy);
  border: 2px solid var(--accent-gold);
  color: #fff;
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-ar);
  font-size: 0.9rem;
  font-weight: 700;
  transition: var(--transition);
}

.nav-toggle-btn:hover {
  background: var(--accent-gold);
  color: var(--primary-navy);
}

.nav-toggle-btn .chevron {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.nav-toggle-btn.open {
  background: var(--accent-gold);
  color: var(--primary-navy);
}

.nav-toggle-btn.open .chevron {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 8px;
  min-width: 250px;
  display: none;
  z-index: 9999;
  box-shadow: 0 20px 50px rgba(11, 21, 40, 0.15);
}

.nav-dropdown.open {
  display: block;
  animation: dropFade 0.2s ease;
}

@keyframes dropFade {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-dropdown a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  color: var(--text-dark);
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  transition: var(--transition);
  gap: 10px;
}

.nav-dropdown a i {
  color: var(--accent-gold);
  font-size: 0.85rem;
  width: 18px;
  text-align: center;
}

.nav-dropdown a:hover {
  background: var(--accent-gold-light);
  color: var(--primary-navy);
}

.nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 5px 8px;
}

/* إخفاء القائمة القديمة */
.nav-menu { display: none !important; }

.btn-profile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-navy);
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--primary-navy);
  transition: var(--transition);
}

.btn-profile:hover {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--primary-navy);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-navy);
  cursor: pointer;
}

/* 3. الهيرو الفخم */
.hero-section {
  position: relative;
  min-height: 85vh;
  background: url('https://images.unsplash.com/photo-1541888946425-d0fbb186156f?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
  display: flex;
  align-items: center;
  padding: 80px 0;
  color: #fff;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11, 21, 40, 0.95) 0%, rgba(19, 34, 56, 0.88) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(197, 160, 89, 0.2);
  border: 1px solid rgba(197, 160, 89, 0.5);
  color: var(--accent-gold);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-desc {
  font-size: 1.1rem;
  color: #CBD5E1;
  line-height: 1.8;
  margin-bottom: 35px;
  max-width: 780px;
}

.hero-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 50px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent-gold);
  color: var(--primary-navy);
  box-shadow: 0 4px 15px rgba(197, 160, 89, 0.35);
}

.btn-primary:hover {
  background: #d4b472;
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* شريط الإحصائيات */
.stats-ribbon {
  display: grid;
  grid-cols: 1;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  background: rgba(11, 21, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.stat-card {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-gold);
  font-family: var(--font-en);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.8rem;
  color: #CBD5E1;
  font-weight: 600;
}

/* العناوين العامة للأقسام */
.section {
  padding: 90px 0;
}

.section-header {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 50px auto;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  background: var(--accent-gold-light);
  padding: 4px 14px;
  border-radius: 20px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary-navy);
  line-height: 1.3;
  margin-bottom: 15px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* 4. كروت البيانات القانونية لـ CBL */
.legal-section {
  background: #fff;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}

.legal-card {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px 24px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.legal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gold);
  opacity: 0;
  transition: var(--transition);
}

.legal-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-gold);
}

.legal-card:hover::before {
  opacity: 1;
}

.legal-icon {
  width: 60px;
  height: 60px;
  background: var(--accent-gold-light);
  color: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 20px auto;
}

.legal-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 8px;
}

.legal-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.legal-val span {
  font-family: var(--font-en);
  color: var(--primary-navy);
}

.legal-status {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--success-green);
  font-weight: 700;
  background: rgba(13, 148, 136, 0.1);
  padding: 3px 10px;
  border-radius: 6px;
}

/* 5. مجالات الخدمات */
.services-section {
  background: var(--bg-light);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 25px;
}

.service-box {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 35px 25px;
  transition: var(--transition);
}

.service-box:hover {
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.service-icon {
  width: 55px;
  height: 55px;
  background: var(--primary-navy);
  color: var(--accent-gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.service-box h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 12px;
}

.service-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* 6. المشاريع وسابقة الأعمال */
.projects-section {
  background: #fff;
}

.project-filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.filter-btn {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary-navy);
  color: #fff;
  border-color: var(--primary-navy);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 30px;
}

.project-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.project-thumb {
  position: relative;
  height: 230px;
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-thumb img {
  transform: scale(1.05);
}

.project-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.status-completed {
  background: rgba(13, 148, 136, 0.95);
}

.status-ongoing {
  background: rgba(197, 160, 89, 0.95);
}

.project-info {
  padding: 24px;
}

.project-client {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 6px;
}

.project-info h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 10px;
}

.project-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 7. أسطول الآليات والمعدات */
.fleet-section {
  background: var(--bg-light);
}

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.fleet-item {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 25px;
  text-align: center;
  transition: var(--transition);
}

.fleet-item:hover {
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-md);
}

.fleet-icon {
  font-size: 2rem;
  color: var(--primary-navy);
  margin-bottom: 15px;
}

.fleet-item h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 8px;
}

.fleet-count {
  font-size: 0.8rem;
  color: var(--accent-gold);
  font-weight: 700;
}

/* 8. صندوق الامتثال لـ CBL */
.compliance-section {
  background: #fff;
}

.compliance-box {
  background: linear-gradient(135deg, var(--primary-navy), var(--secondary-navy));
  color: #fff;
  border-radius: 24px;
  padding: 50px;
  display: flex;
  gap: 40px;
  align-items: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(197, 160, 89, 0.3);
}

.compliance-badge-large {
  width: 100px;
  height: 100px;
  background: rgba(197, 160, 89, 0.15);
  border: 2px solid var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.compliance-text .comp-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.compliance-text h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 8px 0 16px 0;
  line-height: 1.4;
}

.compliance-text p {
  font-size: 0.95rem;
  color: #CBD5E1;
  line-height: 1.8;
  margin-bottom: 24px;
}

.compliance-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compliance-points span {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #E2E8F0;
}

.compliance-points i {
  color: var(--accent-gold);
}

/* 9. قسم الاتصال */
.contact-section {
  background: var(--bg-light);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
}

.contact-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px;
}

.contact-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 25px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
}

.info-item {
  display: flex;
  gap: 16px;
  margin-bottom: 22px;
}

.info-item i {
  width: 44px;
  height: 44px;
  background: var(--accent-gold-light);
  color: var(--accent-gold);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.info-item strong {
  display: block;
  font-size: 0.9rem;
  color: var(--primary-navy);
  margin-bottom: 3px;
}

.info-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

.btn-submit {
  width: 100%;
  justify-content: center;
  border: none;
}

/* 10. الفوتر */
.main-footer {
  background: var(--primary-navy);
  color: #fff;
  padding-top: 70px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 50px;
}

.footer-brand-name {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.footer-brand-sub {
  font-size: 0.8rem;
  color: #94A3B8;
  margin-bottom: 16px;
}

.footer-desc {
  font-size: 0.85rem;
  color: #94A3B8;
  line-height: 1.8;
  max-width: 420px;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 8px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 2px;
  background: var(--accent-gold);
}

body.en-lang .footer-col h4::after {
  right: auto;
  left: 0;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: #94A3B8;
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition);
}

.footer-col ul li a:hover {
  color: var(--accent-gold);
  padding-right: 5px;
}

body.en-lang .footer-col ul li a:hover {
  padding-right: 0;
  padding-left: 5px;
}

.cert-badges {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cert-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #CBD5E1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cert-item i {
  color: var(--accent-gold);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 0;
  background: #070e1b;
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #64748B;
  flex-wrap: wrap;
  gap: 10px;
}

.domain-ref {
  font-family: var(--font-en);
  color: var(--accent-gold);
}

/* استجابة الشاشات الصغيرة (Responsive) */
@media (max-width: 992px) {
  .hero-title { font-size: 2.2rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: 1fr; }
  .compliance-box { flex-direction: column; text-align: center; }
  .compliance-points span { justify-content: center; }
  /* القائمة المنسدلة تعمل على كل الشاشات */
  .mobile-toggle { display: none; }
  /* تعديل موضع القائمة المنسدلة للشاشات الصغيرة */
  .nav-dropdown {
    right: auto;
    left: 0;
    min-width: 220px;
  }
}

@media (max-width: 600px) {
  .hero-title { font-size: 1.8rem; }
  .top-info { display: none; }
  .top-bar-content { justify-content: center; }
  .hero-buttons { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .nav-toggle-btn span { display: none; }
  .nav-toggle-btn { padding: 9px 14px; }
}

@media (max-width: 600px) {
  .hero-title { font-size: 1.8rem; }
  .top-info { display: none; }
  .top-bar-content { justify-content: center; }
  .hero-buttons { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}