:root {
  --purple: #8c2f99;
  --purple-dark: #6b2276;
  --ink: #1c1220;
  --muted: #6b5b72;
  --line: #eadff0;
  --bg: #faf7fb;
  --card: #fff;
  --ok: #0f7a4a;
  --warn: #b45309;
  --bad: #b42318;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Tajawal", "IBM Plex Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.topbar {
  background: var(--purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  font-size: 14px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar a, .topbar button { color: #fff; background: none; border: 0; cursor: pointer; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.drop { position: relative; }
.drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  background: #fff;
  color: var(--ink);
  min-width: 210px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(40, 10, 50, .18);
  padding: 8px;
  z-index: 50;
}
.drop.open .drop-menu { display: block; }
.drop-menu button, .drop-menu a {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  border-radius: 8px;
}
.drop-menu button:hover { background: #f6eef8; }
.header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; }
.brand .mark-img {
  width: 36px; height: 36px; border-radius: 10px;
  background: #faf4fc;
}
.search {
  display: flex; background: #f4eef6; border-radius: 999px; overflow: hidden;
}
.search input { flex: 1; border: 0; background: transparent; padding: 12px 16px; outline: none; }
.search button { border: 0; background: var(--purple); color: #fff; padding: 0 18px; cursor: pointer; }
.header-right { display: flex; gap: 14px; align-items: center; }
.cart-link { position: relative; }
.badge-count {
  position: absolute; top: -8px; inset-inline-end: -10px;
  background: var(--purple); color: #fff; border-radius: 99px;
  font-size: 11px; min-width: 18px; height: 18px; display: grid; place-items: center;
}
.nav {
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; gap: 8px; padding: 8px 20px; overflow-x: auto;
}
.nav a { white-space: nowrap; padding: 8px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; }
.nav a.active, .nav a:hover { background: #f6eef8; color: var(--purple); }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 24px auto; }
.hero {
  background: linear-gradient(135deg, #8c2f99, #c15bc8);
  color: #fff; border-radius: 24px; padding: 40px 32px;
  display: grid; gap: 10px;
}
.hero h1 { margin: 0; font-size: clamp(26px, 4vw, 42px); }
.hero p { margin: 0; opacity: .92; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--purple); color: #fff; border: 0; border-radius: 999px;
  padding: 11px 18px; cursor: pointer; font-weight: 700;
}
.btn.ghost { background: #fff; color: var(--purple); }
.btn.line { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.thumb {
  height: 170px; display: grid; place-items: center;
  background: linear-gradient(180deg, #f3e6f6, #fff);
  font-size: 42px; overflow: hidden;
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card .body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
.price { font-weight: 800; color: var(--purple); }
.old { text-decoration: line-through; color: #9a8aa0; font-weight: 500; margin-inline-start: 6px; }
.chip { display: inline-block; background: #f3e6f6; color: var(--purple); border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.section-title { display: flex; justify-content: space-between; align-items: end; margin: 28px 0 14px; }
.footer { background: #1c1220; color: #f5eef7; margin-top: 48px; padding: 32px 20px; }
.footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; }
.footer a { color: #e6d6ee; }
.flash { background: #fff7e8; border: 1px solid #f3d19a; color: #7a4b00; padding: 10px 14px; border-radius: 12px; margin: 12px 0; }
.form { display: grid; gap: 10px; }
.form input, .form select, .form textarea {
  width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.product-page { display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px; }
.otp-box { font-family: ui-monospace, monospace; font-size: 32px; letter-spacing: .35em; text-align: center; padding: 16px; background: #f6eef8; border-radius: 16px; }
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: #1c1220; color: #fff; padding: 20px; }
.side a { display: block; padding: 10px 12px; border-radius: 10px; color: #e9d7f0; margin-bottom: 4px; }
.side a.on, .side a:hover { background: var(--purple); color: #fff; }
.main { padding: 22px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 16px; overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; font-size: 14px; }
.panel { background: #fff; border: 1px solid #e4c8ef; border-radius: 18px; padding: 16px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.copy { font-size: 11px; color: var(--purple); cursor: pointer; background: none; border: 0; }
@media (max-width: 800px) {
  .header, .product-page, .admin, .footer .wrap, .two { grid-template-columns: 1fr; }
  .side { display: flex; gap: 8px; overflow: auto; }
}
