@import url('https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.2.3/css/flag-icons.min.css');

/* ==========================================================================
   إعدادات عامة للأقسام
   ========================================================================== */
.dimensions-about-section,
.dimensions-services-section,
.featured-projects-section,
.dimensions-tools-section,
.contact-cta-section {
  position: relative;
  padding: var(--section-space) 0;
}
/* ==========================================================================
   1. إعدادات الغلاف والسكرول (Scroll Effect) والشريط العلوي
   ========================================================================== */
.header-wrapper {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 2000;
  background: var(--nav-glass-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.header-wrapper.nav-scrolled {
  background: var(--nav-scrolled-bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(197, 155, 135, 0.3);
}

.smart-topbar {
  min-height: 40px;
  max-height: 100px; /* 💡 إضافة ضرورية: المتصفح يحتاج max-height ليحسب الحركة بنعومة */
  padding-inline: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: var(--nav-topbar-bg);
  transition: min-height 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), max-height 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), padding 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  overflow: visible;
  opacity: 1;
}

.header-wrapper.nav-scrolled .smart-topbar {
  min-height: 0;
  max-height: 0; /* 💡 استخدام max-height للطي بسلاسة مطلقة */
  padding-block: 0;
  opacity: 0;
  border: none;
  overflow: hidden;
}

.topbar-shell {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}

.topbar-divider {
  width: 1px;
  height: 14px;
  background: var(--nav-border);
}

.topbar-link {
  color: var(--nav-text-color);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.topbar-link:hover,
.topbar-soc:hover {
  color: var(--color-primary);
}

.topbar-soc {
  color: var(--nav-text-color);
  font-size: 1rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

/* ==========================================================================
   2. شريط الناف بار الأساسي واللوجو (حل مشكلة الشرينك)
   ========================================================================== */
.smart-navbar {
  min-height: 15vh;
  transition: min-height 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);

    padding: 0 !important;
}

.header-wrapper.nav-scrolled .smart-navbar,
.header-wrapper.nav-scrolled .navbar-inner {
  min-height: 65px;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  transition: min-height 0.5s cubic-bezier(0.165, 0.84, 0.44, 1); /* 💡 هذا السطر تم إضافته لإنهاء القفزة وجعل الحركة انسيابية */
}

/* 🆕 توسيط روابط الديسكتوب فعليًا بين اللوغو وأزرار الوضع/التواصل — Grid بثلاث أعمدة
   بدل flex space-between (يلي كان بيلزّق الروابط جنب الأزرار بأقصى اليمين بدل توسيطها،
   لأنه بيوزّع الفراغ بين عنصرين بس مش بيوسّط عنصر أوسط بغض النظر عن عرض الطرفين).
   محصورة بـ992px+ (نفس نقطة تحول d-lg-*) عشان ما تأثر على تخطيط الموبايل الحالي إطلاقًا. */
@media (min-width: 992px) {
  .navbar-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
  .navbar-center-col { justify-content: center; }
  .navbar-end-col { justify-self: end; }
}

.logo_brand {
  color: var(--nav-text-hover);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo_brand img {
  max-height: 80px;
  object-fit: contain;
  transition: max-height 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1); /* 💡 جعلنا الترانزيشن يشمل كل التغييرات (الحجم) وليس الـ transform فقط */
}

/* 💡 الكود المفقود: إجبار اللوجو على التصغير عند السكرول */
.header-wrapper.nav-scrolled .logo_brand img {
  max-height: 50px; 
}

.logo_brand:hover img {
  transform: scale(1.02);
}

/* ==========================================================================
   3. روابط الديسكتوب وتأثير الهوفر الفاخر (Sweep Line)
   ========================================================================== */
.desktop-nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.desktop-nav-list li a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  color: var(--nav-text-color);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  text-decoration: none;
}

.desktop-nav-list li a::after {
  content: "";
  position: absolute;
  right: 18px;
  left: 18px;
  bottom: 8px;
  height: 2px;
  background: var(--rose-gold, #C59B87);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s cubic-bezier(0.86, 0, 0.07, 1);
}

.desktop-nav-list li a:hover,
.desktop-nav-list li a.active1 {
  color: var(--nav-text-hover);
}

.desktop-nav-list li a:hover::after,
.desktop-nav-list li a.active1::after {
  transform: scaleX(1);
  transform-origin: left;
  box-shadow: 0 0 10px rgba(197, 155, 135, 0.6);
}

/* ==========================================================================
   4. الأزرار الجديدة (السلة، الحساب، المظهر)
   ========================================================================== */
.nav-icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--nav-text-color);
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.nav-icon-btn:hover {
  color: var(--rose-gold, #C59B87);
  background: var(--nav-hover-bg);
  border: 1px solid rgba(197, 155, 135, 0.3);
  transform: translateY(-2px);
}

/* 🆕 عداد السلة — Badge عائم فوق أيقونة السلة + نبضة عند الإضافة */
.nav-icon-btn.cart-icon-btn {
  position: relative;
  overflow: visible;
}

.cart-count-badge {
  position: absolute;
  top: -3px;
  inset-inline-end: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--rose-gold, #C59B87);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-navbar, #fff);
  transition: transform 0.2s ease;
}

.cart-count-badge.is-empty {
  display: none;
}

.cart-count-badge.bump {
  animation: cartBadgeBump 0.45s ease;
}

@keyframes cartBadgeBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.55); }
  60% { transform: scale(0.85); }
  100% { transform: scale(1); }
}

.nav-icon-btn.cart-icon-btn.pulse {
  animation: cartIconPulse 0.6s ease;
}

@keyframes cartIconPulse {
  0% { box-shadow: 0 0 0 0 rgba(197, 155, 135, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(197, 155, 135, 0); }
  100% { box-shadow: 0 0 0 0 rgba(197, 155, 135, 0); }
}

/* 🆕 شريحة "مسجل دخول" — أفاتار بحرف الاسم + أول اسم، بدل أيقونة يوزر عادية */
.nav-account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  border-radius: 30px;
  background: var(--nav-hover-bg);
  border: 1px solid rgba(197, 155, 135, 0.35);
  color: var(--nav-text-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

[dir="rtl"] .nav-account-chip {
  padding: 5px 5px 5px 14px;
}

.nav-account-chip:hover {
  border-color: var(--rose-gold, #C59B87);
  color: var(--nav-text-hover);
  transform: translateY(-2px);
}

.nav-account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--rose-gold, #C59B87), var(--rose-gold-hover, #b08571));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
}

.nav-account-name {
  font-weight: 700;
  font-size: 0.86rem;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-icon.nav-account-chip {
  width: auto;
  height: 50px;
  padding: 6px 16px 6px 8px;
}

[dir="rtl"] .mobile-icon.nav-account-chip {
  padding: 6px 8px 6px 16px;
}

.mobile-icon.nav-account-chip .nav-account-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

.mobile-icon.nav-account-chip .nav-account-name {
  font-size: 0.98rem;
  max-width: 140px;
}

.mobile-icon {
  width: 50px;
  height: 50px;
  font-size: 1.3rem;
  border: 1px solid var(--nav-border);
}

/* 🆕 زر "تواصل معنا" بالقائمة عنده نص (مو أيقونة مفردة زي باقي .mobile-icon) —
   بلا هالاستثناء كان النص بينحشر بصندوق 50px الثابت وبينكسر لسطرين بمنتصف الكلمة. */
.mobile-icon.btn-nav-cta {
  width: auto;
  height: 50px;
  padding: 0 20px;
  white-space: nowrap;
}

/* 🆕 إخفاء الأزرار العائمة (واتساب + التواصل السريع) لما تكون قائمة الموبايل مفتوحة —
   z-index تبعهم (9999) كان أعلى من القائمة (2500) فكانوا يتراكبوا فوق محتواها. */
body:has(.mobile-menu-overlay.open) .whatsapp-float-btn,
body:has(.mobile-menu-overlay.open) .floating-contact-wrapper {
  display: none;
}

/* ==========================================================================
   5. اللغات والأعلام
   ========================================================================== */
.lang-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.fi.lang-flag-icon {
  font-size: 26px !important;
  width: 40px !important;
  height: 28px !important;
  background-size: cover !important;
  display: inline-block !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  margin: 10px 16px !important;
  transition: transform 0.3s ease !important;
}

.lang-dropdown-wrapper .lang-btn:hover .fi.lang-flag-icon {
  transform: scale(1.08);
}

.lang-dropdown-wrapper .lang-btn,
.mobile-lang-switch .lang-btn {
  border: 0 !important;
  border-color: transparent !important;
  background: none !important;
  background-color: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: auto !important;
  width: auto !important;
  height: auto !important;
  box-shadow: none !important;
  outline: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--nav-text-hover) !important;
}

.lang-dropdown-wrapper .lang-btn:hover,
.lang-dropdown-wrapper .lang-btn:focus,
.lang-dropdown-wrapper .lang-btn:active,
.mobile-lang-switch .lang-btn:hover,
.mobile-lang-switch .lang-btn:focus,
.mobile-lang-switch .lang-btn:active {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

.lang-dropdown-wrapper .lang-btn::after,
.mobile-lang-switch .lang-btn::after {
  display: none !important;
}

.lang-custom-menu {
  background: var(--nav-dropdown-bg) !important;
  border: 1px solid var(--nav-border) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px !important;
  padding: 8px !important;
  margin-top: 12px !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.lang-custom-menu .dropdown-menu-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px !important;
  color: var(--nav-dropdown-text) !important;
  border-radius: 6px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.item-flag {
  width: 24px !important;
  height: auto;
  border-radius: 2px;
}

.lang-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.lang-custom-menu .dropdown-menu-custom:hover {
  background: var(--nav-hover-bg) !important;
  color: var(--nav-text-hover) !important;
}

.lang-custom-menu .active-lang {
  background: linear-gradient(90deg, rgba(122,67,25,0.15), transparent) !important;
  color: var(--color-primary) !important;
  border-inline-start: 3px solid var(--color-primary);
  border-radius: 0 6px 6px 0;
}

/* ==========================================================================
   6. قائمة الموبايل المتجاوبة (Mobile Menu Overlay & Hamburger)
   ========================================================================== */
.mobile-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  border-color: var(--color-primary);
  background: rgba(122, 67, 25, 0.1);
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--nav-text-hover);
  margin: 5px auto;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: var(--mobile-menu-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 2500;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.mobile-menu-overlay.open {
  transform: translateX(0);
}

.mobile-menu-content {
  padding: 40px 30px;
  height: 100%;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.mobile-menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.mobile-brand img {
  max-height: 40px;
}

.mobile-close-btn {
  border: 0;
  background: transparent;
  color: var(--nav-text-hover);
  font-size: 2rem;
  line-height: 1;
  transition: color 0.3s ease;
  cursor: pointer;
}

.mobile-close-btn:hover {
  color: var(--color-primary);
}

.mobile-lang-switch {
  margin-bottom: 30px;
}

.mobile-nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-links li {
  border-bottom: 1px solid var(--nav-border);
}

.mobile-nav-links li a {
  display: block;
  padding: 18px 0;
  color: var(--nav-text-color);
  font-size: 1.2rem;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
}

.mobile-nav-links li a:hover,
.mobile-nav-links li a.active1 {
  color: var(--nav-text-hover);
  padding-inline-start: 10px;
}

.mobile-contact-box {
 
  display: grid;
  gap: 12px;
  padding-top: 30px;
  border-top: 1px solid var(--nav-border);
  
}

.mobile-contact-box a {
  color: var(--nav-text-color);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.mobile-contact-box a:hover {
  color: var(--nav-text-color);
}

.mobile-social {
  margin-top: 25px;
  display: flex;
  gap: 20px;
}

.mobile-social a {
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.3rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.mobile-social a:hover {
  color: var(--color-primary);
  transform: translateY(-3px);
}
 .mobile-btn{
  color: var(--nav-text-color);
 }
/* ==========================================================================
   7. ريسبونسف (Media Queries Responsive)
   ========================================================================== */
@media (max-width: 991px) {
  .smart-topbar,
  .desktop-nav-list {
    display: none !important;
  }
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .smart-navbar,
  .navbar-inner {
    min-height: 75px;
  }
  .logo_brand img {
    max-height: 42px;
  }
}
