/* ==============================================================
   شركة العالِم الهندسية — Stylesheet الموقع الرئيسي
   لوحة الألوان مستخرجة من شعار الشركة:
   Primary (Navy)  #0F355A   |  Accent (Orange) #FF8A07
   Gray (Buildings) #6B6D70
   ============================================================== */

:root {
  --color-primary: #0F355A;
  --color-primary-dark: #0A2540;
  --color-primary-light: #1D5285;
  --color-accent: #FF8A07;
  --color-accent-dark: #E67600;
  --color-gray-dark: #4B4F54;
  --color-gray: #6B6D70;
  --color-gray-light: #F4F6F8;
  --color-border: #E5E8EC;
  --color-text: #1F2937;
  --color-text-muted: #667085;
  --color-white: #FFFFFF;
  --color-success: #16A34A;
  --color-danger: #DC2626;

  --font-main: 'Cairo', 'Tahoma', sans-serif;
  --shadow-sm: 0 2px 8px rgba(15, 53, 90, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 53, 90, 0.12);
  --shadow-lg: 0 16px 40px rgba(15, 53, 90, 0.16);
  --radius: 14px;
  --transition: all 0.3s ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-y: scroll; }

/* يمنع "قفزة" الصفحة يمينًا/يسارًا وظهور فراغ عند فتح أي Modal (خصوصًا في صفحات RTL) */
body.modal-open {
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-inline-start: 0 !important;
  padding-inline-end: 0 !important;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-white);
  direction: rtl;
  text-align: right;
  line-height: 1.75;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { text-decoration: none; color: inherit; transition: var(--transition); }

::selection { background: var(--color-accent); color: #fff; }

.section-padding { padding: 80px 0; }
@media (max-width: 768px) { .section-padding { padding: 50px 0; } }

.section-title-wrap { text-align: center; margin-bottom: 48px; }
.section-eyebrow {
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 0.95rem;
  display: inline-block;
  margin-bottom: 8px;
}
.section-title {
  font-weight: 800;
  color: var(--color-primary);
  font-size: 2.1rem;
  margin-bottom: 10px;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 70px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 4px;
  margin: 14px auto 0;
}
.section-subtitle { color: var(--color-text-muted); max-width: 640px; margin: 0 auto; }

.bg-light-section { background: var(--color-gray-light); }

.btn-brand {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  font-weight: 700;
  padding: 11px 30px;
  border-radius: 50px;
  transition: var(--transition);
  box-shadow: 0 6px 18px rgba(255, 138, 7, 0.35);
}
.btn-brand:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(255, 138, 7, 0.45); }

.btn-brand-outline {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
  font-weight: 700;
  padding: 10px 28px;
  border-radius: 50px;
  transition: var(--transition);
}
.btn-brand-outline:hover { background: #fff; color: var(--color-primary); transform: translateY(-2px); }

.btn-primary-brand {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 700;
  padding: 10px 26px;
  border-radius: 50px;
}
.btn-primary-brand:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: #fff; }

/* ---------------- Header / Navbar ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 14px rgba(15, 53, 90, 0.08);
  transition: var(--transition);
}
.site-header .navbar-brand { display: flex; align-items: center; gap: 10px; }
.site-header .navbar-brand img { height: 46px; width: auto; }
.brand-text-ar { font-weight: 800; color: var(--color-primary); font-size: 1.05rem; line-height: 1.1; }
.brand-text-en { font-weight: 700; color: var(--color-accent); font-size: 0.65rem; letter-spacing: 1px; }

.site-header .nav-link {
  color: var(--color-primary) !important;
  font-weight: 600;
  padding: 8px 16px !important;
  position: relative;
}
.site-header .nav-link::after {
  content: '';
  position: absolute;
  right: 16px;
  bottom: 2px;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: var(--transition);
}
.site-header .nav-link:hover::after,
.site-header .nav-link.active::after { width: calc(100% - 32px); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  background: linear-gradient(120deg, var(--color-primary-dark) 0%, var(--color-primary) 55%, #164674 100%);
  color: #fff;
  padding: 130px 0 100px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, transparent 48%, rgba(255,138,7,0.10) 48.5%, rgba(255,138,7,0.10) 51%, transparent 51.5%),
    linear-gradient(45deg, transparent 60%, rgba(255,255,255,0.04) 60.5%, rgba(255,255,255,0.04) 63%, transparent 63.5%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 138, 7, 0.15);
  border: 1px solid rgba(255, 138, 7, 0.4);
  color: #FFB35C;
  padding: 6px 16px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 22px;
}
.hero h1 { font-weight: 800; font-size: 2.9rem; line-height: 1.3; margin-bottom: 22px; }
.hero h1 span { color: var(--color-accent); }
.hero p.lead { color: rgba(255,255,255,0.85); font-size: 1.15rem; max-width: 560px; margin-bottom: 34px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-visual img { max-height: 380px; border-radius: 18px; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.35)); animation: floatY 5s ease-in-out infinite; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

.hero-stats { display: flex; gap: 34px; margin-top: 44px; flex-wrap: wrap; }
.hero-stat-num { font-size: 1.9rem; font-weight: 800; color: var(--color-accent); }
.hero-stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.75); }

@media (max-width: 991px) {
  .hero { padding: 100px 0 70px; text-align: center; }
  .hero p.lead { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { margin-top: 40px; }
}

/* ---------------- مميزاتنا ---------------- */
.bg-navy-section {
  background: linear-gradient(120deg, var(--color-primary-dark) 0%, var(--color-primary) 55%, #164674 100%);
  position: relative;
  overflow: hidden;
}
.bg-navy-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(135deg, transparent 48%, rgba(255,138,7,0.07) 48.5%, rgba(255,138,7,0.07) 51%, transparent 51.5%);
  pointer-events: none;
}
.bg-navy-section .section-title { color: #fff; }
.bg-navy-section .section-subtitle { color: rgba(255,255,255,0.75); }
.feature-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  height: 100%;
  transition: var(--transition);
  position: relative;
}
.feature-box:hover { transform: translateY(-6px); background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28); }
.feature-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 138, 7, 0.16);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
  transition: var(--transition);
}
.feature-box:hover .feature-icon { background: var(--color-accent); color: #fff; }
.feature-box h3 { font-size: 1.05rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.feature-box p { color: rgba(255, 255, 255, 0.72); font-size: 0.88rem; margin-bottom: 0; }

/* ---------------- Ad Banner ---------------- */
.ad-banner-wrap { padding: 30px 0; }
.ad-banner {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: block;
  position: relative;
}
.ad-banner img { width: 100%; height: auto; object-fit: cover; transition: var(--transition); }
.ad-banner:hover img { transform: scale(1.015); }
.ad-banner-label {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15,53,90,0.85);
  color: #fff;
  font-size: 0.72rem;
  padding: 3px 12px;
  border-radius: 50px;
  font-weight: 700;
}

/* ---------------- About ---------------- */
.about-visual { position: relative; }
.about-visual-frame {
  background: var(--color-primary);
  border-radius: var(--radius);
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.about-visual-frame img { border-radius: 10px; }
.about-features { list-style: none; padding: 0; margin: 24px 0 0; }
.about-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--color-text);
}
.about-features li i {
  background: rgba(255,138,7,0.12);
  color: var(--color-accent);
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.about-stats { display: flex; gap: 30px; margin-top: 30px; flex-wrap: wrap; }
.about-stat-box {
  background: var(--color-gray-light);
  border-radius: var(--radius);
  padding: 20px 26px;
  text-align: center;
  flex: 1;
  min-width: 130px;
  transition: var(--transition);
}
.about-stat-box:hover { background: var(--color-primary); color: #fff; transform: translateY(-4px); }
.about-stat-box .num { font-size: 1.8rem; font-weight: 800; color: var(--color-primary); }
.about-stat-box:hover .num { color: var(--color-accent); }
.about-stat-box .label { font-size: 0.85rem; color: var(--color-text-muted); }
.about-stat-box:hover .label { color: rgba(255,255,255,0.85); }

/* ---------------- Cards عامة (Featured / Departments / Products) ---------------- */
.brand-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  height: 100%;
  border: 1px solid var(--color-border);
  cursor: pointer;
}
.brand-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.brand-card-img { height: 210px; overflow: hidden; position: relative; background: var(--color-gray-light); }
.brand-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.brand-card:hover .brand-card-img img { transform: scale(1.08); }
.brand-card-body { padding: 22px; }
.brand-card-body h3 { font-size: 1.15rem; font-weight: 800; color: var(--color-primary); margin-bottom: 8px; }
.brand-card-body p { color: var(--color-text-muted); font-size: 0.92rem; margin-bottom: 0; }
.brand-card-link { color: var(--color-accent); font-weight: 700; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; }

/* الخدمات المميزة */
.featured-icon-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--color-accent);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(255,138,7,0.4);
}

/* الأقسام */
.dept-card-img { height: 170px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)); }
.dept-card-img i { font-size: 3rem; color: #fff; opacity: 0.9; }
.dept-card-img img { height: 100%; width: 100%; object-fit: cover; }
.dept-services-count {
  display: inline-block;
  background: var(--color-gray-light);
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 50px;
  margin-top: 10px;
}

/* ---------------- المنتجات ---------------- */
.product-card { position: relative; }
.discount-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--color-danger);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 5px 14px;
  border-radius: 50px;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(220,38,38,0.4);
  animation: pulseBadge 1.8s infinite;
}
@keyframes pulseBadge { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }

.product-price-row { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.price-original { color: var(--color-text-muted); text-decoration: line-through; font-size: 0.95rem; }
.price-current { color: var(--color-primary); font-weight: 800; font-size: 1.3rem; }
.price-current.discounted { color: var(--color-danger); }

.countdown-box {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.countdown-box .cd-unit {
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
  min-width: 44px;
  font-size: 0.9rem;
  font-weight: 700;
}
.countdown-box .cd-unit small { display: block; font-size: 0.6rem; font-weight: 400; opacity: 0.8; }

/* ---------------- Contact ---------------- */
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: var(--transition);
}
.contact-item:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.contact-item .icon-box {
  background: var(--color-primary);
  color: #fff;
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.contact-item h4 { font-weight: 800; color: var(--color-primary); font-size: 1rem; margin-bottom: 6px; }
.contact-item p, .contact-item a { color: var(--color-text-muted); font-size: 0.92rem; margin-bottom: 0; }
.contact-item a:hover { color: var(--color-accent); }

.contact-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.whatsapp-btn { background: #25D366; color: #fff; }
.whatsapp-btn:hover { background: #1DA851; color: #fff; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--color-primary-dark); color: rgba(255,255,255,0.8); padding-top: 60px; }
.site-footer h5 { color: #fff; font-weight: 800; margin-bottom: 20px; }
.site-footer .footer-logo { height: 50px; margin-bottom: 14px; }
.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: var(--color-accent); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 40px; padding: 18px 0; text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.55); }
.social-icons { display: flex; gap: 10px; margin-top: 16px; }
.social-icons a {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
}
.social-icons a:hover { background: var(--color-accent); color: #fff; }

/* ---------------- Modal تخصيص ---------------- */
.modal-content { border-radius: var(--radius); border: none; overflow: hidden; }
.modal-header { background: var(--color-primary); color: #fff; border: none; }
.modal-header .btn-close { filter: invert(1); }
.service-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.service-mini-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.service-mini-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.service-mini-img { height: 140px; background: var(--color-gray-light); overflow: hidden; position: relative; }
.service-mini-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.service-mini-card:hover .service-mini-img img { transform: scale(1.08); }
.service-mini-icon {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff; font-size: 2.1rem;
}
.service-mini-body { padding: 16px; text-align: center; display: flex; flex-direction: column; flex: 1; }
.service-mini-body h6 { font-weight: 800; color: var(--color-primary); font-size: 0.96rem; margin-bottom: 6px; }
.service-mini-body p { color: var(--color-text-muted); font-size: 0.8rem; margin-bottom: 14px; }
.service-mini-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(37, 211, 102, 0.12);
  color: #1DA851;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 8px 10px;
  border-radius: 50px;
  margin-top: auto;
  transition: var(--transition);
}
.service-mini-card:hover .service-mini-wa { background: #25D366; color: #fff; }

/* ---------------- Toasts ---------------- */
.toast-container { z-index: 1080; }

/* ---------------- Scroll reveal ---------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------------- Back to top ---------------- */
.back-to-top {
  position: fixed;
  bottom: 26px;
  left: 26px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 1040;
  font-size: 1.2rem;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--color-accent); color: #fff; }

/* ---------------- Floating WhatsApp ---------------- */
.floating-whatsapp {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 8px 24px rgba(37,211,102,0.5);
  z-index: 1040;
  animation: pulseWA 2.4s infinite;
}
.floating-whatsapp:hover { color: #fff; transform: scale(1.06); }
@keyframes pulseWA { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5);} 70% { box-shadow: 0 0 0 14px rgba(37,211,102,0);} 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0);} }

/* ---------------- Page loader (منتجات/تفاصيل) ---------------- */
.spinner-brand { width: 2.4rem; height: 2.4rem; color: var(--color-primary); }

/* ---------------- صفحة تفاصيل المنتج ---------------- */
.product-detail-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.breadcrumb-brand { padding: 18px 0; }
.breadcrumb-brand a { color: var(--color-text-muted); }
.breadcrumb-brand a:hover { color: var(--color-accent); }

/* Responsive text safety: never let text color get close to bg color */
.hero, .site-footer, .bg-navy-section { color: #fff; }
.hero p, .hero a, .site-footer p, .site-footer a { color: inherit; }
