:root {
  --bg-gradient: radial-gradient(circle at 50% 0%, #064e3b 0%, #022c22 40%, #020617 100%);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-blur: blur(20px);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --emerald-accent: #10b981;
  --emerald-hover: #059669;
  --gold-accent: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Cairo', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* دوائر إضاءة الخلفية العائمة */
.glow-sphere {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}
.sphere-top {
  width: 380px;
  height: 380px;
  top: -80px;
  right: -80px;
  background: rgba(16, 185, 129, 0.18);
}
.sphere-bottom {
  width: 320px;
  height: 320px;
  bottom: 0;
  left: -80px;
  background: rgba(245, 158, 11, 0.12);
}

/* Glassmorphism System */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

.glass-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.glass-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--emerald-accent);
}

.glass-input, .glass-select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  outline: none;
  font-size: 0.85rem;
  transition: border-color 0.2s ease;
}
.glass-input:focus, .glass-select:focus {
  border-color: var(--emerald-accent);
}

/* شريط التنقل */
.nav-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-radius: 0 0 20px 20px;
}
.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.flag {
  font-size: 1.8rem;
}
.brand-badge {
  font-size: 0.65rem;
  color: var(--emerald-accent);
  font-weight: 700;
  text-transform: uppercase;
  display: block;
}
.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(90deg, #34d399, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge {
  background: var(--emerald-accent);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

/* Hero Section */
.hero-wrapper {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}
.hero-card {
  padding: 32px 20px;
  border-radius: 24px;
  text-align: center;
}
.hero-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-accent);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero-heading {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.3;
}
.hero-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 600px;
  margin: 0 auto 20px;
}
.payment-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.badge-item {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Main Products */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 40px;
  position: relative;
  z-index: 1;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--emerald-accent);
}
.counter-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.product-card {
  border-radius: 20px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.5);
}
.product-img-box {
  position: relative;
  height: 140px;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  margin-bottom: 12px;
}
.product-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.65rem;
  color: var(--emerald-accent);
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
[dir="ltr"] .product-tag { right: auto; left: 8px; }

.product-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold-accent);
  margin-bottom: 12px;
}
.currency-txt {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}
.submit-btn {
  background: var(--emerald-accent);
  color: #000;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.submit-btn:hover {
  background: var(--emerald-hover);
}
.full-width { width: 100%; }

/* لوحة تحكم المدير */
.admin-panel {
  margin-top: 40px;
  padding: 24px;
  border-radius: 24px;
  border-color: rgba(16, 185, 129, 0.4);
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}
.admin-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--emerald-accent);
}
.admin-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.logout-btn {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}
.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.orders-title {
  font-size: 0.9rem;
  color: var(--gold-accent);
  margin-bottom: 10px;
}
.table-container {
  overflow-x: auto;
}
.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  text-align: right;
}
[dir="ltr"] .orders-table { text-align: left; }
.orders-table th, .orders-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.orders-table th { color: var(--text-muted); }
.empty-state { text-align: center; color: var(--text-muted); padding: 20px; }

/* النافذة المنبثقة (Modal) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.95);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}
.cart-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 0;
  border-top: 1px solid var(--glass-border);
  margin-bottom: 12px;
}
.highlight-price { color: var(--gold-accent); }
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checkout-form label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.hidden { display: none !important; }