/* ==========================================================================
   Lamsa Baby - لمسا بيبي | Design System (Core)
   ========================================================================== */

:root {
  --brand: #0E4A6E;
  --brand-700: #0A3853;
  --brand-900: #062233;
  --accent: #D42858;
  --accent-600: #A81F44;
--accent-700: #960038;
  --white: #FFFFFF;

  --tint-50: #F4F8FB;
  --tint-100: #E8F0F6;
  --tint-200: #CFDDE8;
  --tint-300: #A8C0D3;
  --tint-400: #6E90A8;

  --ink: #101E29;
  --ink-70: #3D4F5E;
  --ink-50: #5A6E7E;
  --line: #E3EBF2;
  --placeholder: #7B90A8;

  --grad-brand: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  --grad-brand-soft: linear-gradient(135deg, var(--tint-100) 0%, var(--tint-50) 100%);
  --grad-text: linear-gradient(90deg, var(--brand), var(--accent));

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(14, 74, 110, 0.06);
  --shadow: 0 12px 34px rgba(14, 74, 110, 0.09);
  --shadow-lg: 0 26px 60px rgba(14, 74, 110, 0.16);
  --shadow-brand: 0 18px 40px rgba(212, 40, 88, 0.28);

  --container: 1240px;
  --header-h: 78px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.18s var(--ease);
  --t: 0.32s var(--ease);
  --cat-card-veil-hover: 0.75;

  --font-ar: "Tajawal", "Cairo", "Segoe UI", "Noto Kufi Arabic", system-ui, sans-serif;
  --font-en: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-en);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-70);
  background: var(--white);
  overflow-x: hidden;
}

html[lang="ar"] body { font-family: var(--font-ar); }
body.no-scroll { overflow: hidden; }

h1, h2, h3, h4, h5 {
  margin: 0 0 0.5em;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4 { letter-spacing: 0; }

h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 1.9vw, 1.5rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.1em; }
a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-600); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0 0 1.1em; padding-inline-start: 1.25em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -60px; inset-inline-start: 16px; z-index: 999;
  background: var(--brand); color: var(--white); padding: 10px 18px;
  border-radius: var(--radius-sm); font-weight: 700; transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; color: var(--white); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
.section--tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section--pink { background: var(--grad-brand-soft); }
.section--dark { background: var(--brand-900); color: var(--tint-100); }
.section--dark h2, .section--dark h3 { color: var(--white); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.section-head { max-width: 680px; margin: 0 auto clamp(2rem, 4vw, 3.25rem); text-align: center; }
.section-head p { color: var(--ink-50); font-size: 1.05rem; margin: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-600);
  background: var(--tint-100); border-radius: var(--radius-pill);
  padding: 7px 16px; margin-bottom: 1rem;
}
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--grad-brand);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px; border: 0; border-radius: var(--radius-pill);
  background: var(--btn-bg); color: var(--white);
  font-weight: 700; font-size: 0.98rem; line-height: 1; white-space: nowrap;
  box-shadow: var(--shadow-brand);
  transition: transform var(--t-fast), box-shadow var(--t);
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 22px 48px rgba(212, 40, 88, 0.36); color: var(--white); }
.btn:active { transform: translateY(-1px); }
.btn svg { width: 19px; height: 19px; flex: none; }

.btn--ghost { background: transparent; color: var(--brand); border: 2px solid var(--tint-200); box-shadow: none; }
.btn--ghost:hover { background: var(--tint-50); border-color: var(--tint-300); color: var(--brand); }
.btn--light { background: var(--white); color: var(--brand); box-shadow: var(--shadow); }
.btn--light:hover { color: var(--accent); }
.btn--outline-light {
  background: rgba(255, 255, 255, 0.08); color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.35); box-shadow: none;
}
.btn--outline-light:hover { background: rgba(255, 255, 255, 0.18); color: var(--white); }
.btn--sm { padding: 10px 20px; font-size: 0.88rem; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--tint-200); }
.card__icon {
  width: 58px; height: 58px; display: grid; place-items: center;
  border-radius: 18px; background: var(--grad-brand); color: var(--white);
  margin-bottom: 18px; box-shadow: var(--shadow-brand);
  transition: transform var(--t);
}
.card:hover .card__icon { transform: rotate(-8deg) scale(1.06); }
.card__icon svg { width: 28px; height: 28px; }
.card h3 { margin-bottom: 0.35em; }
.card p { margin: 0; color: var(--ink-50); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--t);
}
.header.is-stuck { box-shadow: var(--shadow); }

.topbar { background: var(--brand-900); color: var(--tint-200); font-size: 0.82rem; }
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; min-height: 38px; padding-block: 6px;
}
.topbar a { color: var(--tint-200); }
.topbar a:hover { color: var(--white); }
.topbar__list { display: flex; align-items: center; gap: 20px; list-style: none; margin: 0; padding: 0; }
.topbar__list li { display: flex; align-items: center; gap: 7px; }
.topbar svg { width: 15px; height: 15px; flex: none; }

.navbar { display: flex; align-items: center; gap: 18px; min-height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand__logo {
  width: 46px; height: 46px; display: grid; place-items: center; flex: none;
}
.brand__logo img { width: 100%; height: 100%; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 800; font-size: 1.12rem; color: var(--ink); }
.brand__tag { font-size: 0.7rem; color: var(--ink-50); letter-spacing: 0.06em; text-transform: uppercase; }
html[lang="ar"] .brand__tag { letter-spacing: 0; text-transform: none; }

.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; list-style: none; padding: 0; margin-block: 0; }
.nav a {
  display: block; padding: 10px 14px; border-radius: var(--radius-pill);
  color: var(--ink-70); font-weight: 600; font-size: 0.94rem;
  position: relative; transition: background var(--t-fast), color var(--t-fast);
}
.nav a:hover { background: var(--tint-50); color: var(--brand-700); }
.nav a.is-active { color: var(--accent-600); background: var(--tint-100); }
.nav a.is-active::after {
  content: ""; position: absolute; inset-inline: 14px; bottom: 4px;
  height: 2px; border-radius: 2px; background: var(--grad-text);
}

.nav-tools { display: flex; align-items: center; gap: 8px; flex: none; }

.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--white); color: var(--brand);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover { background: var(--brand-700); color: var(--white); border-color: var(--brand-700); transform: translateY(-2px); }
.icon-btn svg { width: 20px; height: 20px; }

.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px;
  border: 1px solid var(--tint-200); border-radius: var(--radius-pill);
  background: var(--tint-50); color: var(--brand);
  font-weight: 700; font-size: 0.88rem;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.lang-toggle:hover { background: var(--grad-brand); color: var(--white); border-color: transparent; transform: translateY(-2px); }
.lang-toggle svg { width: 17px; height: 17px; }
.burger { display: none; }

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(6, 34, 51, 0.55); backdrop-filter: blur(6px);
  display: grid; place-items: start center; padding: 12vh 20px 20px;
  opacity: 0; visibility: hidden; transition: opacity var(--t), visibility var(--t);
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-box {
  width: min(720px, 100%); background: var(--white);
  border-radius: var(--radius-lg); padding: 12px; box-shadow: var(--shadow-lg);
  transform: translateY(-24px) scale(0.98); transition: transform var(--t);
}
.search-overlay.is-open .search-box { transform: none; }
.search-box__field { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.search-box__field svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.search-box__field input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 1.1rem; font-weight: 600; color: var(--ink); min-width: 0;
}
.search-box__close {
  border: 0; background: var(--tint-100); color: var(--brand);
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
}
.search-results { max-height: 46vh; overflow-y: auto; margin-top: 8px; }
.search-results:empty { display: none; }
.search-item {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px;
  border-radius: var(--radius-sm); color: var(--ink-70);
  transition: background var(--t-fast);
}
.search-item:hover, .search-item.is-active { background: var(--tint-50); color: var(--brand); }
.search-item img {
  width: 46px; height: 46px; object-fit: cover; border-radius: 10px;
  flex: none; background: var(--tint-100);
}
.search-item__t { font-weight: 700; color: var(--ink); font-size: 0.95rem; }
.search-item__c { font-size: 0.78rem; color: var(--ink-50); }
.search-item mark { background: var(--tint-200); color: var(--brand); border-radius: 4px; padding: 0 2px; }
.search-empty { padding: 24px; text-align: center; color: var(--ink-50); font-weight: 600; }

.badge-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--white); font-size: 0.68rem; font-weight: 800;
}
