/*
  نظام تصميم Alsafa Technology — عصريّ، احترافي، ثلاثي اللغة (en/ar/he).

  درسٌ تعليمي مهم هنا: بدل margin-left/margin-right التقليدية، تُستعمل
  "الخصائص المنطقية" (logical properties) — margin-inline-start بدل
  margin-left مثلاً. الفرق: margin-left يبقى "يساراً" دائماً بصريّاً، بينما
  margin-inline-start يعني "بداية السطر" وتنعكس تلقائياً مع اتجاه اللغة —
  فتصميمٌ واحد يعمل صحيحاً في LTR (إنجليزي) وRTL (عربي/عبري) دون أي كودٍ
  مكرّر أو كلاسات rtl./ltr. خاصة. هذا هو سبب عدم وجود أي media query أو
  كلاس مخصّص للعربية/العبرية في هذا الملف كلّه.
*/

:root {
  --brand-50:  #ecfdf5;
  --brand-100: #d1fae5;
  --brand-300: #6ee7b7;
  --brand-600: #047857;
  --brand-700: #065f46;
  --ink-900: #0f172a;
  --ink-600: #475569;
  --ink-400: #94a3b8;
  --surface-0: #ffffff;
  --surface-1: #f8faf9;
  --surface-2: #eef2f0;
  --border: #e2e8e5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --font: -apple-system, "Segoe UI", "Noto Sans Arabic", "Noto Sans Hebrew", Tahoma, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-900);
  background: var(--surface-0);
  line-height: 1.65;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; }
p { margin: 0 0 1em; color: var(--ink-600); }

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- Header ---------- */
.site-header {
  /* كان لاصقاً (sticky)؛ مع شعارٍ بارتفاع 160px يلتهم الشاشة أثناء القراءة — صار ثابتاً أعلى الصفحة */
  position: relative;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-block-end: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 8px;
}
.brand {
  display: flex;
  align-items: center;
  margin-inline-end: auto;
}
.brand-logo { height: 112px; width: auto; display: block; }
.brand-group { align-self: flex-end; margin-block-end: 30px; margin-inline-start: 4px; font-size: 0.85rem; font-weight: 700; color: var(--brand-700); white-space: nowrap; }
@media (max-width: 860px) { .brand-group { display: none; } }
.eyebrow { font-size: 0.9rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-700); margin-block-end: 10px; }
.footer-group { font-size: 0.85rem; font-weight: 700; color: var(--brand-700); }
@media (max-width: 860px) { .brand-logo { height: 84px; } }
.main-nav { display: flex; gap: 26px; }
.main-nav a {
  color: var(--ink-600);
  font-weight: 600;
  font-size: 0.95rem;
  padding-block: 6px;
  border-block-end: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active { color: var(--brand-700); border-block-end-color: var(--brand-600); }

.lang-switch { display: flex; gap: 4px; margin-inline-start: 8px; }
.lang-switch a {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  color: var(--ink-600);
  border: 1px solid var(--border);
}
.lang-switch a.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--ink-900); border-radius: 2px; }

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 8px 20px 18px;
  border-block-start: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 10px 0; font-weight: 600; color: var(--ink-900); border-block-end: 1px solid var(--surface-2); }
.mobile-lang { display: flex; gap: 10px; padding-block-start: 10px; }
.mobile-lang a { border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 0.85rem; font-weight: 700; }
.mobile-lang a.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

@media (max-width: 860px) {
  .main-nav, .lang-switch { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--brand-50) 0%, var(--surface-0) 70%);
  padding-block: 72px;
}
.hero-inner { max-width: 760px; }
.hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); color: var(--ink-900); }
.hero-sub { font-size: 1.1rem; max-width: 640px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-block-start: 24px; }

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
}
.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-ghost { border-color: var(--brand-600); color: var(--brand-700); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-outline { border-color: var(--border); color: var(--ink-900); }
.btn-outline:hover { border-color: var(--brand-600); color: var(--brand-700); }

/* ---------- Sections ---------- */
/* الرأس لاصق (sticky) — بدون هذا يختفي عنوان القسم خلفه عند القفز إلى #cat-panel */
section[id] { scroll-margin-top: 24px; }
.part-of { font-weight: 600; }
.part-of a { color: var(--brand-700); text-decoration: underline; }
.section { padding-block: 56px; }
.section-alt { background: var(--surface-1); }
.section-title { font-size: 1.6rem; margin-block-end: 28px; }
.section-title-sm { font-size: 1.1rem; color: var(--ink-600); text-transform: uppercase; letter-spacing: 0.04em; margin-block-end: 14px; }
.page-header { padding-block: 48px 20px; }
.page-header h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.page-intro { max-width: 720px; font-size: 1.05rem; }
.narrow { max-width: 760px; }

/* ---------- Feature cards / steps / FAQ (home) ---------- */
.section-intro { max-width: 760px; font-size: 1.05rem; margin-block-end: 28px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature-card {
  position: relative;
  padding: 24px 22px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-0);
  box-shadow: var(--shadow-sm);
}
.feature-card h3 { font-size: 1.05rem; margin-block-end: 8px; }
.feature-card p { margin: 0; font-size: 0.93rem; }
.feature-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-50); color: var(--brand-700);
  font-weight: 800; font-size: 0.9rem; margin-block-end: 12px;
}
.feature-card-plain { border-inline-start: 4px solid var(--brand-600); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; max-width: 800px; }
.step { display: flex; gap: 18px; align-items: flex-start; }
.step-num {
  flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-600); color: #fff; font-weight: 800;
}
.step h3 { font-size: 1.05rem; margin-block-end: 4px; }
.step p { margin: 0; font-size: 0.95rem; }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-0); padding: 0 18px; }
.faq-item summary { cursor: pointer; font-weight: 700; padding-block: 14px; list-style: none; position: relative; padding-inline-end: 28px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; inset-inline-end: 0; top: 12px; font-size: 1.3rem; color: var(--brand-600); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { padding-block-end: 16px; margin: 0; }

/* ---------- Category cards (home) ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.cat-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-0);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-card img { height: 190px; width: 100%; object-fit: cover; background: var(--surface-2); }
.cat-card-body { padding: 18px 20px 22px; }
.cat-card-body h3 { color: var(--ink-900); margin-block-end: 6px; }
.cat-card-body p { margin: 0; font-size: 0.92rem; }

/* ---------- Why / brand marks ---------- */
.why-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.why-body { font-size: 1.02rem; }
.brand-marks { display: flex; flex-direction: column; gap: 10px; }
.brand-marks span {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink-400);
  padding-inline-start: 14px;
  border-inline-start: 3px solid var(--brand-300);
}
.brand-marks-about { flex-direction: row; gap: 26px; margin-block-start: 20px; }
@media (max-width: 760px) { .why-grid { grid-template-columns: 1fr; } }

/* ---------- Teasers ---------- */
.teaser-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.teaser-card {
  padding: 32px;
  border-radius: var(--radius);
  background: var(--surface-1);
  border: 1px solid var(--border);
}
.teaser-card-accent { background: var(--brand-700); color: #fff; }
.teaser-card-accent h3, .teaser-card-accent p { color: #fff; }
.teaser-card-accent .btn-primary { background: #fff; color: var(--brand-700); }
.teaser-card-accent .btn-primary:hover { background: var(--brand-50); }
@media (max-width: 760px) { .teaser-grid { grid-template-columns: 1fr; } }

/* ---------- Products grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.product-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-0);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card img { height: 170px; object-fit: contain; background: var(--surface-2); padding: 14px; }
.product-card-body { padding: 16px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.product-brand { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-600); }
.product-card-body h3 { font-size: 1.05rem; margin-block: 6px; color: var(--ink-900); }
.product-card-body p { font-size: 0.9rem; flex: 1; }
.link-arrow { font-weight: 700; color: var(--brand-700); font-size: 0.9rem; }

/* ---------- Product detail ---------- */
.back-link { display: inline-block; margin-block-end: 14px; font-weight: 600; color: var(--brand-700); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.detail-media img { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); padding: 20px; }
.highlight-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.highlight-list li {
  position: relative;
  padding-inline-start: 26px;
  font-size: 0.98rem;
  color: var(--ink-900);
}
.highlight-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.5em;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand-300);
}
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }

.overview-p { font-size: 1.02rem; max-width: 800px; }

.table-scroll { overflow-x: auto; }
.spec-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.spec-table th, .spec-table td {
  padding: 12px 14px;
  text-align: start;
  border-block-end: 1px solid var(--border);
  font-size: 0.92rem;
  white-space: nowrap;
}
.spec-table th { color: var(--ink-600); font-weight: 700; background: var(--surface-1); }
.spec-table .model-cell { font-weight: 700; color: var(--brand-700); }

.spec-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.spec-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; border-block-end: 1px solid var(--border); background: var(--surface-0); }
.spec-row dt { color: var(--ink-600); font-weight: 600; }
.spec-row dd { margin: 0; font-weight: 700; color: var(--ink-900); }

.accessory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.accessory-card { display: block; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-0); transition: box-shadow 0.2s; }
a.accessory-card:hover { box-shadow: var(--shadow-md); }
.accessory-noimg { height: 130px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--ink-400); font-weight: 800; letter-spacing: 0.08em; }
.accessory-card img { height: 130px; object-fit: contain; background: var(--surface-2); padding: 10px; }
.accessory-body { padding: 12px 14px 16px; }
.accessory-body h4 { margin: 0 0 4px; font-size: 0.95rem; }
.accessory-body p { margin: 0; font-size: 0.85rem; }
.accessory-meta { color: var(--ink-400); font-size: 0.78rem; }

.sources-note { font-size: 0.82rem; color: var(--ink-400); border-block-start: 1px solid var(--border); padding-block-start: 18px; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 240px;
  grid-auto-flow: dense;
  gap: 16px;
}
.gallery-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.gallery-card.portrait { grid-row: span 2; }
/* > img = الصورة المباشرة داخل البطاقة فقط — لا شعار التراكب داخل الـspan
   (كان img:first-child يطابق الشعار أيضاً فيتمدّد ليغطّي البطاقة كلها) */
.gallery-card > img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.gallery-card:hover > img { transform: scale(1.04); }
/* الشعار + العبارة فوق الصورة: شريطٌ سفلي شبه شفّاف. الشعار على بيضاء
   (PNG بلا شفافية) فيُوضع في بطاقةٍ بيضاء صغيرة مستديرة ليبدو مقصوداً. */
.gallery-overlay {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0));
  color: #fff;
}
.gallery-logo {
  height: 34px; width: auto;
  background: #fff;
  border-radius: 6px;
  padding: 3px 5px;
  flex-shrink: 0;
}
.gallery-caption { font-weight: 700; font-size: 0.9rem; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

/* [hidden] يجب أن يغلب display:flex — وإلا يبقى الغطاء ظاهراً دائماً لأن
   قاعدة الكلاس أعلى تخصيصاً من display:none الافتراضي لسمة hidden */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
}
.lightbox img#lightboxImg { max-width: 100%; max-height: 82vh; border-radius: 10px; }
.lightbox-caption { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; margin-block-start: 14px; }
.lightbox-caption .gallery-logo { height: 44px; }
.lightbox-close {
  position: absolute; inset-block-start: 16px; inset-inline-end: 20px;
  background: none; border: none; color: #fff; font-size: 2.4rem; cursor: pointer; line-height: 1;
}

/* ---------- Contact ---------- */
.contact-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  background: var(--surface-1);
}
.contact-label { display: block; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-400); margin-block-end: 8px; }
.contact-email { font-size: 1.6rem; font-weight: 800; color: var(--brand-700); }
.contact-note { margin-block-start: 14px; }

/* ---------- Footer ---------- */
.site-footer { border-block-start: 1px solid var(--border); padding-block: 32px; background: var(--surface-1); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.footer-logo { height: 130px; width: auto; display: block; margin-block-end: 8px; }
.footer-tagline { font-size: 0.85rem; color: var(--ink-400); }
.footer-nav { display: flex; gap: 18px; }
.footer-nav a { font-size: 0.88rem; color: var(--ink-600); font-weight: 600; }
.footer-rights { font-size: 0.8rem; color: var(--ink-400); }
