:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #14142b;
  --muted: #6b6b85;
  --border: #e7e7f0;
  --primary: #4f46e5;
  --primary-2: #9333ea;
  --wa: #25d366;
  --wa-dark: #128c7e;
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(30, 27, 75, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Tajawal", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { max-width: 100%; display: block; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(800px, 100% - 32px); }
.section { padding: 80px 0 40px; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 900; }
.section-head p { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 14px; border: 0; cursor: pointer;
  font-weight: 700; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 24px -10px rgba(79, 70, 229, .6);
}
.btn-ghost { background: var(--surface); border: 1px solid var(--border); }
.btn-ghost svg { color: var(--wa-dark); }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 12px 24px -10px rgba(37, 211, 102, .7); }
.btn-wa:hover { background: #1fbe5a; }
.full { width: 100%; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 247, 251, .8); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231, 231, 240, .7);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.35rem; }
.logo-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); font-size: 1.2rem;
}
.nav-links { display: flex; gap: 28px; font-weight: 500; color: var(--muted); }
.nav-links a:hover { color: var(--primary); }
.cart-btn {
  position: relative; width: 46px; height: 46px; border-radius: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  display: grid; place-items: center; transition: .2s;
}
.cart-btn:hover { border-color: var(--primary); color: var(--primary); }
.cart-count {
  position: absolute; top: -6px; left: -6px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 99px; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 700;
  display: grid; place-items: center; transition: transform .25s;
}
.cart-count.bump { transform: scale(1.35); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 70px 0 60px; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .45; z-index: -1; }
.b1 { width: 420px; height: 420px; background: #a5b4fc; top: -120px; right: -100px; }
.b2 { width: 380px; height: 380px; background: #f0abfc; bottom: -160px; left: -60px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.pill {
  display: inline-block; padding: 6px 14px; border-radius: 99px; font-size: .9rem; font-weight: 500;
  background: #eef2ff; color: var(--primary); margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.2; font-weight: 900; }
.grad { background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-text > p { color: var(--muted); font-size: 1.15rem; margin: 18px 0 28px; max-width: 480px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.stats { display: flex; gap: 36px; margin-top: 40px; }
.stats div { display: flex; flex-direction: column; }
.stats strong { font-size: 1.6rem; font-weight: 900; }
.stats span { color: var(--muted); font-size: .9rem; }

.hero-visual { position: relative; height: 400px; }
.book {
  position: absolute; width: 190px; height: 250px; border-radius: 10px 20px 20px 10px;
  display: flex; flex-direction: column; justify-content: space-between; padding: 22px; color: #fff;
  box-shadow: -10px 20px 40px -10px rgba(0,0,0,.35), inset 8px 0 0 rgba(0,0,0,.15);
  animation: float 6s ease-in-out infinite;
}
.book span { font-size: 3rem; font-weight: 900; }
.book em { font-style: normal; font-weight: 800; font-size: 1.3rem; }
.bk1 { background: linear-gradient(150deg, #6366f1, #4338ca); top: 20px; right: 40px; transform: rotate(-8deg); }
.bk2 { background: linear-gradient(150deg, #06b6d4, #0e7490); top: 90px; right: 190px; z-index: 2; animation-delay: -2s; }
.bk3 { background: linear-gradient(150deg, #22c55e, #15803d); top: 160px; right: 60px; z-index: 3; animation-delay: -4s; }
@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: .25s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.f-ico { font-size: 1.8rem; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: #f3f0ff; margin-bottom: 12px; }
.feature h3 { font-size: 1.1rem; }
.feature p { color: var(--muted); font-size: .95rem; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-direction: column; gap: 16px; margin-bottom: 30px; }
.search {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: 0 16px; color: var(--muted);
  max-width: 520px; width: 100%; margin-inline: auto; transition: .2s;
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px #eef2ff; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; padding: 14px 0; color: var(--text); }
.chips {
  display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 760px; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
}
.chip-group { display: flex; align-items: center; gap: 12px; }
.chip-group + .chip-group { padding-top: 10px; border-top: 1px dashed var(--border); }
.chip-label { flex: 0 0 70px; font-weight: 800; font-size: .9rem; color: var(--primary); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.result-title { font-size: 1.25rem; font-weight: 900; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.result-title span { font-size: .8rem; font-weight: 700; color: var(--primary); background: #eef2ff; padding: 3px 12px; border-radius: 99px; }
.chip {
  padding: 8px 18px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-weight: 500; color: var(--muted); transition: .2s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- Product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .3s;
  animation: fadeUp .45s both;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } }
.cover {
  position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; color: #fff; overflow: hidden;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.25), transparent 50%);
}
.cover-icon { font-size: 4rem; font-weight: 900; text-shadow: 0 6px 20px rgba(0,0,0,.2); }
.cover-subject { position: absolute; bottom: 14px; right: 16px; font-weight: 800; font-size: 1.1rem; opacity: .95; }
.badge {
  position: absolute; top: 14px; left: 14px; z-index: 1; padding: 4px 12px; border-radius: 99px;
  background: #fff; color: var(--text); font-size: .8rem; font-weight: 700;
}
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; }
.meta span { background: var(--bg); color: var(--muted); padding: 2px 10px; border-radius: 99px; }
.card h3 { font-size: 1.15rem; font-weight: 800; }
.card .desc { color: var(--muted); font-size: .92rem; flex: 1; }
.teacher { font-size: .88rem; color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 10px; }
.price { display: flex; flex-direction: column; line-height: 1.3; }
.price strong { font-size: 1.2rem; font-weight: 900; color: var(--primary); white-space: nowrap; }
.price del { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.add-btn {
  padding: 10px 16px; border-radius: 12px; border: 0; cursor: pointer; font-weight: 700;
  background: #eef2ff; color: var(--primary); transition: .2s; white-space: nowrap;
}
.add-btn:hover { background: var(--primary); color: #fff; }
.add-btn.added { background: #dcfce7; color: #15803d; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 1.1rem; }

/* ---------- Steps ---------- */
.how { background: linear-gradient(180deg, transparent, #eef2ff 30%, #eef2ff 70%, transparent); padding-bottom: 80px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--surface); border-radius: var(--radius); padding: 30px; text-align: center; box-shadow: var(--shadow); }
.num {
  display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  font-weight: 900; font-size: 1.3rem; margin-bottom: 12px;
}
.step p { color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); transition: .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin-top: 10px; }

/* ---------- CTA ---------- */
.cta {
  margin: 60px 0; padding: 44px; border-radius: 26px; color: #fff;
  background: linear-gradient(135deg, #075e54, #128c7e 60%, #25d366);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 900; }
.cta p { opacity: .9; }
.cta .btn-wa { background: #fff; color: var(--wa-dark); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 30px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer p { color: var(--muted); font-size: .9rem; }
.credit {
  display: flex; justify-content: center; margin-top: 22px; padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.credit-link {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px;
  border-radius: 99px; background: var(--surface); border: 1px solid var(--border);
  font-size: .9rem; color: var(--muted); transition: .25s;
}
.credit-link:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.credit-brand {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 99px;
  background: linear-gradient(135deg, #0f172a, #1e3a8a); color: #fff; font-weight: 800;
}
.credit-logo { width: 30px; height: 30px; border-radius: 50%; background: #fff; object-fit: cover; flex-shrink: 0; }
.credit-name { display: flex; flex-direction: column; line-height: 1.1; }
.credit-name b { font-weight: 800; font-size: .92rem; }
.credit-name small { font-size: .55rem; letter-spacing: .18em; opacity: .65; font-weight: 500; }
.socials { display: flex; gap: 10px; }
.socials a { padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: .9rem; }
.socials a:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Floating WA ---------- */
.wa-float {
  position: fixed; bottom: 22px; left: 22px; z-index: 30; width: 60px; height: 60px; border-radius: 50%;
  background: var(--wa); display: grid; place-items: center; box-shadow: 0 10px 25px rgba(37,211,102,.5);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,.55); }
  70% { box-shadow: 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* ---------- Drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 15, 35, .45); opacity: 0; pointer-events: none; transition: .3s; z-index: 50; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(420px, 100%); background: var(--surface); z-index: 60;
  display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
body.cart-open .overlay { opacity: 1; pointer-events: auto; }
body.cart-open .drawer { transform: none; }
body.cart-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-weight: 900; font-size: 1.25rem; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: transparent; cursor: pointer; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 12px; }
.cart-empty { text-align: center; color: var(--muted); margin: auto; }
.cart-empty div { font-size: 3rem; }
.ci { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 14px; }
.ci-cover { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 1.4rem; flex-shrink: 0; }
.ci-info { flex: 1; min-width: 0; }
.ci-info h4 { font-size: .95rem; }
.ci-info small { color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; font-weight: 700; }
.qty span { min-width: 18px; text-align: center; font-weight: 700; }
.drawer-foot { padding: 18px 22px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
.field input { padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border); outline: 0; color: var(--text); }
.field input:focus { border-color: var(--primary); }
.total { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.total strong { font-size: 1.35rem; color: var(--primary); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 30px; right: 50%; transform: translate(50%, 120px); z-index: 70;
  background: var(--text); color: #fff; padding: 12px 22px; border-radius: 12px; font-weight: 500;
  transition: transform .35s; pointer-events: none;
}
.toast.show { transform: translate(50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-text > p { margin-inline: auto; }
  .hero-actions, .stats { justify-content: center; }
  .hero-visual { display: none; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 520px) {
  .features { grid-template-columns: 1fr 1fr; gap: 10px; }
  .feature { padding: 16px; }
  .chip-group { flex-direction: column; align-items: flex-start; gap: 6px; }
  .chip-label { flex: none; }
  .chip { padding: 6px 14px; font-size: .9rem; }
  .stats { gap: 22px; }
  .cta { padding: 30px 22px; text-align: center; justify-content: center; }
  .footer-inner { justify-content: center; text-align: center; }
}
