﻿/* ═══════════════════════════════════════
   MAIN.CSS — Global Layout & Typography
═══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
}

body {
  background-color: transparent;
  color: var(--text-primary);
  font-family: var(--font-arabic);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: pageFadeIn 0.6s ease both;
}

/* Body sets the UI typeface; do NOT use `html[lang] *` — it overrides Font Awesome
   (higher specificity than `.fa-solid`) and makes every icon invisible. */
html[lang="en"] body {
  font-family: var(--font-english);
}
html[lang="ar"] body {
  font-family: var(--font-arabic);
}
/* Form controls often default to system UI fonts; inherit the page font without touching icons */
html[lang="en"] button,
html[lang="en"] input,
html[lang="en"] textarea,
html[lang="en"] select {
  font-family: inherit;
}
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] select {
  font-family: inherit;
}

/* ─── Container ─── */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}
@media (max-width: 768px) {
  .container { padding: 0 var(--space-md); }
}

/* ─── Section Base ─── */
.section {
  padding: var(--space-4xl) 0;
}
.section-sm {
  padding: var(--space-3xl) 0;
}
@media (max-width: 768px) {
  .section { padding: var(--space-3xl) 0; }
}

/* ─── Section Label ─── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel-blue);
  margin-bottom: var(--space-md);
}
.section-label::before {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: var(--gradient-gold);
  border-radius: 2px;
}
html[dir="rtl"] .section-label::before {
  order: 1;
}
html[dir="rtl"] .section-label { flex-direction: row-reverse; }

/* ─── Section Title ─── */
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}
.section-title span {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Section Subtitle ─── */
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 580px;
  line-height: 1.8;
}
html[dir="rtl"] .section-subtitle {
  text-align: right;
}

/* ─── Divider ─── */
.divider {
  width: 64px;
  height: 3px;
  background: var(--gradient-gold);
  border-radius: 3px;
  margin: var(--space-lg) 0;
}
html[dir="rtl"] .divider { margin-right: 0; }

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-primary);
}
p { color: var(--text-secondary); }
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

/* ─── Steel Texture Background ─── */
.steel-bg {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(126,184,212,0.015) 2px,
      rgba(126,184,212,0.015) 3px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(126,184,212,0.015) 2px,
      rgba(126,184,212,0.015) 3px
    ),
    var(--bg-primary);
}

/* ─── Grid Backgrounds ─── */
.grid-bg {
  position: relative;
}
.grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(126,184,212,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126,184,212,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridPulse 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* ─── RTL / LTR utilities ─── */
html[dir="rtl"] .text-start { text-align: right; }
html[dir="ltr"] .text-start { text-align: left; }

/* ─── Flex Utilities ─── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gap-sm      { gap: var(--space-sm); }
.gap-md      { gap: var(--space-md); }
.gap-lg      { gap: var(--space-lg); }
.gap-xl      { gap: var(--space-xl); }

/* ─── Grid ─── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-xl); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ─── Badge ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-steel {
  background: var(--steel-blue-glow);
  color: var(--steel-blue);
  border-color: rgba(126,184,212,0.25);
}
.badge-gold {
  background: var(--gold-glow);
  color: var(--gold);
  border-color: rgba(200, 210, 220, 0.25);
}

/* ─── Tag ─── */
.tag {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(126,184,212,0.1);
  color: var(--steel-blue);
  border: 1px solid rgba(126,184,212,0.2);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
  background: var(--iron);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--steel-blue-dim); }

/* ─── Selection ─── */
::selection {
  background: rgba(126,184,212,0.25);
  color: var(--text-primary);
}

/* ─── Focus Ring ─── */
:focus-visible {
  outline: 2px solid var(--steel-blue);
  outline-offset: 3px;
}

/* ─── Responsive Helpers ─── */
.hide-mobile  { display: block; }
.show-mobile  { display: none; }
@media (max-width: 768px) {
  .hide-mobile { display: none; }
  .show-mobile { display: block; }
}

/* ─── Overflow Section ─── */
.overflow-hidden { overflow: hidden; }

/* ─── Aspect Ratio ─── */
.aspect-square    { aspect-ratio: 1 / 1; }
.aspect-video     { aspect-ratio: 16 / 9; }
.aspect-product   { aspect-ratio: 4 / 3; }

img {
  display: block;
  max-width: 100%;
}

/* ─── Object Fit ─── */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ─── Sticky Bar Background ─── */
.bg-surface  { background: var(--bg-surface); }
.bg-elevated { background: var(--bg-elevated); }

/* ─── Text Utilities ─── */
.text-gold   { color: var(--gold); }
.text-steel  { color: var(--steel-blue); }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 0.875rem; }
.text-lg     { font-size: 1.125rem; }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 900; }

