/* =============================
   🌟 Line Ex Logistics - Fixed Mobile Layout
   ============================= */

:root {
  --primary-color: #1a1a1a;
  --primary-gradient: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  --secondary-color: #333333;
  --accent-color: #fe560b;
  --accent-gradient: linear-gradient(135deg, #fe560b 0%, #ff8e53 100%);
  --light-gray: #f4f6f9;
  --text-color: #2c3e50;
  --white-color: #ffffff;
  --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================
   1. General & Reset (Fix Overflow)
   ============================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
  /* هام جداً: يمنع ظهور المساحات البيضاء الجانبية */
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', 'Cairo', sans-serif;
  color: var(--text-color);
  background: var(--white-color);
  direction: rtl;
}

h1,
h2,
h3,
h4 {
  color: var(--primary-color);
  font-weight: 800;
  line-height: 1.3;
}

h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
  width: 100%;
}

h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent-color);
  margin: 15px auto 30px;
  border-radius: 2px;
}

.section-subtitle {
  text-align: center;
  font-size: 1.15rem;
  color: #666;
  margin-bottom: 50px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 15px;
}

section {
  padding: 80px 0;
  position: relative;
  overflow: hidden;
  /* يمنع أي عنصر داخل السكشن من الخروج عن الحدود */
}

/* تعديل الحاوية لتكون مرنة */
.container {
  width: 100%;
  /* استخدام كامل العرض */
  max-width: 1200px;
  margin: auto;
  padding-left: 20px;
  /* مسافة أمان للنصوص */
  padding-right: 20px;
  /* مسافة أمان للنصوص */
}

/* =============================
   2. Top Bar & Navbar
   ============================= */
.top-bar {
  background: var(--primary-color);
  color: #fff;
  padding: 12px 0;
  font-size: 0.9rem;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  margin-left: 20px;
  transition: var(--transition);
}

.navbar-custom {
  background: transparent;
  transition: var(--transition);
  top: 48px;
  padding: 15px 0;
  width: 100%;
}

.navbar-custom.navbar-scrolled {
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  top: 0;
  padding: 10px 0;
}

.navbar-custom .nav-link {
  color: #fff !important;
  font-weight: 600;
  margin: 0 8px;
  position: relative;
}

.navbar-custom.navbar-scrolled .nav-link {
  color: var(--primary-color) !important;
}

.navbar-btn {
  padding: 10px 25px;
  font-weight: 700;
  background: var(--accent-gradient);
  color: #fff !important;
  border-radius: 50px;
  border: none;
  box-shadow: 0 4px 15px rgba(254, 86, 11, 0.3);
}

.lang-switch-bootstrap {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50px;
  padding: 6px 15px;
  color: #fff !important;
  text-decoration: none;
}

.navbar-custom.navbar-scrolled .lang-switch-bootstrap {
  border-color: var(--primary-color);
  color: var(--primary-color) !important;
}

/* =============================
   3. Hero Section
   ============================= */
.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8)), url('https://images.unsplash.com/photo-1578575437130-527eed3abbec?fit=crop&w=1920&q=80') no-repeat center center/cover;
  min-height: 85vh;
  /* تقليل الارتفاع قليلاً للموبايل */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding-top: 100px;
  /* مساحة للهيدر */
}

.hero .hero-subtitle {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 15px;
  color: #fff;
}

.hero h4 {
  font-size: 1.6rem;
  color: var(--accent-color);
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 800px;
  margin: 0 auto 40px;
}

.hero .btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  padding: 15px 40px;
  border-radius: 50px;
  font-weight: 700;
  border: none;
  box-shadow: 0 10px 30px rgba(254, 86, 11, 0.4);
}

/* =============================
   4. Services & Cards
   ============================= */
.services,
.ports {
  background: var(--light-gray);
}

.services-grid,
.ports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.service-card,
.port-card {
  background: #fff;
  border-radius: 20px;
  padding: 35px 25px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.service-card:hover,
.port-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-md);
}

.service-icon,
.port-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: rgba(254, 86, 11, 0.1);
  color: var(--accent-color);
  border-radius: 50%;
}

.port-icon {
  background: rgba(26, 26, 26, 0.1);
  color: var(--primary-color);
}

/* =============================
   5. Contact Section & Map (Fixed)
   ============================= */
.contact-section {
  background: #fff;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
}

.contact-info {
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #eee;
}

.contact-map {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border-radius: 20px;
  overflow: hidden;
  /* لضمان أن الخريطة لا تخرج عن الحواف الدائرية */
  box-shadow: var(--shadow-sm);
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* =============================
   6. Footer & Buttons
   ============================= */
footer {
  background: #111;
  color: #aaa;
  text-align: center;
  padding: 50px 0 30px;
}

.static-contact-buttons {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.static-btn {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 24px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.whatsapp-btn {
  background: #25D366;
}

.call-btn {
  background: var(--accent-gradient);
}

/* =============================
   7. Mobile Responsive Fixes (أهم جزء)
   ============================= */
@media (max-width: 991.98px) {

  /* إخفاء الشريط العلوي في الموبايل */
  .top-bar {
    display: none;
  }

  /* تثبيت النافبار في الأعلى */
  .navbar-custom {
    top: 0;
    background: #fff !important;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  .navbar-custom .nav-link,
  .navbar-custom .navbar-brand {
    color: var(--primary-color) !important;
  }

  .navbar-toggler {
    border: none;
    padding: 0;
  }

  /* أيقونة القائمة سوداء */
  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
  }

  /* تصغير الخطوط في الهيرو */
  .hero .hero-subtitle {
    font-size: 2.2rem;
  }

  .hero h4 {
    font-size: 1.3rem;
  }

  /* إصلاح الخريطة والاتصال في الموبايل */
  .contact-grid {
    grid-template-columns: 1fr;
    /* عمود واحد */
  }

  .contact-map {
    height: 350px;
    /* ارتفاع ثابت للخريطة في الموبايل */
  }

  /* توسيع الحاوية في الموبايل لتقليل الفراغات */
  .container {
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }

  /* جعل السكاشن تأخذ كامل العرض بدون هوامش جانبية */
  section {
    padding: 60px 0;
  }
}

/* =============================
   8. LTR (English) Fixes
   ============================= */
body:lang(en) {
  direction: ltr;
  text-align: left;
}

body:lang(en) .top-bar a {
  margin-left: 20px;
  margin-right: 0;
}
/* =============================
   6. About Section (تعديل الصورة والنص)
   ============================= */
.about {
  background: #fff;
  overflow: hidden;
}

.about .container {
  display: flex;
  align-items: center; /* محاذاة عمودية في المنتصف */
  justify-content: space-between;
  gap: 40px; /* مسافة بين النص والصورة */
}

/* تنسيق النص */
.about-content {
  flex: 1; /* يأخذ المساحة المتبقية */
  text-align: right; /* محاذاة النص لليمين (عربي) */
}

/* تنسيق الصورة */
.about-image {
  flex: 0 0 350px; /* عرض ثابت للصورة على الشاشات الكبيرة */
  max-width: 40%; /* لا تتجاوز 40% من العرض */
  position: relative;
}

.about-image img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1); /* ظل خفيف */
  object-fit: cover;
}

.about-content ul li {
  position: relative;
  padding-right: 35px;
  margin-bottom: 15px;
  font-size: 1.05rem;
  color: var(--secondary-color);
  list-style: none;
}

.about-content li::before {
  content: '\f058';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 0;
  top: 4px;
  color: var(--accent-color);
  font-size: 1.2rem;
}

/* =============================
   7. Contact Section & Map (إصلاح الخريطة)
   ============================= */
.contact-section {
    background: #fff;
    padding-bottom: 50px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* عمودين متساويين */
    gap: 30px;
    align-items: start;
}

.contact-info {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eee;
}

/* إصلاح الخريطة لتكون مضبوطة */
.contact-map {
    width: 100%;
    height: 400px; /* ارتفاع ثابت */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* =============================
   تعديلات الموبايل (Mobile Fixes)
   ============================= */
@media (max-width: 991.98px) {
  /* تعديل قسم من نحن في الموبايل */
  .about .container {
    flex-direction: column-reverse; /* النص أولاً ثم الصورة تحت */
    text-align: center;
    gap: 30px;
  }

  .about-content {
    text-align: center; /* توسيط النص في الموبايل */
    width: 100%;
  }
  
  .about-content ul {
      display: inline-block; /* لضبط القائمة في المنتصف */
      text-align: right; /* المحتوى الداخلي للقائمة يظل يمين */
  }

  .about-image {
    width: 100%;
    max-width: 300px; /* تحديد عرض أقصى للصورة في الموبايل (الحل لمشكلة الصورة الكبيرة) */
    flex: none;
    margin: 0 auto; /* توسيط الصورة */
  }
  
  /* تعديل الخريطة في الموبايل */
  .contact-grid {
      grid-template-columns: 1fr;
  }
  
  .contact-map {
      height: 300px; /* تقليل ارتفاع الخريطة في الموبايل */
  }
}