/* ============================================================
   OriginalDz — Site Layout System v1.3
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --brand-navy: #0f172a;
  --brand-navy-light: #1e293b;
  --brand-green: #16a34a;
  --brand-green-light: #22c55e;
  --brand-gold: #d4af37;
  --brand-gold-light: #fbbf24;
  --brand-red: #dc2626;

  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.18);

  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --header-h: 72px;
  --container: 1280px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
}

html.dark {
  --bg: #0a0f1c;
  --bg-alt: #131a2c;
  --card: #131a2c;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border: #1e293b;
}

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 768px) { .container { padding: 0 32px; } }

/* ═══════════ HEADER ═══════════ */
.site-header {
  position: sticky;
  top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: var(--header-h);
  padding: 0 20px; max-width: var(--container);
  margin: 0 auto; width: 100%;
}
@media (min-width: 768px) { .site-header-inner { padding: 0 32px; } }

.site-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 900; font-size: 16px; flex-shrink: 0;
}
.site-logo img {
  width: 40px; height: 40px; border-radius: 10px;
  box-shadow: 0 4px 12px -2px rgba(212, 175, 55, 0.35);
}
.site-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.site-logo-text b { font-size: 16px; color: var(--text); letter-spacing: -0.3px; }
.site-logo-text small { font-size: 9px; color: var(--brand-gold); letter-spacing: 2px; font-weight: 800; }

.site-nav {
  display: none; align-items: center; gap: 2px; flex: 1; justify-content: center;
}
@media (min-width: 1024px) { .site-nav { display: flex; } }

.site-nav a {
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted); transition: all 180ms ease;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--bg-alt); }
.site-nav a.active {
  color: var(--brand-green); font-weight: 800;
  background: rgba(22, 163, 74, 0.08);
}

.site-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; margin-left: auto;
}
html[dir="rtl"] .site-actions { margin-left: 0; margin-right: auto; }

.lang-switch {
  display: none; align-items: center; gap: 2px;
  padding: 3px; background: var(--bg-alt);
  border-radius: 10px; border: 1px solid var(--border);
}
@media (min-width: 640px) { .lang-switch { display: flex; } }
.lang-switch button {
  padding: 5px 9px; border-radius: 7px;
  font-size: 11px; font-weight: 800;
  color: var(--text-muted); transition: all 180ms ease;
}
.lang-switch button.active { background: var(--brand-navy); color: #fff; }
html.dark .lang-switch button.active { background: var(--brand-green); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 16px; transition: all 180ms ease;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--text); }

.site-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 800;
  transition: all 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap; cursor: pointer;
}
.site-btn-ghost {
  color: var(--text); background: var(--bg-alt); border: 1px solid var(--border);
}
.site-btn-ghost:hover { border-color: var(--brand-green); color: var(--brand-green); }

.site-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-light));
  box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.4);
}
.site-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.5);
}

.site-btn-green {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-green-light));
  box-shadow: 0 4px 12px -4px rgba(22, 163, 74, 0.5);
}
.site-btn-green:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(22, 163, 74, 0.6);
}

.site-btn-red {
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  box-shadow: 0 4px 12px -4px rgba(220, 38, 38, 0.5);
}
.site-btn-red:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(220, 38, 38, 0.7);
}

.mobile-menu-btn {
  display: flex; width: 38px; height: 38px;
  border-radius: 10px; background: var(--bg-alt);
  border: 1px solid var(--border); color: var(--text);
  align-items: center; justify-content: center; font-size: 18px;
}
@media (min-width: 1024px) { .mobile-menu-btn { display: none; } }

.mobile-menu {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999; background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 20px; overflow-y: auto;
}
.mobile-menu.open { display: flex; align-items: flex-start; justify-content: center; }

.mobile-menu-inner {
  background: var(--bg); border-radius: var(--radius-xl);
  padding: 24px; max-width: 420px; width: 100%;
  box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px);
  overflow-y: auto; margin-top: 20px;
}

.mobile-menu-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.mobile-menu-title { font-size: 16px; font-weight: 900; }
.mobile-menu-nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.mobile-menu-nav a {
  padding: 12px 14px; border-radius: 10px;
  font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px;
  transition: all 180ms;
}
.mobile-menu-nav a:hover,
.mobile-menu-nav a.active { background: var(--bg-alt); color: var(--brand-green); }

.mobile-menu-actions { display: flex; flex-direction: column; gap: 8px; }
.mobile-menu-actions .site-btn {
  width: 100%; justify-content: center; padding: 12px; font-size: 14px;
}

/* ═══════════ MOBILE LANG SWITCH (في القائمة) ═══════════ */
.mobile-lang-switch {
  display: flex; gap: 6px; padding: 10px 0 16px;
  margin-bottom: 12px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.mobile-lang-switch button {
  flex: 1; min-width: 90px;
  padding: 10px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 800;
  color: var(--text-muted); background: var(--bg-alt);
  border: 1.5px solid var(--border); cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  gap: 6px; transition: all 180ms ease;
}
.mobile-lang-switch button:hover {
  border-color: var(--brand-green); color: var(--brand-green);
}
.mobile-lang-switch button.active {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-light));
  color: #fff; border-color: var(--brand-navy);
}
html.dark .mobile-lang-switch button.active {
  background: linear-gradient(135deg, var(--brand-green), var(--brand-green-light));
  border-color: var(--brand-green);
}
.mobile-lang-switch button span:first-child { font-size: 14px; line-height: 1; }

/* ═══════════ PAGE HERO ═══════════ */
.page-hero {
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-light) 100%);
  color: #fff; padding: 70px 0 60px;
  position: relative; overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(22, 163, 74, 0.3) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.page-hero::after {
  content: ''; position: absolute; bottom: -150px; left: -150px;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.page-hero-inner {
  position: relative; z-index: 1; text-align: center;
  max-width: 780px; margin: 0 auto;
}
.page-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px; font-size: 12px; font-weight: 800;
  margin-bottom: 18px; letter-spacing: 0.5px;
}
.page-hero h1 {
  font-size: clamp(28px, 5vw, 44px); font-weight: 900;
  letter-spacing: -1.2px; line-height: 1.15; margin: 0 0 16px;
}
.page-hero p {
  font-size: clamp(14px, 2vw, 17px);
  color: rgba(255, 255, 255, 0.8); line-height: 1.7; margin: 0;
}

/* ═══════════ PAGE CONTENT ═══════════ */
.page-content { padding: 60px 0 80px; }
.page-content-tight { padding: 40px 0 60px; }

.section { margin-bottom: 60px; }
.section-title {
  font-size: clamp(22px, 3vw, 32px); font-weight: 900;
  letter-spacing: -0.8px; line-height: 1.2;
  margin: 0 0 12px; color: var(--text);
}
.section-sub {
  font-size: 15px; color: var(--text-muted);
  line-height: 1.7; margin: 0 0 32px; max-width: 620px;
}

/* ═══════════ CARDS ═══════════ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  transition: all 220ms ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 16px;
}
.card h3 {
  font-size: 17px; font-weight: 900; color: var(--text);
  margin: 0 0 8px; letter-spacing: -0.3px;
}
.card p {
  font-size: 14px; color: var(--text-muted);
  line-height: 1.6; margin: 0;
}

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ═══════════ FOOTER ═══════════ */
.site-footer {
  background: var(--brand-navy); color: #cbd5e1;
  padding: 60px 0 30px; margin-top: auto;
}
.site-footer-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 32px; margin-bottom: 40px;
}
@media (min-width: 640px) {
  .site-footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
@media (min-width: 1024px) {
  .site-footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; }
}

.site-footer-brand img {
  width: 48px; height: 48px; border-radius: 12px; margin-bottom: 14px;
}
.site-footer-brand h4 {
  font-size: 17px; font-weight: 900; color: #fff; margin: 0 0 10px;
}
.site-footer-brand p {
  font-size: 13px; line-height: 1.7; color: #94a3b8;
  margin: 0 0 16px; max-width: 300px;
}
.site-footer-social { display: flex; gap: 8px; margin-top: 16px; }
.site-footer-social a {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: all 200ms ease;
}
.site-footer-social a:hover {
  background: var(--brand-green); border-color: var(--brand-green);
  transform: translateY(-2px);
}

.site-footer-col h5 {
  font-size: 12px; font-weight: 900; color: #fff;
  letter-spacing: 1.5px; text-transform: uppercase; margin: 0 0 16px;
}
.site-footer-col ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.site-footer-col a {
  font-size: 13.5px; color: #94a3b8;
  font-weight: 600; transition: color 180ms ease;
}
.site-footer-col a:hover { color: var(--brand-green); }

.site-footer-bottom {
  padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center; font-size: 12.5px; color: #64748b;
}
.site-footer-bottom strong { color: #fff; }

/* ═══════════ NAV DROPDOWN ═══════════ */
.site-nav-dropdown {
  position: relative; display: inline-block;
}
.site-nav-dropdown-btn {
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted); transition: all 180ms ease;
  white-space: nowrap; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: inherit; background: transparent; border: 0;
}
.site-nav-dropdown-btn:hover,
.site-nav-dropdown.open .site-nav-dropdown-btn {
  color: var(--text); background: var(--bg-alt);
}
.site-nav-dropdown.open .site-nav-dropdown-btn { color: var(--brand-green); }
.site-nav-dropdown-arrow {
  font-size: 10px; transition: transform 200ms ease;
}
.site-nav-dropdown.open .site-nav-dropdown-arrow { transform: rotate(180deg); }

.site-nav-dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 180px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18);
  display: none; z-index: 200;
  animation: dropdownIn 200ms ease;
}
.site-nav-dropdown.open .site-nav-dropdown-menu { display: block; }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.site-nav-dropdown-menu a {
  display: block; padding: 10px 14px;
  border-radius: 8px; font-size: 13px;
  font-weight: 600; color: var(--text-muted);
  transition: all 180ms ease; white-space: nowrap;
}
.site-nav-dropdown-menu a:hover {
  background: var(--bg-alt); color: var(--brand-green);
}
html[dir="rtl"] .site-nav-dropdown-menu { right: auto; left: 0; }

/* ═══════════ MOBILE NAV GROUP ═══════════ */
.mobile-nav-group { display: flex; flex-direction: column; }
.mobile-nav-toggle {
  padding: 12px 14px; border-radius: 10px;
  font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; transition: all 180ms;
  background: transparent; border: 0;
  width: 100%; font-family: inherit; text-align: right;
}
html[dir="ltr"] .mobile-nav-toggle { text-align: left; }
.mobile-nav-toggle:hover,
.mobile-nav-group.open .mobile-nav-toggle {
  background: var(--bg-alt); color: var(--brand-green);
}
.mobile-nav-arrow {
  font-size: 12px; transition: transform 200ms ease;
}
.mobile-nav-group.open .mobile-nav-arrow { transform: rotate(180deg); }

.mobile-nav-children {
  max-height: 0; overflow: hidden;
  transition: max-height 300ms ease; padding-right: 12px;
}
html[dir="ltr"] .mobile-nav-children { padding-right: 0; padding-left: 12px; }
.mobile-nav-group.open .mobile-nav-children { max-height: 200px; }

.mobile-sub-link {
  padding: 10px 14px !important; font-size: 14px !important;
  font-weight: 600 !important; color: var(--text-muted) !important;
  border-radius: 8px !important; display: block;
  margin-top: 2px; margin-bottom: 2px;
}
.mobile-sub-link:hover {
  background: var(--bg-alt) !important; color: var(--brand-green) !important;
}

/* ═══════════ FLOATING LANG SWITCHER ═══════════ */
.floating-lang {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 9998; direction: rtl;
}
html[dir="ltr"] .floating-lang {
  right: auto; left: 20px; direction: ltr;
}

.floating-lang-btn {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-light));
  color: #fff; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px -6px rgba(15, 23, 42, 0.5);
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 22px; position: relative;
  flex-direction: column; padding: 0;
}
.floating-lang-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 36px -8px rgba(15, 23, 42, 0.6);
}
.floating-lang.open .floating-lang-btn { transform: scale(0.95); }

.floating-lang-icon { font-size: 20px; line-height: 1; }
.floating-lang-current {
  font-size: 11px; line-height: 1;
  position: absolute; bottom: 6px; right: 6px;
  background: var(--brand-green);
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--brand-navy);
}

.floating-lang-menu {
  position: absolute; bottom: 70px; right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 8px;
  min-width: 180px;
  box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.35);
  opacity: 0; visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: all 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}
html[dir="ltr"] .floating-lang-menu {
  right: auto; left: 0; transform-origin: bottom left;
}
.floating-lang.open .floating-lang-menu {
  opacity: 1; visibility: visible; transform: translateY(0) scale(1);
}
.floating-lang-menu button {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  background: transparent; border: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 700;
  color: var(--text); display: flex; align-items: center;
  gap: 10px; text-align: right;
  transition: all 180ms ease; margin-bottom: 2px;
}
html[dir="ltr"] .floating-lang-menu button { text-align: left; }
.floating-lang-menu button:last-child { margin-bottom: 0; }
.floating-lang-menu button:hover {
  background: var(--bg-alt); color: var(--brand-green);
}
.floating-lang-menu button.active {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), rgba(34, 197, 94, 0.08));
  color: var(--brand-green); font-weight: 800;
}
.floating-lang-menu button span:first-child { font-size: 18px; line-height: 1; }
.floating-lang-menu .check {
  margin-right: auto; color: var(--brand-green); font-weight: 900;
}
html[dir="ltr"] .floating-lang-menu .check { margin-right: 0; margin-left: auto; }

@media (max-width: 640px) {
  .floating-lang { bottom: 16px; right: 16px; }
  html[dir="ltr"] .floating-lang { right: auto; left: 16px; }
  .floating-lang-btn { width: 50px; height: 50px; font-size: 20px; }
  .floating-lang-menu { bottom: 64px; min-width: 160px; }
}

@media print { .floating-lang { display: none !important; } }

/* ═══════════ UTILITIES ═══════════ */
.hidden { display: none !important; }
.text-center { text-align: center; }

@media (max-width: 1023px) {
  .hide-mobile { display: none !important; }
  .site-logo img { width: 34px; height: 34px; }
  .site-logo-text b { font-size: 13px; }
  .site-logo-text small { font-size: 8px; letter-spacing: 1.5px; }
  .site-btn { padding: 8px 10px; font-size: 13px; gap: 4px; }
  .icon-btn { width: 34px; height: 34px; font-size: 14px; }
  .lang-switch { padding: 2px; }
  .lang-switch button { padding: 4px 6px; font-size: 10px; }
  .mobile-menu-btn { width: 34px; height: 34px; font-size: 16px; }
}

@media (max-width: 400px) {
  .lang-switch,
  .icon-btn#siteDarkToggle { display: none !important; }
  .site-logo-text small { display: none; }
}
