/* ===================================================
   style.css — ملف CSS الرئيسي لمنصة EDX Iraq
   =================================================== */

/* 1. Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@300;400;500;700;800&display=swap');

/* ===================================================
   2. متغيرات CSS (وضع فاتح)
   =================================================== */
:root {
  /* ألوان أساسية */
  --clr-primary:        #0284c7;
  --clr-primary-light:  #38bdf8;
  --clr-primary-dark:   #0369a1;
  --clr-accent:         #10b981;
  --clr-accent-light:   #34d399;
  --clr-accent-dark:    #059669;
  --clr-purple:         #8b5cf6;

  /* خلفيات */
  --bg-body:            #f8fafc;
  --bg-surface:         #ffffff;
  --bg-surface-2:       #f1f5f9;
  --bg-surface-3:       #e2e8f0;
  --bg-header:          rgba(255,255,255,0.92);
  --bg-card:            #ffffff;
  --bg-card-hover:      #f8fafc;

  /* نصوص */
  --txt-primary:        #0f172a;
  --txt-secondary:      #334155;
  --txt-muted:          #64748b;
  --txt-light:          #94a3b8;
  --txt-on-primary:     #ffffff;

  /* حدود */
  --border:             #e2e8f0;
  --border-focus:       #0284c7;

  /* ظلال */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.06);
  --shadow-md:  0 4px 20px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.10);
  --shadow-xl:  0 16px 48px rgba(0,0,0,.12);
  --shadow-card-hover: 0 12px 40px rgba(2,132,199,.15);

  /* زوايا */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-pill: 9999px;

  /* خطوط */
  --font-main: 'Cairo', 'Tajawal', system-ui, sans-serif;

  /* انتقالات */
  --transition-fast:  150ms ease;
  --transition-base:  250ms ease;
  --transition-slow:  400ms ease;

  /* تخطيط */
  --max-width: 1280px;
  --header-h:  72px;
}

/* ===================================================
   3. متغيرات الوضع الداكن
   =================================================== */
[data-theme="dark"] {
  --bg-body:            #0a0f1a;
  --bg-surface:         #111827;
  --bg-surface-2:       #1e293b;
  --bg-surface-3:       #263148;
  --bg-header:          rgba(17,24,39,0.96);
  --bg-card:            #1e293b;
  --bg-card-hover:      #263148;

  --txt-primary:        #f1f5f9;
  --txt-secondary:      #cbd5e1;
  --txt-muted:          #94a3b8;
  --txt-light:          #64748b;
  --txt-on-primary:     #ffffff;

  --border:             #334155;
  --border-focus:       #38bdf8;

  --shadow-xs:  0 1px 2px rgba(0,0,0,.3);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.4);
  --shadow-md:  0 4px 20px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.6);
  --shadow-xl:  0 16px 48px rgba(0,0,0,.7);
  --shadow-card-hover: 0 12px 40px rgba(56,189,248,.12);
}

/* ===================================================
   4. إعادة الضبط الأساسية
   =================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--bg-body);
  color: var(--txt-primary);
  line-height: 1.7;
  min-height: 100vh;
  transition: background var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* روابط التخطّي */
.skip-link {
  position: absolute;
  top: -100%;
  right: 0;
  background: var(--clr-primary);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 9999;
  transition: top var(--transition-fast);
  font-weight: 700;
}
.skip-link:focus { top: 0; }

/* ===================================================
   5. مساحة الحاوية
   =================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===================================================
   6. الشريط العلوي (Header)
   =================================================== */
#site-header {
  position: fixed;
  top: 0; right: 0; left: 0;
  height: var(--header-h);
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: height var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

#site-header.header--scrolled {
  height: 62px;
  box-shadow: var(--shadow-md);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

/* الشعار */
.header__logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--txt-primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.header__logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(2,132,199,.3);
  flex-shrink: 0;
}
.header__logo-text span { color: var(--clr-primary); }

/* التنقّل */
#main-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .85rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: .9rem;
  color: var(--txt-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}
.nav__link:hover,
.nav__link[aria-current="page"] {
  background: var(--bg-surface-2);
  color: var(--clr-primary);
}

/* أدوات الشريط */
.header__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.header__icon-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--txt-secondary);
  transition: all var(--transition-fast);
}
.header__icon-btn:hover {
  background: var(--bg-surface-2);
  color: var(--clr-primary);
  border-color: var(--clr-primary);
}

#cart-badge {
  position: absolute;
  top: -6px; left: -6px;
  min-width: 20px; height: 20px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--clr-accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(16,185,129,.4);
  animation: badge-pop .25s ease;
}

@keyframes badge-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* هامبرغر */
#mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--txt-primary);
}

.hamburger__bar {
  display: block;
  width: 20px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
  transform-origin: center;
}

#mobile-menu-toggle.hamburger--open .hamburger__bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
#mobile-menu-toggle.hamburger--open .hamburger__bar:nth-child(2) { opacity: 0; }
#mobile-menu-toggle.hamburger--open .hamburger__bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===================================================
   7. المساحة بعد الشريط
   =================================================== */
.page-offset { padding-top: var(--header-h); }

/* ===================================================
   8. قسم Hero
   =================================================== */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg-body);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .15;
}
.hero__blob--1 {
  width: 600px; height: 600px;
  background: var(--clr-primary);
  top: -150px; right: -100px;
}
.hero__blob--2 {
  width: 400px; height: 400px;
  background: var(--clr-accent);
  bottom: -100px; left: -50px;
}
.hero__blob--3 {
  width: 300px; height: 300px;
  background: var(--clr-purple);
  top: 50%; left: 40%;
  transform: translateY(-50%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 6rem 0 4rem;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .9rem;
  background: rgba(2,132,199,.1);
  border: 1px solid rgba(2,132,199,.2);
  border-radius: var(--radius-pill);
  color: var(--clr-primary);
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}
[data-theme="dark"] .hero__badge {
  background: rgba(56,189,248,.12);
  border-color: rgba(56,189,248,.25);
  color: var(--clr-primary-light);
}

.hero__title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.25;
  color: var(--txt-primary);
  margin-bottom: 1.2rem;
}
.hero__title .highlight {
  color: var(--clr-primary);
  position: relative;
}
.hero__title .highlight::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
  border-radius: var(--radius-pill);
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--txt-secondary);
  margin-bottom: 2rem;
  max-width: 480px;
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.hero__stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero__stat-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--clr-primary);
  line-height: 1;
}
.hero__stat-label {
  font-size: .82rem;
  color: var(--txt-muted);
  margin-top: .25rem;
}

/* صورة Hero */
.hero__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__books-stack {
  position: relative;
  width: 300px;
  height: 380px;
}

.hero__book {
  position: absolute;
  width: 180px;
  height: 240px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-end;
  padding: 1.2rem;
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
  box-shadow: var(--shadow-xl);
  transition: transform var(--transition-slow);
}

.hero__book--1 {
  background: linear-gradient(145deg, #0ea5e9, #0284c7);
  bottom: 0; right: 0;
  transform: rotate(-6deg);
}
.hero__book--2 {
  background: linear-gradient(145deg, #10b981, #059669);
  bottom: 30px; right: 60px;
  transform: rotate(0deg);
  z-index: 2;
}
.hero__book--3 {
  background: linear-gradient(145deg, #8b5cf6, #7c3aed);
  bottom: 10px; right: 120px;
  transform: rotate(5deg);
  z-index: 1;
}

.hero__books-stack:hover .hero__book--1 { transform: rotate(-10deg) translateY(-10px); }
.hero__books-stack:hover .hero__book--2 { transform: translateY(-20px); }
.hero__books-stack:hover .hero__book--3 { transform: rotate(10deg) translateY(-10px); }

/* ===================================================
   9. الأزرار
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-weight: 700;
  font-size: .95rem;
  border: 2px solid transparent;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(.97); }

.btn--primary {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(2,132,199,.35);
}
.btn--primary:hover {
  box-shadow: 0 6px 24px rgba(2,132,199,.5);
  transform: translateY(-2px);
}

.btn--accent {
  background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(16,185,129,.35);
}
.btn--accent:hover {
  box-shadow: 0 6px 24px rgba(16,185,129,.5);
  transform: translateY(-2px);
}

.btn--outline {
  border-color: var(--border);
  background: transparent;
  color: var(--txt-secondary);
}
.btn--outline:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  background: rgba(2,132,199,.06);
}

.btn--ghost {
  background: var(--bg-surface-2);
  color: var(--txt-primary);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--bg-surface-3);
}

.btn--lg { padding: .9rem 2.2rem; font-size: 1.05rem; }
.btn--sm { padding: .45rem 1.1rem; font-size: .85rem; }

/* ===================================================
   10. بطاقات الكليات
   =================================================== */
.section { padding: 5rem 0; }
.section--alt { background: var(--bg-surface-2); }

.section__header {
  text-align: center;
  margin-bottom: 3rem;
}

.section__tag {
  display: inline-block;
  padding: .3rem .9rem;
  border-radius: var(--radius-pill);
  font-size: .8rem;
  font-weight: 700;
  background: rgba(2,132,199,.1);
  color: var(--clr-primary);
  margin-bottom: .8rem;
  letter-spacing: .04em;
}
[data-theme="dark"] .section__tag {
  background: rgba(56,189,248,.12);
  color: var(--clr-primary-light);
}

.section__title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  color: var(--txt-primary);
  margin-bottom: .7rem;
  line-height: 1.3;
}

.section__subtitle {
  font-size: 1.05rem;
  color: var(--txt-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.8;
}

.colleges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.college-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.2rem 2rem;
  text-align: center;
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.college-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 4px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.college-card--dentistry::before { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.college-card--pharmacy::before  { background: linear-gradient(90deg, #10b981, #34d399); }
.college-card--medicine::before  { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.college-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(2,132,199,.25);
}

.college-card__icon {
  width: 70px; height: 70px;
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.2rem;
}

.college-card--dentistry .college-card__icon { background: rgba(14,165,233,.12); }
.college-card--pharmacy  .college-card__icon { background: rgba(16,185,129,.12); }
.college-card--medicine  .college-card__icon { background: rgba(139,92,246,.12); }

.college-card__title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--txt-primary);
  margin-bottom: .5rem;
}

.college-card__desc {
  font-size: .9rem;
  color: var(--txt-muted);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.college-card__badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .85rem;
  border-radius: var(--radius-pill);
  font-size: .82rem;
  font-weight: 700;
}

.college-card--dentistry .college-card__badge { background: rgba(14,165,233,.1); color: #0284c7; }
.college-card--pharmacy  .college-card__badge { background: rgba(16,185,129,.1); color: #059669; }
.college-card--medicine  .college-card__badge { background: rgba(139,92,246,.1); color: #7c3aed; }

[data-theme="dark"] .college-card--dentistry .college-card__badge { color: #38bdf8; }
[data-theme="dark"] .college-card--pharmacy  .college-card__badge { color: #34d399; }
[data-theme="dark"] .college-card--medicine  .college-card__badge { color: #a78bfa; }

/* ===================================================
   11. قسم «لماذا نحن»
   =================================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem 1.8rem;
  transition: all var(--transition-base);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-card__icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: rgba(2,132,199,.1);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.2rem;
  color: var(--clr-primary);
}
[data-theme="dark"] .feature-card__icon { background: rgba(56,189,248,.12); color: var(--clr-primary-light); }

.feature-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--txt-primary);
  margin-bottom: .5rem;
}

.feature-card__text {
  font-size: .9rem;
  color: var(--txt-muted);
  line-height: 1.75;
}

/* ===================================================
   12. شهادات الطلبة
   =================================================== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  transition: all var(--transition-base);
}
.testimonial-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.testimonial-card__quote {
  position: absolute;
  top: 1.5rem; left: 1.5rem;
  font-size: 3.5rem;
  line-height: .8;
  color: var(--clr-primary);
  opacity: .15;
  font-family: Georgia, serif;
  pointer-events: none;
}

.testimonial-card__stars {
  color: #f59e0b;
  font-size: 1rem;
  margin-bottom: 1rem;
  letter-spacing: .1em;
}

.testimonial-card__text {
  font-size: .95rem;
  color: var(--txt-secondary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.testimonial-card__author {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.testimonial-card__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  color: #fff;
  flex-shrink: 0;
}

.testimonial-card__name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--txt-primary);
}
.testimonial-card__college {
  font-size: .82rem;
  color: var(--txt-muted);
}

/* ===================================================
   13. بطاقة الكتاب
   =================================================== */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
  height: 100%;
}
.book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(2,132,199,.2);
}

.book-card__cover {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.book-card__initials {
  font-size: 2.2rem;
  font-weight: 900;
  color: rgba(255,255,255,.9);
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
  z-index: 1;
  position: relative;
}

.book-card__shine {
  position: absolute;
  top: -50%;
  right: -50%;
  width: 60%;
  height: 140%;
  background: linear-gradient(
    to bottom right,
    rgba(255,255,255,.18) 0%,
    transparent 60%
  );
  transform: rotate(-20deg);
  pointer-events: none;
}

.book-card__body {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-card__meta {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}

.book-card__college,
.book-card__stage {
  display: inline-block;
  padding: .18rem .6rem;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 700;
}

.book-card__college {
  background: rgba(2,132,199,.1);
  color: var(--clr-primary);
}
[data-theme="dark"] .book-card__college { background: rgba(56,189,248,.12); color: var(--clr-primary-light); }

.book-card__stage {
  background: var(--bg-surface-2);
  color: var(--txt-muted);
}

.book-card__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--txt-primary);
  margin-bottom: .2rem;
  line-height: 1.4;
}

.book-card__en {
  font-size: .78rem;
  color: var(--txt-light);
  margin-bottom: .6rem;
  font-style: italic;
}

.book-card__desc {
  font-size: .85rem;
  color: var(--txt-muted);
  line-height: 1.65;
  flex: 1;
  /* إخفاء أكثر من 3 أسطر */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.book-card__price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--clr-primary);
  white-space: nowrap;
}
[data-theme="dark"] .book-card__price { color: var(--clr-primary-light); }

.btn-add-cart {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-weight: 700;
  font-size: .82rem;
  border: 2px solid var(--clr-primary);
  background: transparent;
  color: var(--clr-primary);
  transition: all var(--transition-base);
  white-space: nowrap;
}
.btn-add-cart:hover {
  background: var(--clr-primary);
  color: #fff;
}
.btn-add-cart--added {
  background: rgba(16,185,129,.1);
  border-color: var(--clr-accent);
  color: var(--clr-accent);
}
.btn-add-cart--added:hover {
  background: var(--clr-accent);
  color: #fff;
  border-color: var(--clr-accent);
}

/* ===================================================
   14. شريط الفلترة والبحث
   =================================================== */
.filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-input-wrap svg {
  position: absolute;
  top: 50%; right: 1rem;
  transform: translateY(-50%);
  color: var(--txt-muted);
  pointer-events: none;
}

.filter-bar input[type="search"],
.filter-bar select {
  width: 100%;
  padding: .65rem 2.8rem .65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-body);
  color: var(--txt-primary);
  font-family: inherit;
  font-size: .92rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  direction: rtl;
}

.filter-bar input[type="search"]::placeholder { color: var(--txt-light); }

.filter-bar input[type="search"]:focus,
.filter-bar select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2,132,199,.15);
}

.filter-bar select {
  padding-right: 1rem;
  cursor: pointer;
  min-width: 160px;
  flex: 0;
}

/* ===================================================
   15. التبويبات (Tabs)
   =================================================== */
.tabs {
  margin-bottom: 2rem;
}

.tabs__list {
  display: flex;
  gap: .4rem;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  padding-bottom: 0;
  scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }

.tabs__btn {
  flex-shrink: 0;
  padding: .7rem 1.3rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-family: inherit;
  font-weight: 700;
  font-size: .9rem;
  background: transparent;
  border: none;
  color: var(--txt-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}
.tabs__btn:hover { color: var(--clr-primary); background: var(--bg-surface-2); }
.tabs__btn--active {
  color: var(--clr-primary);
  border-bottom-color: var(--clr-primary);
  background: var(--bg-surface);
}

.tabs__panel { display: none; }
.tabs__panel--active { display: block; }

/* ===================================================
   16. صفحة السلة
   =================================================== */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
}

.cart-empty {
  text-align: center;
  padding: 5rem 2rem;
}

.cart-empty__icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: .4;
}

.cart-empty__title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--txt-primary);
  margin-bottom: .5rem;
}

.cart-empty__text {
  color: var(--txt-muted);
  margin-bottom: 2rem;
}

.cart-items {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: var(--bg-surface-2); }

.cart-item__cover {
  width: 50px; height: 66px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: .9rem;
  color: rgba(255,255,255,.9);
}

.cart-item__info { flex: 1; }
.cart-item__title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--txt-primary);
  margin-bottom: .2rem;
}
.cart-item__meta {
  font-size: .82rem;
  color: var(--txt-muted);
}

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--txt-primary);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.qty-btn:hover { background: var(--clr-primary); color: #fff; border-color: var(--clr-primary); }

.qty-value {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
}

.cart-item__price {
  font-weight: 800;
  font-size: 1rem;
  color: var(--clr-primary);
  white-space: nowrap;
}
[data-theme="dark"] .cart-item__price { color: var(--clr-primary-light); }

.cart-item__remove {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--txt-light);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.cart-item__remove:hover { background: rgba(239,68,68,.1); color: #ef4444; border-color: rgba(239,68,68,.2); }

/* بطاقة الملخص */
.cart-summary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.cart-summary__title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--txt-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .95rem;
  padding: .4rem 0;
  color: var(--txt-secondary);
}

.cart-summary__row--total {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--txt-primary);
  padding-top: 1rem;
  margin-top: .5rem;
  border-top: 2px solid var(--border);
}

.cart-summary__total-price {
  color: var(--clr-primary);
  font-size: 1.3rem;
}
[data-theme="dark"] .cart-summary__total-price { color: var(--clr-primary-light); }

.cart-summary__note {
  font-size: .82rem;
  color: var(--txt-muted);
  margin-top: 1rem;
  padding: .85rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  line-height: 1.7;
}

/* نموذج الطلب */
.order-form {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-top: 2rem;
}

.order-form__title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--txt-primary);
  margin-bottom: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.form-group--full { grid-column: 1 / -1; }

.form-group label {
  font-size: .88rem;
  font-weight: 700;
  color: var(--txt-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: .65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  color: var(--txt-primary);
  font-size: .92rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  direction: rtl;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2,132,199,.15);
}

.form-group textarea { resize: vertical; min-height: 80px; }

/* ===================================================
   17. الفوتر
   =================================================== */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 4rem 0 0;
  margin-top: auto;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer__brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--txt-primary);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.footer__brand-desc {
  font-size: .9rem;
  color: var(--txt-muted);
  line-height: 1.8;
  margin-bottom: 1.2rem;
}

.footer__social {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.footer__social-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--txt-muted);
  transition: all var(--transition-fast);
  font-size: .85rem;
}
.footer__social-btn:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  background: rgba(2,132,199,.06);
}

.footer__col-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--txt-primary);
  margin-bottom: 1.2rem;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.footer__link {
  font-size: .9rem;
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: color var(--transition-fast);
}
.footer__link:hover { color: var(--clr-primary); }

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  font-size: .9rem;
  color: var(--txt-muted);
  margin-bottom: .85rem;
  line-height: 1.6;
}

.footer__contact-item svg {
  color: var(--clr-primary);
  flex-shrink: 0;
  margin-top: .15rem;
}

.footer__bottom {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .85rem;
  color: var(--txt-muted);
}

/* ===================================================
   18. صفحة «من نحن» والـ FAQ والتواصل
   =================================================== */
.page-hero {
  background: linear-gradient(135deg, rgba(2,132,199,.08) 0%, rgba(16,185,129,.08) 100%);
  border-bottom: 1px solid var(--border);
  padding: 4rem 0 3rem;
  text-align: center;
}
[data-theme="dark"] .page-hero {
  background: linear-gradient(135deg, rgba(56,189,248,.06) 0%, rgba(52,211,153,.06) 100%);
}

.page-hero__title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 900;
  color: var(--txt-primary);
  margin-bottom: .8rem;
}

.page-hero__subtitle {
  font-size: 1.05rem;
  color: var(--txt-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.8;
}

/* FAQ */
.faq-list { max-width: 760px; margin: 0 auto; }

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: .85rem;
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}
.faq-item:hover { box-shadow: var(--shadow-sm); }

.faq-item__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 1.5rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--txt-primary);
  text-align: right;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.faq-item__btn:hover { background: var(--bg-surface-2); }

.faq-item__icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(2,132,199,.1);
  color: var(--clr-primary);
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition-base), background var(--transition-base);
}
[data-theme="dark"] .faq-item__icon { background: rgba(56,189,248,.12); color: var(--clr-primary-light); }

.faq-item--open .faq-item__icon { transform: rotate(45deg); background: var(--clr-primary); color: #fff; }

.faq-item__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), padding var(--transition-base);
}

.faq-item--open .faq-item__body { max-height: 500px; }

.faq-item__text {
  padding: 0 1.5rem 1.3rem;
  font-size: .95rem;
  color: var(--txt-muted);
  line-height: 1.8;
}

/* صفحة التواصل */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.contact-method {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
}
.contact-method:last-child { border-bottom: none; }

.contact-method__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.contact-method__label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--txt-muted);
  margin-bottom: .2rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.contact-method__value {
  font-size: .95rem;
  font-weight: 600;
  color: var(--txt-primary);
}

/* ===================================================
   19. Toast Notifications
   =================================================== */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1.2rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  font-weight: 600;
  color: var(--txt-primary);
  max-width: 320px;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.toast--show {
  opacity: 1;
  transform: translateX(0);
}

.toast__icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.toast--success .toast__icon { background: rgba(16,185,129,.15); color: var(--clr-accent); }
.toast--error   .toast__icon { background: rgba(239,68,68,.15); color: #ef4444; }
.toast--info    .toast__icon { background: rgba(2,132,199,.15); color: var(--clr-primary); }

/* ===================================================
   20. بطل صفحة الكلية (مبسّط)
   =================================================== */
.college-page-hero {
  padding: 3.5rem 0 2.5rem;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border);
}

.college-page-hero__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.college-page-hero__icon {
  width: 72px; height: 72px;
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  flex-shrink: 0;
}

.college-page-hero__title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 900;
  color: var(--txt-primary);
}

.college-page-hero__subtitle {
  font-size: .95rem;
  color: var(--txt-muted);
  margin-top: .3rem;
}

/* ===================================================
   21. شريط إتمام الطلب (WhatsApp CTA)
   =================================================== */
.whatsapp-cta {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.6rem;
  border-radius: var(--radius-pill);
  background: #25D366;
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  border: none;
  font-family: inherit;
  transition: all var(--transition-base);
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
}
.whatsapp-cta:hover {
  background: #1aab52;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37,211,102,.4);
}

/* ===================================================
   22. صفحة 404
   =================================================== */
.page-404 {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem;
}

.page-404__code {
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .5rem;
}

.page-404__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--txt-primary);
  margin-bottom: .8rem;
}

.page-404__text {
  color: var(--txt-muted);
  margin-bottom: 2.5rem;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
}

/* ===================================================
   23. تحريكات ظهور (Scroll Animations)
   =================================================== */
.animate {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}
.animate--in {
  opacity: 1;
  transform: translateY(0);
}
.animate--delay-1 { transition-delay: .1s; }
.animate--delay-2 { transition-delay: .2s; }
.animate--delay-3 { transition-delay: .3s; }
.animate--delay-4 { transition-delay: .4s; }

/* ===================================================
   24. عداد الكتب في الكلية
   =================================================== */
.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.stage-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--txt-primary);
}

.stage-count {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .8rem;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-2);
  font-size: .82rem;
  font-weight: 700;
  color: var(--txt-muted);
}

/* ===================================================
   25. زر العودة للأعلى
   =================================================== */
#back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  background: var(--clr-primary);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(2,132,199,.4);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 500;
  font-family: inherit;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
#back-to-top:hover {
  background: var(--clr-primary-dark);
  transform: translateY(-3px);
}

/* ===================================================
   26. شارة «دفع عند الاستلام»
   =================================================== */
.cod-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .9rem;
  border-radius: var(--radius-pill);
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.25);
  color: var(--clr-accent-dark);
  font-size: .82rem;
  font-weight: 700;
}
[data-theme="dark"] .cod-badge { color: var(--clr-accent-light); background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.2); }

/* ===================================================
   27. مكوّن البحث (شريط الفلترة)
   =================================================== */
.results-count {
  padding: .5rem 0 1rem;
  font-size: .9rem;
  color: var(--txt-muted);
}

.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--txt-muted);
}
.no-results__icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.no-results__title { font-size: 1.2rem; font-weight: 700; color: var(--txt-primary); margin-bottom: .4rem; }

/* ===================================================
   28. استجابة الموبايل
   =================================================== */
@media (max-width: 1024px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__subtitle { margin: 0 auto 2rem; }
  .hero__stats { justify-content: center; }
  .hero__actions { justify-content: center; }
  .hero__visual { display: none; }
}

@media (max-width: 768px) {
  :root { --header-h: 62px; }

  #main-nav {
    position: fixed;
    top: var(--header-h); right: 0; left: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: .25rem;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 999;
  }
  #main-nav.nav--open { display: flex; }

  .nav__link {
    padding: .75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
  }

  #mobile-menu-toggle { display: flex; }

  .colleges-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero__stats { flex-wrap: wrap; gap: 1.5rem; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

  .cart-summary {
    position: static;
  }

  .section { padding: 3.5rem 0; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .books-grid { grid-template-columns: 1fr 1fr; }
  .hero__title { font-size: 1.75rem; }
  .filter-bar { flex-direction: column; }
  .filter-bar select { min-width: 100%; width: 100%; }
}

@media (max-width: 360px) {
  .books-grid { grid-template-columns: 1fr; }
}

/* ===================================================
   29. تحسين الطباعة
   =================================================== */
@media print {
  #site-header, #back-to-top, #toast-container, .header__actions { display: none; }
  .page-offset { padding-top: 0; }
  body { background: #fff; color: #000; }
}

/* ===================================================
   30. حالة التركيز (Accessibility)
   =================================================== */
:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===================================================
   31. شريط التقدم (اختياري للمستقبل)
   =================================================== */
.progress-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
  position: fixed;
  top: 0; right: 0;
  z-index: 9999;
  transition: width var(--transition-fast);
}
