/* =====================================================
   كتالوج تيتانيوم العلمي — التصميم
   ===================================================== */
/* ===== Titanium Scientific Bureau — design tokens ===== */
:root {
  --navy: #102d73;
  --navy-700: #183b8c;
  --navy-900: #0a1d4d;
  --navy-950: #071538;
  --cross: #d61c5c;
  --magenta: #b8185a;
  --magenta-soft: #fbe8ef;
  --ink: #0e1a3a;
  --text: #2a3553;
  --muted: #64708c;
  --line: #e4e8f1;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --cream: #faf8f4;
  --whatsapp: #1fa855;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 45, 115, 0.06), 0 2px 8px rgba(16, 45, 115, 0.05);
  --shadow: 0 10px 30px -12px rgba(16, 45, 115, 0.25);
  --shadow-lg: 0 30px 80px -20px rgba(7, 21, 56, 0.45);

  --font: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif;
  --font-latin: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-brand: 'Montserrat', 'IBM Plex Sans', sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 80px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--cross); outline-offset: 2px; border-radius: 6px; }
[dir='ltr'] { font-family: var(--font-latin); }

.container { width: min(1240px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-block;
  font-family: var(--font-latin);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--magenta);
  text-transform: uppercase;
}
.eyebrow.light { color: #f5a9c4; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 11px;
  font-weight: 600; font-size: 0.95rem; white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-sm { height: 36px; padding: 0 13px; font-size: 0.85rem; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 1rem; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 6px 16px -8px rgba(16, 45, 115, 0.7); }
.btn-primary:hover { background: var(--navy-700); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-outline { border: 1.5px solid var(--line); background: #fff; color: var(--navy); }
.btn-outline:hover { border-color: var(--navy); }
.btn-light { background: #fff; color: var(--navy); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4); }
.btn-light:hover { background: #f1f4fb; }
.btn-light svg { transition: transform 0.2s var(--ease); }
.btn-light:hover svg { transform: translateX(-4px); }
.btn-ghost-light { color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.3); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.08); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; box-shadow: 0 10px 24px -10px rgba(31, 168, 85, 0.8); }
.btn-whatsapp:hover { background: #1a944a; }
.btn-icon { width: 52px; padding: 0; border: 1.5px solid var(--line); background: #fff; color: var(--muted); }
.btn-icon.is-fav { color: var(--cross); border-color: #f6c2d4; background: var(--magenta-soft); }
.link-btn { color: var(--navy); font-weight: 600; font-size: 0.85rem; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: #c0394d; }

.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; color: var(--navy);
  border: 1.5px solid var(--line); background: #fff; transition: border-color 0.2s, background 0.2s;
}
.icon-btn:hover { border-color: var(--navy); }
.icon-btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.icon-btn-primary:hover { background: var(--navy-700); }
.badge {
  position: absolute; top: -7px; left: -7px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--cross); color: #fff;
  font: 700 0.7rem/20px var(--font-latin); text-align: center; border: 2px solid #fff;
}
.badge-soft { background: var(--magenta-soft); color: var(--magenta); border-color: #fff; }

/* ===== Logo ===== */
.logo { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.logo-icon { width: 64px; height: 64px; overflow: visible; }
.logo .logo-icon { margin-bottom: 10px; }
.logo-word {
  font-family: var(--font-brand); font-weight: 900; color: var(--navy);
  font-size: 3rem; line-height: 1; letter-spacing: 0.02em; display: flex;
}
.logo-letter { display: inline-block; }
.logo-sub {
  font-family: var(--font-brand); font-weight: 500; color: var(--magenta);
  font-size: 0.98rem; letter-spacing: 0.3em; margin-inline-start: 0.3em; margin-top: 6px;
}
.logo-inline { display: inline-flex; align-items: center; gap: 10px; }
.logo-inline .logo-icon { width: 38px; height: 38px; }
.logo-inline-text { display: flex; flex-direction: column; line-height: 1; }
.logo-inline-text strong { font-family: var(--font-brand); font-weight: 900; color: var(--navy); font-size: 1.28rem; letter-spacing: 0.03em; }
.logo-inline-text small { font-family: var(--font-brand); font-weight: 500; color: var(--magenta); font-size: 0.52rem; letter-spacing: 0.24em; margin-top: 4px; }

/* ===== Splash ===== */
.splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: radial-gradient(1200px 700px at 50% 45%, #ffffff 0%, #f1f4fb 55%, #e6ebf6 100%);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  overflow: hidden;
}
.splash.is-leaving { opacity: 0; transform: scale(1.04); pointer-events: none; }
.splash-glow {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 28, 92, 0.16), transparent 65%);
  opacity: 0; animation: glow 2.4s 0.9s var(--ease) forwards;
}
.splash-logo .logo-icon { width: 112px; height: 112px; margin-bottom: 22px; }
.splash-logo .logo-word { font-size: clamp(2.6rem, 11vw, 5rem); }
.splash-logo .logo-sub { font-size: clamp(0.7rem, 2.8vw, 1.3rem); }
.splash-skip {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: var(--muted); font-size: 0.85rem; padding: 8px 16px; border-radius: 20px;
  opacity: 0; animation: fadeIn 0.5s 1.2s forwards;
}
.splash-skip:hover { color: var(--navy); background: rgba(16, 45, 115, 0.06); }

.is-animated .corner { transform-box: fill-box; transform-origin: center; opacity: 0; animation: cornerIn 0.85s var(--ease) forwards; }
.is-animated .c-tl { --cx: -60px; --cy: -60px; --cr: -90deg; animation-delay: 0.1s; }
.is-animated .c-tr { --cx: 60px; --cy: -60px; --cr: 90deg; animation-delay: 0.2s; }
.is-animated .c-br { --cx: 60px; --cy: 60px; --cr: -90deg; animation-delay: 0.3s; }
.is-animated .c-bl { --cx: -60px; --cy: 60px; --cr: 90deg; animation-delay: 0.4s; }
.is-animated .cross { transform-box: fill-box; transform-origin: center; opacity: 0; animation: crossIn 0.7s 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, pulse 1.4s 1.8s ease-in-out; }
.is-animated .logo-letter {
  opacity: 0; filter: blur(8px);
  transform: translate(var(--sx), var(--sy)) rotate(var(--sr)) scale(0.4);
  animation: letterIn 0.9s var(--ease) forwards;
  animation-delay: calc(1.15s + var(--i) * 0.08s);
}
.is-animated .logo-sub {
  opacity: 0; letter-spacing: 0.9em; clip-path: inset(0 50% 0 50%);
  animation: subIn 0.9s 2.2s var(--ease) forwards;
}
@keyframes cornerIn {
  0% { opacity: 0; transform: translate(var(--cx), var(--cy)) rotate(var(--cr)) scale(0.6); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes crossIn { from { opacity: 0; transform: scale(0) rotate(-90deg); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.18); } }
@keyframes letterIn { to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes subIn { to { opacity: 1; letter-spacing: 0.3em; clip-path: inset(0 0 0 0); } }
@keyframes glow { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ===== Register ===== */
.register { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.05fr; background: #fff; }
.register-aside {
  position: relative; overflow: hidden; color: #dfe6f7;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 60%, var(--navy-950) 100%);
  display: flex; align-items: flex-end; padding: 56px;
}
.register-aside-pattern {
  position: absolute; inset: -40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 60px;
  opacity: 0.07; transform: rotate(-12deg);
}
.register-aside-pattern .logo-icon { width: 100%; height: auto; }
.register-aside-pattern .logo-icon g { fill: #fff; }
.register-aside-text { position: relative; max-width: 460px; animation: rise 0.8s var(--ease) both; }
.register-aside h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.5rem); margin: 14px 0 16px; }
.register-aside p { color: #c3cde6; }
.register-aside ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.register-aside li { display: flex; gap: 12px; align-items: center; color: #fff; font-weight: 500; }
.register-aside li::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--cross); transform: rotate(45deg); flex: none; }
.register-form { padding: 56px clamp(24px, 6vw, 88px); display: flex; flex-direction: column; justify-content: center; gap: 20px; max-width: 620px; width: 100%; margin-inline: auto; animation: rise 0.8s 0.1s var(--ease) both; }
.register-head h1 { font-size: 2.2rem; margin: 8px 0 6px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span { font-weight: 600; color: var(--ink); font-size: 0.92rem; }
.field input {
  height: 52px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; width: 100%;
}
.field input:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 4px rgba(16, 45, 115, 0.08); }
.field input[dir='ltr'] { text-align: right; letter-spacing: 0.06em; }
.input-with-btn { position: relative; }
.input-with-btn .link-btn { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); }
.field-error { color: #c0394d; font-size: 0.82rem; }
.gov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gov-chip {
  height: 46px; border-radius: 11px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; color: var(--text);
  transition: all 0.2s var(--ease);
}
.gov-chip:hover { border-color: var(--navy); }
.gov-chip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 8px 18px -10px rgba(16, 45, 115, 0.8); }
.fine-print { font-size: 0.8rem; color: var(--muted); text-align: center; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: rgba(255, 255, 255, 0.85); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s, box-shadow 0.2s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 6px 20px -16px rgba(16, 45, 115, 0.5); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.header-nav { display: flex; gap: 6px; margin-inline-start: auto; }
.header-nav a { padding: 8px 14px; border-radius: 10px; font-weight: 500; color: var(--text); transition: background 0.2s, color 0.2s; }
.header-nav a:hover { background: var(--bg); color: var(--navy); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.profile { position: relative; }
.profile-btn { display: grid; place-items: center; }
.avatar {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--magenta-soft); color: var(--magenta); font-weight: 700; font-size: 1.05rem;
}
.avatar-lg { width: 48px; height: 48px; font-size: 1.2rem; }
.profile-scrim { position: fixed; inset: 0; z-index: 1; }
.profile-menu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 2; width: 260px; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  animation: rise 0.2s var(--ease);
}
.profile-menu-head { display: flex; gap: 12px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.profile-menu-head strong { display: block; color: var(--ink); }
.profile-menu-head small { color: var(--muted); }
.profile-menu-row { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; width: 100%; font-size: 0.9rem; color: var(--text); }
button.profile-menu-row:hover { background: var(--bg); }
.profile-menu-row.danger { color: #c0394d; }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden; color: #fff; padding: 64px 0 0;
  background: radial-gradient(900px 500px at 15% 20%, rgba(214, 28, 92, 0.22), transparent 60%),
    linear-gradient(150deg, var(--navy) 0%, var(--navy-900) 55%, var(--navy-950) 100%);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-mark { position: absolute; width: 620px; height: 620px; left: -140px; top: -120px; opacity: 0.06; }
.hero-mark g { fill: #fff; }
.hero-mark .cross { fill: #fff; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; padding-bottom: 96px; }
.hero-hello { color: #c3cde6; margin-bottom: 14px; font-weight: 500; animation: rise 0.7s var(--ease) both; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5.4vw, 4.4rem); font-weight: 700; margin: 14px 0 20px; line-height: 1.15; animation: rise 0.7s 0.08s var(--ease) both; }
.hero h1 em { font-style: normal; color: #ff8fb5; }
.hero-lead { color: #c9d2ea; font-size: 1.08rem; max-width: 560px; animation: rise 0.7s 0.16s var(--ease) both; }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; animation: rise 0.7s 0.24s var(--ease) both; }
.hero-stats { display: flex; gap: 0; margin: 40px 0 0; animation: rise 0.7s 0.32s var(--ease) both; }
.hero-stats > div { padding-inline: 26px; border-inline-start: 1px solid rgba(255, 255, 255, 0.16); }
.hero-stats > div:first-child { padding-inline-start: 0; border: 0; }
.hero-stats dt { font: 700 2rem/1.1 var(--font-latin); color: #fff; }
.hero-stats dd { margin: 4px 0 0; color: #aab6d6; font-size: 0.85rem; }
.hero-showcase { position: relative; height: 440px; }
.showcase-card {
  position: absolute; margin: 0; background: #fff; border-radius: 20px; padding: 14px 14px 12px; width: 58%;
  box-shadow: var(--shadow-lg); animation: float 7s ease-in-out infinite, rise 0.9s var(--ease) both;
}
.showcase-card img { border-radius: 12px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.showcase-card figcaption { color: var(--ink); font-weight: 600; font-size: 0.85rem; margin-top: 8px; padding-inline: 4px; }
.showcase-card.s0 { top: 0; left: 0; width: 52%; z-index: 2; animation-delay: 0s, 0.2s; }
.showcase-card.s1 { top: 8%; right: 0; width: 44%; transform: rotate(3deg); animation-delay: -2.3s, 0.35s; }
.showcase-card.s2 { bottom: 0; left: 30%; width: 42%; z-index: 3; transform: rotate(-2deg); animation-delay: -4.6s, 0.5s; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
.hero-features {
  position: relative; z-index: 2; list-style: none; margin: 0 0 -48px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.hero-features li { display: flex; gap: 14px; align-items: center; padding: 22px 26px; color: var(--navy); }
.hero-features li + li { border-inline-start: 1px solid var(--line); }
.hero-features svg { flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 11px; background: var(--bg); }
.hero-features b { display: block; color: var(--ink); }
.hero-features span { color: var(--muted); font-size: 0.85rem; }

/* ===== Sections ===== */
.section-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 28px; }
.section-num { font: 800 3rem/1 var(--font-brand); color: transparent; -webkit-text-stroke: 1.5px #c8d0e3; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 6px 0 6px; }

/* ===== Catalog ===== */
.catalog { padding: 110px 0 60px; }
.toolbar { position: sticky; top: var(--header-h); z-index: 20; padding: 12px 0; background: rgba(245, 247, 251, 0.9); backdrop-filter: blur(12px); }
.toolbar-inner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search {
  flex: 1 1 320px; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 13px; color: var(--muted);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(16, 45, 115, 0.08); }
.search input { flex: 1; border: 0; outline: 0; background: none; height: 100%; min-width: 0; color: var(--ink); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 11px;
  background: #fff; border: 1.5px solid var(--line); font-weight: 600; font-size: 0.86rem; color: var(--text);
  transition: all 0.2s var(--ease);
}
.chip span { font: 600 0.72rem/1 var(--font-latin); background: var(--bg); color: var(--muted); padding: 4px 7px; border-radius: 6px; }
.chip:hover { border-color: var(--navy); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.is-active span { background: rgba(255, 255, 255, 0.16); color: #fff; }
.chip-fav.is-active { background: var(--magenta); border-color: var(--magenta); }
.results-count { color: var(--muted); margin: 14px 0 8px; font-size: 0.9rem; }
.results-count b { color: var(--ink); }
.company-group { margin-top: 36px; }
.company-head { display: flex; align-items: flex-end; gap: 16px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.company-index { font: 800 2.4rem/1 var(--font-brand); color: var(--cross); opacity: 0.25; }
.company-head h3 { font-size: 1.6rem; font-family: var(--font-latin); }
.company-count { margin-inline-start: auto; color: var(--muted); font-size: 0.88rem; background: #fff; border: 1px solid var(--line); padding: 4px 12px; border-radius: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

.card {
  position: relative; display: flex; flex-direction: column; background: #fff; border-radius: 18px;
  border: 1px solid var(--line); overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card-media { display: block; aspect-ratio: 4 / 3; background: #f3f4f8; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.32); transition: transform 0.5s var(--ease); }
.card:hover .card-media img { transform: scale(1.4); }
.fav-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); color: var(--muted);
  box-shadow: var(--shadow-sm); transition: color 0.2s, transform 0.2s var(--ease);
}
.fav-btn:hover { color: var(--cross); }
.fav-btn.is-on { color: var(--cross); animation: pop 0.35s var(--ease); }
@keyframes pop { 50% { transform: scale(1.25); } }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tag { font-size: 0.72rem; font-weight: 600; color: var(--navy); background: #edf1fa; padding: 3px 9px; border-radius: 6px; }
.sp { font: 600 0.6rem/1 var(--font-latin); letter-spacing: 0.14em; color: #a2abc2; }
.card h4 { font-size: 1.08rem; font-weight: 600; cursor: pointer; text-align: right; }
.card h4:hover { color: var(--navy); }
.ingredient { color: var(--muted); font-size: 0.8rem; line-height: 1.5; margin-top: 4px; text-align: right; min-height: 2.4em; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 14px; }
.price { display: flex; align-items: baseline; gap: 5px; }
.price b { font: 700 1.35rem/1 var(--font-latin); color: var(--navy); }
.price span { color: var(--muted); font-size: 0.8rem; }
.card-details { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 0.82rem; font-weight: 600; color: var(--muted); text-align: center; }
.card-details:hover { color: var(--navy); }
.stepper { display: inline-flex; align-items: center; height: 36px; border-radius: 10px; background: var(--navy); color: #fff; overflow: hidden; }
.stepper button { width: 34px; height: 100%; display: grid; place-items: center; transition: background 0.2s; }
.stepper button:hover { background: rgba(255, 255, 255, 0.12); }
.stepper span { min-width: 26px; text-align: center; font: 700 0.95rem var(--font-latin); }
.stepper-lg { height: 52px; border-radius: 13px; }
.stepper-lg button { width: 48px; }
.stepper-lg span { font-family: var(--font); padding-inline: 6px; }
.stepper-sm { height: 32px; }
.stepper-sm button { width: 30px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); display: grid; justify-items: center; gap: 14px; background: #fff; border-radius: var(--radius-lg); border: 1px dashed var(--line); }

/* ===== Companies ===== */
.companies { padding: 60px 0 90px; }
.company-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.company-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 18px;
  background: #fff; border: 1px solid var(--line); text-align: right; transition: all 0.3s var(--ease);
}
.company-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.company-card-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; margin-bottom: 10px; }
.company-card-imgs img { aspect-ratio: 1; object-fit: cover; border-radius: 9px; transform: scale(1); background: #f3f4f8; }
.company-card strong { font-size: 1.1rem; color: var(--ink); }
.company-card span { font-size: 0.82rem; color: var(--magenta); font-weight: 600; }

/* ===== About ===== */
.about { position: relative; padding: 96px 0; color: #dfe6f7; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-950) 100%); overflow: hidden; }
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: start; }
.about h2 { color: #fff; font-size: clamp(1.9rem, 3.4vw, 2.8rem); margin: 12px 0 22px; }
.about-main p { font-size: 1.1rem; line-height: 2.05; color: #cdd5ec; }
.about-side { position: relative; display: grid; gap: 12px; }
.about-mark { position: absolute; width: 360px; height: 360px; left: -120px; top: -140px; opacity: 0.08; pointer-events: none; }
.about-mark g, .about-mark .cross { fill: #fff; }
.about-card { position: relative; display: flex; gap: 14px; padding: 20px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.about-card svg { flex: none; width: 42px; height: 42px; padding: 10px; border-radius: 11px; background: rgba(214, 28, 92, 0.18); color: #ff8fb5; }
.about-card b { color: #fff; display: block; margin-bottom: 2px; }
.about-card p { color: #b8c3df; font-size: 0.92rem; }

/* ===== Footer ===== */
.site-footer { background: #fff; border-top: 1px solid var(--line); padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 40px; }
.footer-logo { align-items: flex-start; }
.footer-logo .logo-icon { width: 46px; height: 46px; margin-bottom: 8px; }
.footer-logo .logo-word { font-size: 1.9rem; }
.footer-logo .logo-sub { font-size: 0.62rem; margin-inline-start: 0; }
.footer-brand p { color: var(--muted); margin-top: 18px; font-size: 0.92rem; max-width: 360px; }
.site-footer h4 { font-size: 0.95rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer li a, .site-footer li .link-btn { color: var(--muted); font-weight: 400; font-size: 0.92rem; }
.site-footer li a:hover, .site-footer li .link-btn:hover { color: var(--navy); text-decoration: none; }
.site-footer p { color: var(--muted); font-size: 0.92rem; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(7, 21, 56, 0.55); backdrop-filter: blur(6px); animation: fadeIn 0.25s forwards; opacity: 0;
}
.modal {
  position: relative; display: grid; grid-template-columns: 1fr 1.05fr; width: min(1040px, 100%); max-height: calc(100vh - 40px);
  background: #fff; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); animation: modalIn 0.4s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-info { position: relative; background: var(--cream); padding: 72px 48px 44px; display: flex; flex-direction: column; overflow-y: auto; }
.modal-top { position: absolute; top: 18px; right: 18px; z-index: 4; display: flex; gap: 8px; }
.modal-fav { color: var(--muted); }
.modal-fav.is-fav { color: var(--cross); }
.modal-close { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.modal-close:hover { background: var(--bg); }
.modal-info .eyebrow { color: #a8762f; }
.modal-info h2 { font-family: var(--font-latin); font-weight: 500; font-size: clamp(2rem, 4vw, 3rem); margin: 14px 0 8px; text-align: right; color: var(--ink); }
.modal-ingredient { color: var(--muted); font-size: 1.08rem; text-align: right; }
.modal-info hr { border: 0; border-top: 1px solid #e6e1d6; margin: 26px 0; width: 100%; }
.modal-price { text-align: left; }
.modal-price > span { color: var(--muted); font-size: 0.95rem; }
.modal-price div { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; direction: ltr; margin-top: 4px; }
.modal-price b { font: 700 3rem/1 var(--font-latin); color: var(--navy); }
.modal-price small { color: var(--navy); font-size: 1.1rem; font-family: var(--font); }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-actions > :first-child { flex: 1 1 180px; }
.modal-media { position: relative; display: grid; place-items: center; background: #f4f5f9; min-height: 420px; }
.modal-media > img { width: 100%; height: 100%; object-fit: cover; animation: fadeIn 0.35s forwards; opacity: 0; }
.modal-company { position: absolute; bottom: 20px; left: 20px; background: var(--navy); color: #fff; font-size: 0.85rem; padding: 8px 14px; border-radius: 8px; }
.thumbs { position: absolute; top: 20px; left: 20px; display: flex; flex-direction: column; gap: 8px; }
.thumbs button { width: 64px; height: 48px; border-radius: 9px; overflow: hidden; border: 2px solid #fff; box-shadow: var(--shadow-sm); opacity: 0.75; transition: opacity 0.2s, border-color 0.2s; }
.thumbs button.is-active { border-color: var(--navy); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Cart drawer ===== */
.drawer-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.drawer-root.is-open { pointer-events: auto; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(7, 21, 56, 0.45); opacity: 0; transition: opacity 0.3s; }
.is-open .drawer-scrim { opacity: 1; }
.drawer {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(440px, 100%); background: #fff;
  display: flex; flex-direction: column; transform: translateX(-102%); visibility: hidden;
  transition: transform 0.4s var(--ease), visibility 0s 0.4s;
  box-shadow: var(--shadow-lg);
}
.is-open .drawer { transform: none; visibility: visible; transition: transform 0.4s var(--ease); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 1.4rem; margin-top: 4px; }
.drawer-head small { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.drawer-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.cart-lines { list-style: none; margin: 0; padding: 8px 24px; overflow-y: auto; flex: 1; }
.cart-lines li { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-lines img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; background: #f3f4f8; }
.cart-line-info { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: right; }
.cart-line-info b { font-size: 0.92rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line-info small { color: var(--muted); font-size: 0.75rem; }
.cart-line-price { color: var(--navy); font-weight: 700; font-size: 0.88rem; margin-top: 2px; }
.cart-line-ctrl { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.drawer-foot { padding: 18px 24px 22px; border-top: 1px solid var(--line); display: grid; gap: 12px; background: var(--bg); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; }
.total-row b { font: 700 1.6rem var(--font-latin); color: var(--navy); }
.total-row small { font-family: var(--font); font-size: 0.9rem; }
.send-to { font-size: 0.85rem; color: var(--muted); }
.send-to b { color: var(--ink); }
.muted-btn { color: var(--muted); justify-self: center; font-weight: 500; }

/* ===== Floating cart + toast ===== */
.cart-fab {
  position: fixed; bottom: 20px; left: 50%; translate: -50% 0; z-index: 25; display: none; align-items: center; gap: 10px;
  height: 52px; padding: 0 22px; border-radius: 26px; background: var(--navy); color: #fff; font-weight: 600;
  box-shadow: 0 14px 30px -10px rgba(16, 45, 115, 0.8); animation: rise 0.3s var(--ease);
}
.cart-fab span { background: var(--cross); min-width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; font: 700 0.8rem var(--font-latin); padding: 0 6px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 80; translate: -50% 20px; opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 0.9rem; font-weight: 500;
  transition: opacity 0.25s, translate 0.25s var(--ease);
}
.toast.is-on { opacity: 1; translate: -50% 0; }

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .company-cards { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { grid-template-columns: 1fr; padding-bottom: 80px; }
  .hero-showcase { height: 340px; max-width: 560px; width: 100%; margin-inline: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  :root { --header-h: 64px; }
  .header-nav { display: none; }
  .header-actions { margin-inline-start: auto; }
  .register { grid-template-columns: 1fr; }
  .register-aside { padding: 40px 24px 36px; min-height: 0; }
  .register-aside ul { display: none; }
  .register-form { padding: 32px 20px 40px; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .modal { grid-template-columns: 1fr; overflow-y: auto; }
  .modal-media { min-height: 0; aspect-ratio: 4 / 3; order: -1; }
  .modal-info { padding: 28px 22px 26px; overflow: visible; }
  .modal-top { top: 12px; right: 12px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { border-radius: 22px 22px 0 0; max-height: 94vh; }
  .cart-fab { display: inline-flex; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 28px); }
  .hide-sm { display: none; }
  .logo-inline-text small { display: none; }
  .logo-inline-text strong { font-size: 1.1rem; }
  .hero { padding-top: 36px; }
  .hero-stats > div { padding-inline: 16px; }
  .hero-stats dt { font-size: 1.5rem; }
  .hero-showcase { display: none; }
  .hero-grid { padding-bottom: 72px; }
  .showcase-card figcaption { font-size: 0.72rem; }
  .hero-features { grid-template-columns: 1fr; margin-bottom: -40px; }
  .hero-features li { padding: 14px 18px; }
  .hero-features li + li { border-inline-start: 0; border-top: 1px solid var(--line); }
  .catalog { padding-top: 84px; }
  .section-num { font-size: 2.2rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { border-radius: 14px; }
  .card-body { padding: 10px 11px 12px; }
  .card h4 { font-size: 0.92rem; }
  .ingredient { font-size: 0.72rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .card-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .card-foot .btn, .card-foot .stepper { width: 100%; justify-content: space-between; }
  .card-foot .btn { justify-content: center; }
  .price b { font-size: 1.15rem; }
  .sp { display: none; }
  .fav-btn { top: 8px; right: 8px; width: 32px; height: 32px; }
  .company-cards { grid-template-columns: repeat(2, 1fr); }
  .gov-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .modal-price b { font-size: 2.4rem; }
  .modal-actions .btn-outline { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ===== إضافات النسخة العادية (HTML) ===== */
[hidden] { display: none !important; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: 13px; }
.auth-tabs button { height: 42px; border-radius: 10px; font-weight: 600; color: var(--muted); transition: all 0.2s var(--ease); }
.auth-tabs button.is-active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.form-msg { color: #c0394d; font-size: 0.9rem; min-height: 1.2em; }
.field-error:empty { display: none; }
.no-img { display: grid; place-items: center; width: 100%; height: 100%; color: #b8c0d4; background: #f3f4f8; }
.no-img.sm { width: 64px; height: 64px; border-radius: 12px; flex: none; }

/* ===== لوحة الإدارة ===== */
.admin-body { background: var(--bg); }
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-950) 100%); }
.admin-card { width: min(420px, 100%); background: #fff; border-radius: 22px; padding: 36px 30px; display: grid; gap: 16px; box-shadow: var(--shadow-lg); }
.admin-card h1 { text-align: center; font-size: 1.4rem; }
.admin-logo .logo-icon { width: 54px; height: 54px; }
.admin-logo .logo-word { font-size: 2rem; }
.admin-logo .logo-sub { font-size: 0.62rem; }
.back-link { justify-self: center; }
.admin-loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.admin-tabs { display: flex; gap: 6px; margin-inline-start: auto; }
.admin-tabs button { height: 40px; padding: 0 14px; border-radius: 10px; font-weight: 600; color: var(--text); display: inline-flex; gap: 8px; align-items: center; }
.admin-tabs button span { font: 600 0.72rem var(--font-latin); background: var(--bg); padding: 3px 7px; border-radius: 6px; color: var(--muted); }
.admin-tabs button.is-active { background: var(--navy); color: #fff; }
.admin-tabs button.is-active span { background: rgba(255, 255, 255, 0.18); color: #fff; }
.admin-main { padding: 28px 0 60px; }
.admin-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.admin-toolbar h2 { font-size: 1.5rem; }
.admin-toolbar .search { flex: 1 1 260px; max-width: 420px; margin-inline-start: auto; }
.admin-table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th { text-align: right; font-weight: 600; color: var(--muted); font-size: 0.8rem; padding: 12px 14px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td b { display: block; color: var(--ink); text-align: right; }
.admin-table td small { display: block; color: var(--muted); font-size: 0.75rem; text-align: right; }
.admin-table .num { white-space: nowrap; font-family: var(--font-latin); }
.admin-table tr.is-hidden td { background: #fcfcfd; }
.admin-table tr.is-hidden b { color: var(--muted); }
.admin-table .center { text-align: center; padding: 30px; }
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; }
.pill { padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.pill.on { background: #e4f6ec; color: #1a7a44; }
.pill.off { background: #f1f2f6; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .icon-btn { width: 36px; height: 36px; }
.icon-btn.danger { color: #c0394d; }
.icon-btn.confirming { background: #c0394d; color: #fff; border-color: #c0394d; }
.admin-modal { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: #fff; border-radius: 20px; padding: 22px 24px; display: grid; gap: 16px; box-shadow: var(--shadow-lg); animation: modalIn 0.3s var(--ease); }
.admin-modal header, .admin-modal footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.admin-modal footer { justify-content: flex-end; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }
.img-list { display: flex; flex-wrap: wrap; gap: 10px; }
.img-item { width: 120px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.img-item.is-main { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(16, 45, 115, 0.15); }
.img-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.img-item div { display: flex; justify-content: space-between; padding: 6px 8px; font-size: 0.75rem; }
.img-item button { color: var(--navy); font-weight: 600; }
.img-item button[data-rm] { color: #c0394d; }
.img-item em { font-style: normal; color: var(--muted); }
.upload { display: inline-flex; gap: 8px; align-items: center; justify-self: start; height: 42px; padding: 0 16px; border-radius: 11px; border: 1.5px dashed #b9c3da; color: var(--navy); font-weight: 600; cursor: pointer; }
.upload:hover { border-color: var(--navy); background: #f6f8fd; }
.gov-admin { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 14px; max-width: 720px; }
.gov-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gov-admin > .btn { justify-self: start; }
@media (max-width: 760px) {
  .header-inner { gap: 10px; }
  .admin-tabs { overflow-x: auto; }
  .admin-tabs button { padding: 0 10px; font-size: 0.85rem; }
  .site-header .logo-inline-text { display: none; }
  .admin-form-grid, .gov-row { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .admin-table th:nth-child(3), .admin-table td:nth-child(3) { display: none; }
}
