:root {
  --primary: #0B3D91;   /* أزرق - اللون المهيمن (~50%) */
  --accent: #C8102E;    /* أحمر */
  --bg: #FFFFFF;        /* أبيض */
  --text: #1a1a1a;
  --muted: #6b7280;
  --radius: 10px;
  --font: 'Cairo', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
[dir="rtl"] body { text-align: right; }

a { color: var(--primary); text-decoration: none; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.site-header .top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1140px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.3rem; color: #fff; }
.brand img { height: 40px; }
.nav-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.nav-links a { color: #fff; font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent); }
.lang-switch select, .lang-switch a {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { opacity: 0.9; }
.btn-outline {
  background: transparent;
  border: 2px solid #fff;
  color: #fff !important;
}
.btn-secondary { background: var(--primary); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #072a66 100%);
  color: #fff;
  padding: 80px 20px;
  text-align: center;
  background-size: cover;
  background-position: center;
}
.hero h1 { font-size: 2.4rem; margin-bottom: 15px; }
.hero p { font-size: 1.15rem; opacity: 0.95; max-width: 640px; margin: 0 auto 30px; }
.hero .actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
section { padding: 60px 0; }
.section-title { text-align: center; font-size: 1.8rem; margin-bottom: 40px; color: var(--primary); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}
.service-card {
  border: 1px solid #eee;
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  border-top: 4px solid var(--primary);
}
.service-card:nth-child(odd) { border-top-color: var(--accent); }
.service-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.service-card .icon { font-size: 2.2rem; margin-bottom: 12px; }

.steps { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.step { flex: 1; min-width: 200px; text-align: center; }
.step .num {
  width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-weight: 700;
}

/* ---------- Forms ---------- */
.form-card {
  max-width: 520px;
  margin: 50px auto;
  padding: 36px;
  border: 1px solid #eee;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}
.form-card.wide { max-width: 780px; }
.form-card h2 { color: var(--primary); margin-bottom: 22px; text-align: center; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}
.field .hint { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.field.readonly input { background: #f3f4f6; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.error-box { background: #fdecea; color: var(--accent); padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; }
.success-box { background: #e8f5e9; color: #1b5e20; padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; }

/* ---------- Cost box ---------- */
.cost-box { background: #f7f9fc; border: 1px dashed var(--primary); border-radius: 10px; padding: 20px; margin-top: 20px; }
.cost-row { display: flex; justify-content: space-between; padding: 4px 0; }
.cost-row.total { font-weight: 700; font-size: 1.2rem; color: var(--accent); border-top: 1px solid #ddd; margin-top: 8px; padding-top: 10px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: start; font-size: 0.9rem; }
th { background: var(--primary); color: #fff; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; color: #fff; background: var(--muted); }
.badge.confirmed, .badge.delivered { background: #2e7d32; }
.badge.pending_payment { background: var(--accent); }
.badge.in_transit, .badge.processing { background: var(--primary); }
.badge.cancelled, .badge.returned { background: #757575; }

/* ---------- Footer ---------- */
.site-footer { background: #0a2e6e; color: #dbe4f5; padding: 50px 0 20px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 30px; }
.footer-grid h4 { color: #fff; margin-bottom: 12px; }
.footer-grid a { color: #dbe4f5; display: block; margin-bottom: 8px; font-size: 0.9rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; color: #9fb1d6; }
.social-icons { display: flex; gap: 12px; }
.social-icons a { background: rgba(255,255,255,0.1); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* ---------- WhatsApp float button ---------- */
.wa-float {
  position: fixed; bottom: 24px; inset-inline-end: 24px;
  background: #25D366; color: #fff; width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25); z-index: 999;
}

/* ---------- Live chat widget ---------- */
.livechat-toggle {
  position: fixed; bottom: 94px; inset-inline-end: 24px;
  background: var(--primary); color: #fff; width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25); z-index: 999; border: none;
}
.livechat-box {
  position: fixed; bottom: 160px; inset-inline-end: 24px; width: 300px; max-height: 400px;
  background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); z-index: 999;
  display: none; flex-direction: column; overflow: hidden;
}
.livechat-box.open { display: flex; }
.livechat-header { background: var(--primary); color: #fff; padding: 12px 16px; font-weight: 600; }
.livechat-messages { flex: 1; padding: 12px; overflow-y: auto; font-size: 0.85rem; }
.livechat-input { display: flex; border-top: 1px solid #eee; }
.livechat-input input { flex: 1; border: none; padding: 10px; font-family: inherit; }
.livechat-input button { border: none; background: var(--accent); color: #fff; padding: 0 16px; cursor: pointer; }

/* ---------- Admin ---------- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: #0a2e6e; color: #fff; padding: 24px 0; flex-shrink: 0; }
.admin-sidebar a { display: block; color: #dbe4f5; padding: 12px 24px; font-size: 0.92rem; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.1); color: #fff; }
.admin-main { flex: 1; padding: 30px; background: #f4f6fa; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 18px; margin-bottom: 30px; }
.stat-card { background: #fff; border-radius: 10px; padding: 22px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-inline-start: 5px solid var(--primary); }
.stat-card .value { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-card:nth-child(2n) { border-inline-start-color: var(--accent); }
.color-swatch { width: 28px; height: 28px; border-radius: 6px; display: inline-block; vertical-align: middle; border: 1px solid #ccc; }
.qr-box { text-align: center; padding: 16px; }
.qr-box img { width: 160px; height: 160px; }
