/* static/css/site.css */
/* هوية بصرية موحّدة للموقع (المعقب)
   ألوان أساسية: أزرق #1E3A5F، أخضر #2E7D32، عنابي #8B1E3F، أبيض #FFFFFF، رمادي فاتح #F5F5F5
   يدعم الوضعين: نهاري/ليلي عبر html[data-theme="dark"]
*/

/* =========================
   المتغيرات (نهاري افتراضي)
   ========================= */
:root{
  --blue:#1E3A5F;      /* أزرق داكن */
  --accent:#2563EB;    /* أزرق مشرق — لون التمييز المنسجم مع الهوية */
  --green:#2E7D32;     /* أخضر أكاديمي (يبقى لحالات النجاح فقط) */
  --white:#FFFFFF;
  --maroon:#8B1E3F;    /* عنابي */
  --gray:#F5F5F5;      /* رمادي فاتح */

  --bg:var(--gray);
  --card:#fff;
  --text:#222;
  --muted:#6b7280;
  --border:#e6e6e6;
  --shadow:0 8px 24px rgba(0,0,0,.06);

  --radius:16px;
  --radius-sm:12px;
  --gap:12px;
  --container:1100px;
  --transition: .18s ease;
}

/* ==============
   الوضع الليلي
   ============== */
html[data-theme="dark"]{
  --bg:#0f172a;
  --card:#111827;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --border:#334155;
  --shadow:0 8px 24px rgba(0,0,0,.25);

  /* تباينات يسيرة للعلامات */
  --blue:#93c5fd;
  --accent:#60a5fa;
  --green:#86efac;
  --maroon:#fca5a5;
}

/* =========
   الأساسيات
   ========= */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:'Cairo','Tajawal','Poppins','Open Sans',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  transition:background var(--transition), color var(--transition);
}
a{color:var(--blue);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;display:block}

/* =========
   حاويات
   ========= */
.container{max-width:var(--container);margin:18px auto;padding:0 16px}
.grid{display:grid;gap:var(--gap)}
.hidden{display:none}
.spacer{flex:1}

/* ========
   بطاقات
   ======== */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:var(--shadow);
  transition:background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

/* =========
   أزرار
   ========= */
.btn{
  display:inline-block;
  padding:10px 14px;
  border-radius:var(--radius-sm);
  border:1px solid var(--border);
  background:#eee;
  color:#111;
  cursor:pointer;
  text-decoration:none;
  font-weight:600;
  text-align:center;
  transition:filter var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}
.btn:hover{filter:brightness(.97)}
.btn:disabled{opacity:.6;cursor:not-allowed}

.btn-primary{background:var(--blue);border-color:var(--blue);color:#fff}
.btn-primary:hover{filter:brightness(.96)}

.btn-secondary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn-secondary:hover{filter:brightness(.96)}

.btn-danger{background:#dc2626;border-color:#dc2626;color:#fff}
.btn-danger:hover{filter:brightness(.96)}

/* =========
   حقول إدخال
   ========= */
.input, select, textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--card);
  color:var(--text);
  font-size:16px; /* 16px يمنع تكبير iOS التلقائي عند التركيز على الحقل */
  transition:border-color var(--transition), background var(--transition), color var(--transition);
}
/* أي حقل إدخال في الموقع لا يقل عن 16px حتى لا يحدث زوم تلقائي على الهاتف */
input, textarea, select{ font-size:16px }

/* حقل الهاتف في صفحة تسجيل الدخول: مفتاح البلد + الرقم بنفس الارتفاع والتناسب */
.phone-field{ display:flex; align-items:stretch; gap:8px; margin:6px 0 12px }
.phone-field .prefix{
  display:flex; align-items:center;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--bg);
  color:var(--text);
  font-size:16px;
  white-space:nowrap;
  user-select:none;
  flex:0 0 auto;
}
.phone-field input{
  flex:1 1 auto;
  min-width:0;
  margin:0;
}
.input:focus, select:focus, textarea:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(30,58,95,.15);
}

/* =========
   شارات/حالات
   ========= */
.badge{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--border);
  background:#eef2ff;
  color:#3730a3;
}
.status-submitted{background:#e0f2fe;color:#075985}
.status-available,.status-awaiting_payment{background:#ecfccb;color:#365314}
.status-paid{background:#fef9c3;color:#92400e}
.status-approved{background:#dcfce7;color:#166534}
.status-unavailable,.status-rejected{background:#fee2e2;color:#991b1b}

/* =========
   رسائل/محادثة
   ========= */
.messages-box{
  max-height:260px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:8px;
  background:var(--card);
}
.bubble{
  max-width:80%;
  padding:8px 10px;
  border-radius:12px;
  margin:6px 0;
  line-height:1.6;
}
.bubble-user{background:#f5f5f5;color:#111}
.bubble-admin{background:#e6f4ff;color:#111}
html[data-theme="dark"] .bubble-user{background:#1f2937;color:#e5e7eb}
html[data-theme="dark"] .bubble-admin{background:#0ea5e9; color:#0b1220}

/* شبكة البرامج: التعريف الكامل أسفل الملف مع بطاقات المنتجات */

/* =========
   ترويسة/تنقل
   ========= */
.topbar{background:#1E3A5F;color:#fff}
.nav{background:var(--card);border-bottom:1px solid var(--border);display:flex;gap:12px}

/* =========
   عناوين/نصوص مساعدة
   ========= */
h1,h2,h3{margin:0 0 8px 0}
.muted{color:var(--muted);font-size:13px}

/* =======
   المودال
   ======= */
.modal{position:fixed;inset:0;background:rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;z-index:50}
.modal.hidden{display:none}
.modal-card{
  background:var(--card);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  min-width:320px;
  max-width:520px;
  box-shadow:var(--shadow);
}

/* =========
   جدول بسيط (للإعدادات)
   ========= */
.adminlist{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  background:var(--card);
}
.adminlist th, .adminlist td{padding:10px 12px;border-bottom:1px solid var(--border)}
.adminlist thead th{background:#f8fafc;color:#0f172a;text-align:right}
html[data-theme="dark"] .adminlist thead th{background:#0b1220;color:#e5e7eb}
.adminlist tbody tr:hover{background:rgba(0,0,0,.03)}
html[data-theme="dark"] .adminlist tbody tr:hover{background:rgba(255,255,255,.04)}


/* --- News Ticker --- */
/* --- News Ticker (continuous, right-to-left visual, scrolling to the RIGHT) --- */

.news-ticker{
  position:relative;
  background:#0f172a;
  color:#fff;
  border-bottom:1px solid rgba(255,255,255,.08);
  overflow:hidden;
  height:38px;
}
.news-ticker .ticker-viewport{
  width:100%;
  overflow:hidden;
}
.news-ticker .ticker-track{
  display:inline-flex;
  align-items:center;
  gap:32px;
  white-space:nowrap;
  padding:8px 16px;
  will-change:transform;
  /* يمين بشكل متصل */
  animation: ticker-right var(--ticker-speed, 28s) linear infinite;
}
.news-ticker .ticker-item{
  opacity:.95;
  font-size:14px;
}
.news-ticker:hover .ticker-track{
  animation-play-state: paused;
}
@keyframes ticker-right{
  0%   { transform: translateX(0); }      /* يبدأ ظاهر فوراً */
  100% { transform: translateX(50%); }    /* يتحرّك يميناً نصف العرض ثم يعيد نفسه بلا قفزة */
}

@media (prefers-reduced-motion: reduce){
  .news-ticker .ticker-track{ animation: none; }
}

/* =========================================================
   الشريط الرئيسي المتقلّب (Hero)
   ========================================================= */
.hero{
  position:relative;
  height:min(64vh, 560px);
  min-height:360px;
  border-radius:0 0 28px 28px;
  overflow:hidden;
  margin:0 -16px 20px;
  background:#0f172a;
}
.hero__slides{ position:absolute; inset:0 }
.hero__slide{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  opacity:0;
  transition:opacity 1.2s ease;
}
.hero__slide.active{ opacity:1 }
.hero__overlay{
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(15,23,42,.15) 0%, rgba(15,23,42,.35) 55%, rgba(15,23,42,.85) 100%);
}
.hero__content{
  position:absolute;
  inset-inline:0;
  bottom:56px;
  padding:0 20px;
  color:#fff;
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}
.hero__eyebrow{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:rgba(255,255,255,.16);
  backdrop-filter:blur(4px);
  padding:6px 14px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}
.hero__title{
  margin:0;
  font-size:clamp(22px, 6vw, 34px);
  font-weight:800;
  line-height:1.35;
  text-shadow:0 2px 12px rgba(0,0,0,.4);
  max-width:640px;
}
.hero__subtitle{
  margin:0;
  font-size:14px;
  color:rgba(255,255,255,.9);
  max-width:520px;
  line-height:1.7;
}
.hero__cta{
  margin-top:6px;
  padding:12px 28px;
  border-radius:999px;
  font-size:15px;
  box-shadow:0 8px 24px rgba(37,99,235,.45);
}
.hero__caption{
  position:absolute;
  bottom:16px;
  inset-inline-start:20px;
  color:rgba(255,255,255,.85);
  font-size:12px;
}
.hero__dots{
  position:absolute;
  bottom:16px;
  inset-inline-end:20px;
  display:flex;
  gap:6px;
}
.hero__dot{
  width:6px; height:6px;
  border-radius:999px;
  background:rgba(255,255,255,.4);
  transition:background var(--transition), width var(--transition);
}
.hero__dot.active{ background:#fff; width:18px }

@media (min-width:900px){
  .hero{ margin:0 0 24px; border-radius:24px; height:min(52vh, 460px) }
}

/* =========================================================
   الشريط العلوي (هاتف: صفّان — علامة + أدوات، ديسكتوب: صفّ واحد)
   ========================================================= */
.site-header{
  background:rgba(30, 58, 95, .85);
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
  color:#fff;
  position:fixed; /* fixed بدل sticky: يبقى طافياً دائماً مهما كان السكرول */
  top:0;
  inset-inline:0;
  z-index:40;
  box-shadow:0 2px 16px rgba(0,0,0,.18);
}
/* عنصر فارغ يحجز مساحة الهيدر الثابت حتى لا يغطي بداية المحتوى (ارتفاعه يُضبط بالجافاسكربت) */
#headerSpacer{ height:110px }
/* هامش علوي عند القفز لموضع البطاقات حتى لا يغطيه الهيدر الثابت */
#specialties{ scroll-margin-top:120px }
.site-header__brand{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 16px 6px;
}
.brand-link{
  display:flex;
  align-items:center;
  gap:10px;
  color:#fff;
  text-decoration:none;
  font-weight:700;
  font-size:18px;
}
.brand-logo{
  height:34px;
  width:34px;
  display:block;
  background:#fff;
  border-radius:10px;
  padding:4px;
  box-shadow:0 2px 6px rgba(0,0,0,.15);
  object-fit:contain;
}
.btn-about{
  display:inline-flex;
  align-items:center;
  gap:5px;
  color:#fff;
  text-decoration:none;
  background:var(--accent);
  padding:8px 16px;
  border-radius:999px;
  font-size:14px;
  font-weight:700;
  white-space:nowrap;
  box-shadow:0 3px 10px rgba(37,99,235,.4);
}
.site-header__utility{
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 16px 10px;
}
.header-search{
  position:relative;
  flex:1 1 0%;
  min-width:0; /* يسمح للنموذج بالانكماش داخل الشريط فلا يخرج زر البحث عن الشاشة */
  display:flex;
  align-items:center;
  gap:4px;
  background:rgba(255,255,255,.16);
  border-radius:999px;
  padding:0 6px 0 6px;
}
.header-search input{
  flex:1;
  min-width:0;
  border:none;
  background:transparent;
  color:#fff;
  padding:12px 6px;
  font-size:16px;
  outline:none;
}
.header-search input::placeholder{ color:rgba(255,255,255,.7) }
/* اختيار الجامعة والدرجة داخل شريط البحث — مع سهم منسدل واضح */
.header-search__sel{
  flex:0 0 auto;
  width:72px;
  border:none;
  background-color:rgba(255,255,255,.16);
  color:#fff;
  border-radius:999px;
  padding:8px 8px 8px 22px; /* مساحة يسار للسهم */
  font-size:12px;
  font-weight:600;
  outline:none;
  cursor:pointer;
  -webkit-appearance:none;
  appearance:none;
  text-overflow:ellipsis;
  white-space:nowrap;
  /* سهم منسدل أبيض على يسار القائمة (RTL) */
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:left 7px center;
}
.header-search__sel:hover, .header-search__sel:focus{ background-color:rgba(255,255,255,.26) }
.header-search__sel option{ color:#0f172a }
#hsDegree{ width:66px }
/* قائمة الاقتراحات الحيّة */
.search-suggest{
  position:absolute;
  top:calc(100% + 6px);
  inset-inline:0;
  background:var(--card);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 12px 30px rgba(0,0,0,.25);
  overflow:hidden;
  z-index:60;
  max-height:60vh;
  overflow-y:auto;
}
.search-suggest.hidden{ display:none }
.search-suggest__item{
  display:block;
  padding:11px 14px;
  border-bottom:1px solid var(--border);
  text-decoration:none;
  color:var(--text);
}
.search-suggest__item:last-child{ border-bottom:none }
.search-suggest__item:hover, .search-suggest__item.active{ background:rgba(37,99,235,.08) }
.search-suggest__title{ font-weight:700; font-size:14px }
.search-suggest__meta{ font-size:12px; color:var(--muted); margin-top:2px }
.search-suggest__empty{ padding:14px; color:var(--muted); font-size:13px; text-align:center }
.header-search__btn{
  background:transparent;
  border:none;
  color:#fff;
  padding:6px;
  cursor:pointer;
  display:flex;
  align-items:center;
}
.menu-dots-wrap{ position:relative; flex:0 0 auto }
.btn-icon{
  background:rgba(255,255,255,.14);
  border:none;
  color:#fff;
  width:38px;
  height:38px;
  border-radius:50%;
  font-size:20px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.menu-dropdown{
  position:absolute;
  inset-inline-start:0;
  top:44px;
  background:var(--card);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:var(--shadow);
  min-width:220px;
  max-height:70vh;
  overflow-y:auto;
  padding:6px;
  z-index:50;
}
.menu-dropdown.hidden{ display:none }
.menu-dropdown__item{
  display:block;
  width:100%;
  text-align:right;
  background:transparent;
  border:none;
  color:var(--text);
  padding:10px 12px;
  border-radius:8px;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  text-decoration:none;
}
.menu-dropdown__item:hover{ background:rgba(0,0,0,.05) }
html[data-theme="dark"] .menu-dropdown__item:hover{ background:rgba(255,255,255,.06) }
.menu-dropdown__label{
  padding:10px 12px 2px;
  font-size:11px;
  font-weight:700;
  color:var(--muted);
}
.menu-dropdown__item--sub{
  font-weight:500;
  font-size:13px;
  padding-inline-start:20px;
}
.menu-filter{ display:flex; flex-direction:column }
.menu-check{
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px 12px 8px 20px;
  font-size:14px;
  font-weight:500;
  color:var(--text);
  cursor:pointer;
  border-radius:8px;
}
.menu-check:hover{ background:rgba(0,0,0,.05) }
html[data-theme="dark"] .menu-check:hover{ background:rgba(255,255,255,.06) }
.menu-check input{ width:auto; accent-color:var(--accent); margin:0 }
.menu-filter__done{ margin:10px 8px 4px; width:calc(100% - 16px) }
.menu-dropdown__sep{
  height:1px;
  background:var(--border);
  margin:6px 4px;
}

/* =========================
   الشريط السفلي العائم (هاتف)
   ========================= */
.bottom-nav{
  position:fixed;
  bottom:calc(10px + env(safe-area-inset-bottom, 0));
  inset-inline-start:12px;
  inset-inline-end:12px;
  display:flex;
  background:rgba(30, 58, 95, .85);
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
  border:1px solid rgba(255,255,255,.12);
  border-radius:22px;
  box-shadow:0 8px 28px rgba(0,0,0,.28);
  z-index:45;
  overflow:hidden;
  padding:4px;
  gap:2px;
}
.bottom-nav__item{
  flex:1;
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  padding:9px 4px;
  color:rgba(255,255,255,.72);
  text-decoration:none;
  font-size:11px;
  font-weight:600;
  -webkit-tap-highlight-color:transparent;
  /* بلا transition: المربع النشط ينتقل فوراً عند اللمس قبل انتقال الصفحة */
}
.bottom-nav__icon{ font-size:19px; line-height:1 }
.bottom-nav__item:hover{ color:#fff }
.bottom-nav__item:active{ background:rgba(255,255,255,.12); border-radius:16px }
/* الصفحة الحالية فقط: مستطيل مقوس الأركان بلون مغاير (عنصر واحد لا أكثر) */
.bottom-nav__item.active{
  background:var(--accent);
  color:#fff;
  border-radius:16px;
}
/* نقطة إشعار حمراء على عنصر الشريط السفلي (حسابي عند وجود رد جديد) */
.bottom-nav__dot{
  position:absolute;
  top:6px;
  inset-inline-end:calc(50% - 18px);
  width:9px; height:9px;
  background:#ef4444;
  border:2px solid rgba(30,58,95,1);
  border-radius:50%;
}
.bottom-nav-spacer{ height:84px }

/* =========================
   صفحة تفاصيل البرنامج
   ========================= */
.detail{ max-width:680px; margin:0 auto }
.detail__media{ position:relative; width:100%; aspect-ratio:4/3; background:#e5e7eb; border-radius:var(--radius); overflow:hidden; margin-bottom:14px }
.detail__img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:0; transition:opacity .5s ease }
.detail__img.active{ opacity:1 }
.detail__img--placeholder{ display:flex; align-items:center; justify-content:center; color:#fff; background:var(--blue); font-weight:700; position:static; opacity:1; padding:12px; text-align:center }
.detail__body{ padding:16px }
.detail__head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px }
.detail__title{ margin:0; font-size:20px; line-height:1.4 }
.detail__share{
  flex:0 0 auto;
  display:inline-flex; align-items:center; gap:6px;
  background:var(--accent); color:#fff; border:none;
  padding:8px 14px; border-radius:999px;
  font-weight:700; font-size:13px; cursor:pointer;
  white-space:nowrap;
}
.detail__meta{ color:var(--muted); font-size:14px; margin-top:6px }
.detail__note{
  margin-top:14px; padding:12px 14px;
  background:rgba(37,99,235,.08);
  border:1px solid rgba(37,99,235,.25);
  border-inline-start:4px solid var(--accent);
  border-radius:var(--radius-sm);
  line-height:1.8;
}
.detail__facts{
  display:grid; grid-template-columns:1fr 1fr; gap:10px;
  margin-top:16px;
}
.fact{ background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 12px }
.fact__k{ display:block; font-size:12px; color:var(--muted) }
.fact__v{ display:block; font-weight:700; margin-top:2px }
.detail__cta{ margin-top:18px; width:100% }
@media (max-width:480px){ .detail__facts{ grid-template-columns:1fr } }

/* قسم الأقسام المشابهة أسفل صفحة البطاقة */
.similar{ max-width:680px; margin:26px auto 0 }
.similar__title{
  margin:0 0 12px;
  font-size:17px;
  color:var(--blue);
  padding-inline-start:10px;
  border-inline-start:4px solid var(--accent);
}
html[data-theme="dark"] .similar__title{ color:var(--text) }

/* شارة "ملاحظة" على بطاقة البرنامج + زر المشاركة */
.product-card__note-flag{
  position:absolute; top:8px; inset-inline-end:8px;
  background:var(--accent); color:#fff;
  font-size:11px; font-weight:700;
  padding:3px 8px; border-radius:999px;
}
.product-card__share{
  background:transparent; border:1px solid var(--border);
  color:var(--muted); border-radius:8px;
  padding:7px; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  transition:color var(--transition), border-color var(--transition);
}
.product-card__share:hover, .product-card__share.copied{ color:var(--accent); border-color:var(--accent) }
.product-card__actions{ display:flex; gap:6px; margin-top:auto }
.product-card__actions .product-card__cta{ margin-top:0; flex:1 }

/* =========================
   السحب للتحديث (pull-to-refresh)
   ========================= */
.ptr{
  position:fixed;
  top:-46px; inset-inline-start:50%;
  transform:translateX(-50%);
  z-index:70;
  width:38px; height:38px;
  border-radius:50%;
  background:var(--card);
  border:1px solid var(--border);
  box-shadow:0 6px 18px rgba(0,0,0,.2);
  display:flex; align-items:center; justify-content:center;
  opacity:0;
  transition:opacity .15s ease;
  pointer-events:none;
}
.ptr--on{ opacity:1 }
.ptr__spin{
  width:18px; height:18px;
  border:2.5px solid var(--border);
  border-top-color:var(--accent);
  border-radius:50%;
  transition:transform .15s ease;
}
.ptr--ready .ptr__spin{ border-top-color:var(--accent); transform:rotate(180deg) }
.ptr--spinning .ptr__spin{ animation:ptr-spin .7s linear infinite }
@keyframes ptr-spin{ to{ transform:rotate(360deg) } }

/* =========================
   إشعارات المستخدم: شريط الطلب + زر التفعيل
   ========================= */
.push-banner{
  position:fixed;
  inset-inline:12px;
  bottom:calc(96px + env(safe-area-inset-bottom, 0));
  z-index:47;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  background:rgba(30,58,95,.96);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  color:#fff;
  padding:12px 14px;
  border-radius:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.3);
}
.push-banner__txt{ flex:1; min-width:160px; font-size:13px; font-weight:600; line-height:1.6 }
.push-banner__actions{ display:flex; gap:8px }
.push-banner__ok{
  background:var(--accent); color:#fff; border:none;
  padding:8px 16px; border-radius:999px; font-weight:700; cursor:pointer; font-size:13px;
}
.push-banner__no{
  background:transparent; color:rgba(255,255,255,.75);
  border:1px solid rgba(255,255,255,.35);
  padding:8px 12px; border-radius:999px; cursor:pointer; font-size:13px;
}
@media (min-width:900px){ .push-banner{ inset-inline:auto 20px; max-width:420px; bottom:20px } }

.push-toggle{
  background:var(--accent); color:#fff; border:none;
  padding:10px 16px; border-radius:999px;
  font-weight:700; font-size:14px; cursor:pointer;
}
.push-toggle.is-on{ background:#16a34a }

/* =========================
   صفحة الاستشارات
   ========================= */
.consult-kinds{ display:flex; flex-direction:column; gap:8px }
.consult-kind{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  cursor:pointer;
  font-weight:600;
  transition:border-color var(--transition), background var(--transition);
}
.consult-kind:has(input:checked){
  border-color:var(--accent);
  background:rgba(37,99,235,.08);
}
.consult-kind input{ width:auto; accent-color:var(--accent) }
.consult-reply{
  margin-top:10px;
  padding:10px 12px;
  background:rgba(37,99,235,.08);
  border:1px solid rgba(37,99,235,.25);
  border-radius:var(--radius-sm);
}

/* =========================
   زر ولوحة محادثة الدعم
   ========================= */
.chat-fab{
  position:fixed;
  inset-inline-end:16px;
  bottom:calc(92px + env(safe-area-inset-bottom, 0));
  width:52px; height:52px;
  border-radius:50%;
  background:var(--accent);
  color:#fff;
  border:none;
  box-shadow:0 8px 20px rgba(0,0,0,.25);
  font-size:22px;
  cursor:pointer;
  z-index:46;
  display:flex; align-items:center; justify-content:center;
}
.chat-fab__badge{
  position:absolute;
  top:-4px; inset-inline-start:-4px;
  background:#dc2626;
  color:#fff;
  font-size:11px;
  font-weight:700;
  min-width:18px; height:18px;
  border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  padding:0 4px;
}
.chat-fab__badge.hidden{ display:none }
.chat-panel{
  position:fixed;
  inset-inline-end:16px;
  bottom:140px;
  width:min(340px, calc(100vw - 32px));
  height:min(460px, 60vh);
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 16px 40px rgba(0,0,0,.25);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  z-index:47;
}
.chat-panel.hidden{ display:none }
.chat-panel__header{
  background:var(--blue);
  color:#fff;
  padding:12px 14px;
  font-weight:700;
  display:flex; align-items:center; justify-content:space-between;
}
.chat-panel__close{
  background:transparent;
  border:none;
  color:#fff;
  font-size:22px;
  cursor:pointer;
  line-height:1;
}
.chat-panel__messages{
  flex:1;
  overflow:auto;
  padding:10px;
  display:flex;
  flex-direction:column;
}
.chat-panel__footer{
  display:flex;
  gap:8px;
  padding:10px;
  border-top:1px solid var(--border);
}
.chat-panel__footer textarea{
  flex:1;
  resize:none;
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 10px;
  font-family:inherit;
  background:var(--card);
  color:var(--text);
}
.chat-panel__send{
  background:var(--blue);
  color:#fff;
  border:none;
  border-radius:10px;
  width:40px;
  cursor:pointer;
  font-size:16px;
}
.chat-bubble-meta{ font-size:11px; color:var(--muted); margin-bottom:2px }

/* =========================
   أشرطة سكرول أفقي (مدن/جامعات مميزة)
   ========================= */
.scroll-row{ margin:18px 0 }
.scroll-row__title{ margin:0 0 10px; font-size:16px; color:var(--blue) }
html[data-theme="dark"] .scroll-row__title{ color:var(--text) }
.scroll-row__track{
  display:flex;
  gap:12px;
  overflow-x:auto;
  scroll-snap-type:x proximity;
  padding-bottom:6px;
  -webkit-overflow-scrolling:touch;
}
.scroll-row__track::-webkit-scrollbar{ height:6px }
.scroll-row__track::-webkit-scrollbar-thumb{ background:var(--border); border-radius:999px }

.uni-card{
  flex:0 0 auto;
  width:180px;
  scroll-snap-align:start;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  text-decoration:none;
  color:var(--text);
  box-shadow:var(--shadow);
  transition:transform var(--transition);
}
.uni-card:hover{ transform:translateY(-2px) }
.uni-card__media{ position:relative; width:100%; aspect-ratio:1; background:#fff; overflow:hidden }
.uni-card__img{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:contain; /* يُظهر شعار الجامعة كاملاً بدون قص */
  padding:8px;
  opacity:0;
  transition:opacity .5s ease;
}
.uni-card__img.active{ opacity:1 }
.uni-card__img--placeholder{
  display:flex; align-items:center; justify-content:center;
  color:#fff; background:var(--blue);
  font-size:12px; text-align:center; padding:8px;
  position:static; opacity:1;
}
.uni-card__body{ padding:8px 10px }
.uni-card__name{ font-weight:700; font-size:13px; line-height:1.4 }
.uni-card__meta{ font-size:11px; color:var(--muted); margin-top:2px }

/* =========================
   بطاقات الاختصاصات (منتجات)
   ========================= */
.product-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  transition:transform .2s ease, box-shadow .2s ease;
}
.product-card:hover{
  transform:translateY(-3px);
  box-shadow:0 14px 32px rgba(0,0,0,.12);
}
.product-card__media{ position:relative; width:100%; aspect-ratio:4/3; background:#e5e7eb; overflow:hidden }
.product-card__img{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  opacity:0;
  transition:opacity .5s ease;
}
.product-card__img.active{ opacity:1 }
.product-card__img--placeholder{
  display:flex; align-items:center; justify-content:center;
  color:#fff; background:var(--blue);
  font-size:12px; text-align:center; padding:8px;
  position:static; opacity:1;
}
.badge-degree{
  position:absolute;
  top:8px; inset-inline-start:8px;
  background:rgba(0,0,0,.55);
  color:#fff;
  border:none;
}
.product-card__body{ padding:10px 12px 12px; display:flex; flex-direction:column; gap:6px; flex:1 }
.product-card__title{ margin:0; font-size:14px; line-height:1.4 }
.product-card__meta{ font-size:11px; color:var(--muted) }
.product-card__price{ font-weight:700; color:var(--accent); font-size:15px }
.product-card__tags{ display:flex; flex-wrap:wrap; gap:6px }
/* margin-top:auto يثبّت زر التقديم أسفل البطاقة مهما اختلف طول العنوان */
.product-card__cta{ margin-top:auto; width:100%; padding:9px }

.programs-grid{ display:grid; gap:14px; grid-template-columns:repeat(2,1fr) }
@media (min-width:640px){ .programs-grid{ grid-template-columns:repeat(3,1fr) } }
@media (min-width:900px){ .programs-grid{ grid-template-columns:repeat(4,1fr) } }
@media (min-width:1300px){ .programs-grid{ grid-template-columns:repeat(5,1fr) } }

/* =========================
   شريط الفلاتر + النافذة السفلية
   ========================= */
.filter-bar{
  display:flex;
  align-items:center;
  gap:10px;
  margin:14px 0;
  flex-wrap:wrap;
}
.filter-bar__btn{ display:inline-flex; align-items:center; gap:6px }
.filter-bar__clear{ background:#fee2e2; color:#991b1b; border:1px solid #fecaca; display:inline-flex; align-items:center; gap:6px }
.filter-bar__total{ margin-inline-start:auto }
.filter-badge{
  background:#fff;
  color:var(--blue);
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  padding:1px 7px;
}
.filter-bar__clear .filter-badge{ background:#991b1b; color:#fff }

/* شريط فاصل ملوّن قبل بطاقات الاختصاصات */
.section-divider{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:20px 0 14px;
  padding:12px 14px;
  border-radius:var(--radius);
  background:linear-gradient(135deg, #1E3A5F 0%, #2563EB 100%);
  color:#fff;
  box-shadow:0 6px 18px rgba(30,58,95,.3);
}
.section-divider__title{
  font-weight:800;
  font-size:16px;
  white-space:nowrap;
}
.section-divider__actions{
  display:flex;
  gap:8px;
  margin-inline-start:auto;
}
/* زرّا الفلاتر بنفس الحجم تماماً */
.section-divider__btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-width:120px;
  height:40px;
  padding:0 14px;
  border-radius:999px;
  font-weight:700;
  font-size:14px;
  background:#fff;
  color:var(--blue);
  border:none;
}
.section-divider__btn--clear{
  background:rgba(255,255,255,.18);
  color:#fff;
  border:1px solid rgba(255,255,255,.5);
}
.section-divider__btn .filter-badge{ background:var(--accent); color:#fff }
.section-divider__btn--clear .filter-badge{ background:#fff; color:var(--blue) }
.section-divider .filter-bar__total{ color:rgba(255,255,255,.9); flex-basis:100%; margin:0 }
@media (max-width:520px){
  .section-divider__actions{ width:100%; margin-inline-start:0 }
  .section-divider__btn{ flex:1 }
}

.filter-sheet-backdrop{
  position:fixed; inset:0;
  background:rgba(0,0,0,.4);
  z-index:43; /* تحت الشريط السفلي (45) حتى يبقى الشريط ظاهراً فوق الستارة */
}
.filter-sheet-backdrop.hidden{ display:none }
/* ستارة جانبية تنزلق من يمين الشاشة، وتنتهي فوق الشريط السفلي فلا يحجب آخرها */
.filter-sheet{
  position:fixed;
  top:0;
  bottom:calc(80px + env(safe-area-inset-bottom, 0)); /* فوق الشريط السفلي العائم */
  right:0;
  left:auto;
  width:min(86vw, 380px);
  height:auto;
  background:var(--card);
  color:var(--text);
  border-radius:16px 0 0 16px;
  box-shadow:-10px 0 30px rgba(0,0,0,.3);
  z-index:44;
  display:flex;
  flex-direction:column;
  animation:drawer-in .25s ease;
}
@media (min-width:900px){
  .filter-sheet{ bottom:0 } /* لا شريط سفلي على الديسكتوب */
}
@keyframes drawer-in{
  from{ transform:translateX(100%) }
  to{ transform:translateX(0) }
}
@media (prefers-reduced-motion: reduce){
  .filter-sheet{ animation:none }
}
.filter-sheet__body{ flex:1 }
.filter-sheet.hidden{ display:none }
.filter-sheet__handle{ display:none } /* مقبض السحب كان للستارة السفلية القديمة */
.filter-sheet__header{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 16px 4px;
  font-weight:700;
}
.filter-sheet__body{ overflow:auto; padding:8px 16px 16px; display:flex; flex-direction:column; gap:14px }
.filter-sheet__footer{
  display:flex; gap:8px;
  padding:6px 0 12px;
  position:sticky; bottom:0; background:var(--card);
}

.chip{
  display:inline-flex; align-items:center; gap:6px;
  margin-inline-end:8px; margin-bottom:6px;
  padding:7px 12px; border:1px solid var(--border); border-radius:999px;
  background:var(--card); font-size:14px; color:var(--text);
}
.chip--disabled{ opacity:.4 }
.chip__count{ font-size:11px; color:var(--muted) }

@media (min-width:768px){
  .filters{ position:sticky; top:10px; z-index:5; }
}

/* =========================
   نقاط توقف الديسكتوب: إخفاء عناصر الهاتف وتوسيع الهيدر
   ========================= */
@media (min-width:900px){
  .bottom-nav, .bottom-nav-spacer, .chat-fab, .chat-panel{ display:none !important }

  .site-header{ padding:0 8px }
  .site-header__brand, .site-header__utility{ padding:0 }
  .site-header{
    display:flex;
    align-items:center;
    gap:24px;
    padding:10px 24px;
  }
  .site-header__brand{ padding:0; flex:0 0 auto }
  .site-header__utility{ flex:1; padding:0 }
  .header-search{ max-width:420px }

  .menu-dropdown{ min-width:260px }
}



