@import url('https://fonts.googleapis.com/css2?family=Aref+Ruqaa:wght@400;700&display=swap');
:root {
  --bg: #141414;
  --bg-soft: #1c1c1c;
  --card: #202020;
  --border: #303030;
  --gold: #c9a35a;
  --gold-light: #e0c384;
  --text: #f2f0ea;
  --text-muted: #a8a49a;
  --danger: #d9534f;
  --success: #4caf7d;
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.6;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header.site-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
}
.logo {
    font-family: 'Aref Ruqaa', serif;
    font-size: 21px;
    font-weight: 700;
  color: var(--gold-light);
    letter-spacing: 0;
  white-space: nowrap;
}
nav.main-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
nav.main-nav a {
  color: var(--text-muted);
  font-size: 14px;
  transition: color .15s;
}
nav.main-nav a:hover, nav.main-nav a.active { color: var(--gold-light); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.icon-btn {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.icon-btn:hover { border-color: var(--gold); }
.badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--gold);
  color: #1a1a1a;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.user-chip {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
  padding: 60px 0;
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.hero-text { flex: 1 1 380px; }
.hero-text h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 16px;
}
.hero-text h1 span { color: var(--gold-light); }
.hero-text p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 26px;
  max-width: 480px;
}
.hero-media {
  flex: 1 1 380px;
  min-height: 260px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 90px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 14px;
  transition: transform .12s, opacity .12s;
}
.btn:active { transform: scale(.97); }
.btn-gold { background: var(--gold); color: #1a1508; }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold-light); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }

/* Section titles */
.section {
  padding: 50px 0;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}
.section-title h2 {
  font-size: 24px;
  margin: 0;
}
.section-title h2 span { color: var(--gold-light); }

/* Category chips */
.cat-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.cat-chip {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font-size: 13px;
}
.cat-chip.active, .cat-chip:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
  gap: 22px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.product-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.product-thumb {
  aspect-ratio: 1 / 1;
  background: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.product-cat { font-size: 7px; color: var(--gold-light); }
.product-name { font-size: 9px; font-weight: 700; margin: 0; }
.product-desc { font-size: 7px; color: var(--text-muted); flex: 1; }
.product-price { font-size: 10px; font-weight: 800; color: var(--gold-light); }
.product-actions { display: flex; gap: 5px; margin-top: 4px; }
    .product-actions .btn { padding: 6px 12px; font-size: 9px; gap: 4px; }

/* Forms */
.auth-wrap {
  max-width: 420px;
  margin: 70px auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
}
.auth-wrap h2 { margin-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #141414;
  color: var(--text);
  font-size: 14px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.form-msg { font-size: 13px; margin-bottom: 12px; padding: 10px 14px; border-radius: var(--radius-sm); }
.form-msg.error { background: rgba(217,83,79,.12); color: #ef8b88; }
.form-msg.success { background: rgba(76,175,125,.12); color: #7fd6ab; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-switch a { color: var(--gold-light); font-weight: 700; }

/* Cart page */
.cart-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 800px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-item {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
}
.cart-item img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; background: #0f0f0f; }
.cart-item .info { flex: 1; }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-control button {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent; color: var(--text);
}
.summary-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; color: var(--text-muted); }
.summary-row.total { color: var(--text); font-size: 18px; font-weight: 800; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }

/* Orders */
.order-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
}
.order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.status-pill { padding: 4px 12px; border-radius: 999px; font-size: 12px; background: rgba(201,163,90,.15); color: var(--gold-light); }
.order-item-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); padding: 4px 0; }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--bg-soft);
  border-left: 1px solid var(--border);
  padding: 24px 16px;
}
.admin-sidebar .logo { display: block; margin-bottom: 30px; }
.admin-sidebar a {
  display: block;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 4px;
}
.admin-sidebar a.active, .admin-sidebar a:hover { background: var(--card); color: var(--gold-light); }
.admin-main { padding: 30px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--gold-light); }
.stat-card .label { font-size: 13px; color: var(--text-muted); }

table.data-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.data-table th, table.data-table td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--border); font-size: 13px; }
table.data-table th { color: var(--text-muted); background: #191919; font-weight: 700; }
table.data-table img { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
}

.toast-wrap { position: fixed; bottom: 24px; left: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--card); border: 1px solid var(--gold);
  color: var(--text); padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.4);
}

/* Footer */
footer.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 13px;
}
.footer-cols { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; margin-bottom: 24px; }
.footer-cols h4 { color: var(--text); margin: 0 0 12px; font-size: 14px; }
.footer-cols a { display: block; margin-bottom: 8px; color: var(--text-muted); }
.footer-bottom { text-align: center; border-top: 1px solid var(--border); padding-top: 16px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
