@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
  --color-primary: #C1121F;
  --color-primary-dark: #8B0D16;
  --color-accent: #C9933B;
  --color-gold: #F9A826;
  --color-bg: #FDFBF7;
  --color-surface: #FFFFFF;
  --color-surface-soft: #F8F5EE;
  --color-border: #EFE5D5;
  --color-text: #2C1E16;
  --color-text-muted: #785E4C;
  --color-success: #15803D;
  --color-success-bg: #DCFCE7;
  --color-danger: #B91C1C;
  --color-danger-bg: #FEE2E2;
  --color-info: #1D4ED8;
  --color-info-bg: #DBEAFE;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 10px rgba(44, 30, 22, 0.06);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body { padding-bottom: 86px; }
a { color: inherit; }

.site-header {
  position: sticky; top: 0; z-index: 90;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  box-shadow: 0 3px 14px rgba(139, 13, 22, 0.22);
}
.header-inner {
  max-width: 960px; margin: 0 auto; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.header-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; }
.header-logo-img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; border: 2px solid rgba(255,255,255,0.45); background: #fff; flex-shrink: 0; }
.logo-text { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-link {
  text-decoration: none; color: #fff; font-size: 13px; font-weight: 700;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.28);
  display: inline-flex; align-items: center; gap: 6px;
}
.cart-badge {
  background: var(--color-gold); color: #2C1E16; font-weight: 900; font-size: 11px;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}

.site-main { min-height: calc(100vh - 220px); }
.page-container { max-width: 720px; margin: 0 auto; padding: 18px 14px 32px; }
.page-title { font-size: 22px; font-weight: 900; color: var(--color-text); margin: 0 0 6px; }
.page-subtitle { font-size: 13px; color: var(--color-text-muted); margin: 0 0 18px; }

.sw-card, .cart-summary {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 14px;
}

.cart-item {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 14px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: var(--shadow-sm);
}
.cart-item-info h4 { margin: 0 0 4px; font-size: 15px; font-weight: 800; }
.cart-item-info p { margin: 0; font-size: 13px; color: var(--color-text-muted); }
.qty-control { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.qty-btn {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--color-border);
  background: var(--color-surface-soft); color: var(--color-text); font-size: 16px; font-weight: 800; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.qty-value { min-width: 22px; text-align: center; font-weight: 800; font-size: 15px; }

.summary-line { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; color: var(--color-text-muted); }
.summary-line.total { border-top: 2px dashed var(--color-border); margin-top: 8px; padding-top: 12px; font-size: 18px; font-weight: 900; color: var(--color-primary-dark); }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--color-text); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--color-border);
  background: #fff; color: var(--color-text); font-family: inherit; font-size: 14px; outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--color-primary); }
.form-textarea { min-height: 76px; resize: vertical; }

.btn-primary, .btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 13px 16px; border-radius: 13px; border: none; font-family: inherit;
  font-size: 15px; font-weight: 800; text-decoration: none; cursor: pointer;
}
.btn-primary { background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%); color: #fff; box-shadow: 0 4px 12px rgba(193, 18, 31, 0.25); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary { background: var(--color-surface-soft); color: var(--color-text); border: 1px solid var(--color-border); margin-top: 8px; }

.empty-cart { text-align: center; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 38px 20px; }
.empty-cart-icon { font-size: 46px; margin-bottom: 10px; }

.track-stages {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 18px 10px; box-shadow: var(--shadow-sm);
}
.track-stage { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.track-dot {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px; background: var(--color-surface-soft); color: var(--color-text-muted); border: 2px solid var(--color-border);
}
.track-stage.done .track-dot { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.track-stage.active .track-dot { background: var(--color-primary); color: #fff; border-color: var(--color-gold); box-shadow: 0 0 0 4px rgba(193, 18, 31, 0.16); }
.track-label { font-size: 11px; font-weight: 700; color: var(--color-text-muted); line-height: 1.25; }
.track-stage.done .track-label, .track-stage.active .track-label { color: var(--color-text); font-weight: 800; }

.order-item-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--color-surface-soft); font-size: 14px; }
.order-item-row:last-child { border-bottom: none; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-draft, .status-submitted, .status-pending { background: #FEF3C7; color: #92400E; }
.status-confirmed, .status-preparing { background: var(--color-info-bg); color: var(--color-info); }
.status-out_for_delivery { background: #EDE9FE; color: #5B21B6; }
.status-delivered { background: var(--color-success-bg); color: var(--color-success); }
.status-cancelled { background: var(--color-danger-bg); color: var(--color-danger); }

.site-footer { background: #2C1E16; color: #EADBC8; padding: 22px 14px 20px; margin-top: 24px; font-size: 13px; }
.footer-inner { max-width: 960px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.footer-info strong { color: #fff; font-size: 15px; display: block; margin-bottom: 4px; }
.footer-info p { margin: 4px 0; color: #D4C3B0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.footer-links a { color: #F9A826; text-decoration: none; font-weight: 700; }
.footer-bottom { max-width: 960px; margin: 14px auto 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.12); font-size: 12px; color: #B49F8A; text-align: center; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 95;
  background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border); display: flex; justify-content: space-around; align-items: center;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 16px rgba(44, 30, 22, 0.08);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none; color: var(--color-text-muted); font-size: 11px; font-weight: 700; padding: 4px 2px; position: relative;
}
.bottom-nav-item svg { width: 21px; height: 21px; }
.bottom-nav-item.active { color: var(--color-primary); font-weight: 900; }
.nav-cart-dot {
  position: absolute; top: 0; right: 20%; background: var(--color-primary); color: #fff;
  font-size: 10px; font-weight: 900; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  display: none; align-items: center; justify-content: center;
}

@media (max-width: 480px) {
  .track-stages { gap: 3px; padding: 14px 6px; }
  .track-dot { width: 28px; height: 28px; font-size: 12px; }
  .track-label { font-size: 10px; }
}
