/* ── Shabibi Arabian Fresh — Design System ──────────────────────── */
:root {
  --orange:       #F47B20;
  --orange-dark:  #D4620F;
  --orange-light: #FFF0E6;
  --green:        #2D7A1F;
  --green-light:  #E8F5E2;
  --dark:         #1A1A1A;
  --text:         #333333;
  --text-muted:   #888888;
  --bg:           #FFFBF7;
  --white:        #FFFFFF;
  --border:       #E8DDD4;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 2px 16px rgba(244,123,32,.12);
  --shadow-md:    0 4px 24px rgba(244,123,32,.18);
  --transition:   .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Utilities ── */
.orange { color: var(--orange); }
.green  { color: var(--green); }
.text-muted { color: var(--text-muted); font-size: .88em; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  height: 62px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.15rem; font-weight: 700; color: var(--dark);
}
.nav-logo-img { width: 40px; height: 40px; object-fit: contain; border-radius: 50%; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* Cart Button */
.cart-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--orange-light); color: var(--orange);
  transition: var(--transition);
}
.cart-btn:hover { background: var(--orange); color: var(--white); }
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--green); color: var(--white);
  font-size: .7rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600;
  transition: var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--orange); color: var(--white);
}
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--orange-light); color: var(--orange); }
.btn-secondary:hover { background: var(--orange); color: var(--white); }
.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { background: #256018; }
.btn-outline { border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-full { width: 100%; }
.btn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--text-muted); transition: var(--transition);
}
.btn-icon:hover { background: var(--orange-light); color: var(--orange); }
.btn:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; pointer-events: none; }

/* ── Hero / Banner ── */
.hero {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 60%, #8B2E00 100%);
  color: var(--white); padding: 60px 20px; text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; max-width: 640px; margin: 0 auto; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.hero p { font-size: 1.05rem; opacity: .9; margin-bottom: 28px; }
.hero-logo { width: 100px; height: 100px; object-fit: contain; margin: 0 auto 20px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); background: white; padding: 8px; }
.hero-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.badge {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  padding: 6px 14px; border-radius: 20px; font-size: .82rem; font-weight: 600;
}

/* ── Cards ── */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* ── Business Grid ── */
.section-title {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.business-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.biz-card { cursor: pointer; }
.biz-banner {
  height: 140px; background: linear-gradient(135deg, var(--orange-light), #ffe5cc);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.biz-banner img { width: 100%; height: 100%; object-fit: cover; }
.biz-banner-placeholder { font-size: 3rem; }
.biz-info { padding: 16px; }
.biz-info h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.biz-info p { font-size: .85rem; color: var(--text-muted); margin-bottom: 10px; }
.biz-meta { display: flex; align-items: center; gap: 10px; font-size: .8rem; }
.open-tag  { background: var(--green-light); color: var(--green); padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.closed-tag{ background: #ffeaea; color: #c0392b; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.delivery-tag { color: var(--text-muted); }

/* ── Menu Page ── */
.menu-page { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }
.menu-header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.menu-header .back-btn { color: var(--orange); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.menu-header .back-btn:hover { text-decoration: underline; }
.menu-biz-info h1 { font-size: 1.5rem; font-weight: 800; }
.menu-biz-info p { color: var(--text-muted); font-size: .9rem; }

.menu-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
@media (max-width: 700px) { .menu-layout { grid-template-columns: 1fr; } }

.cat-nav { position: sticky; top: 78px; align-self: start; }
.cat-nav ul { list-style: none; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cat-nav li a {
  display: block; padding: 12px 16px; font-size: .9rem; font-weight: 500;
  border-bottom: 1px solid var(--border); transition: var(--transition);
}
.cat-nav li:last-child a { border-bottom: none; }
.cat-nav li a:hover, .cat-nav li a.active { background: var(--orange-light); color: var(--orange); font-weight: 600; }

.menu-section { margin-bottom: 36px; scroll-margin-top: 78px; }
.menu-section h2 { font-size: 1.1rem; font-weight: 700; color: var(--orange); border-bottom: 2px solid var(--orange-light); padding-bottom: 8px; margin-bottom: 16px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.product-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.product-img {
  height: 130px; overflow: hidden; background: var(--orange-light);
  display: flex; align-items: center; justify-content: center; font-size: 2.5rem;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.product-name { font-weight: 700; font-size: .95rem; }
.product-desc { font-size: .8rem; color: var(--text-muted); flex: 1; }
.product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.product-price { font-size: 1.05rem; font-weight: 800; color: var(--orange); }
.add-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--orange); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; transition: var(--transition);
}
.add-btn:hover { background: var(--orange-dark); transform: scale(1.1); }

/* ── Cart Drawer ── */
.overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
}
.overlay.open { display: block; }

.cart-drawer {
  position: fixed; top: 0; right: -420px; width: 400px; height: 100vh; z-index: 201;
  background: var(--white); box-shadow: -4px 0 30px rgba(0,0,0,.15);
  display: flex; flex-direction: column; transition: right .3s ease;
}
.cart-drawer.open { right: 0; }
@media (max-width: 440px) { .cart-drawer { width: 100%; right: -100%; } .cart-drawer.open { right: 0; } }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px; border-bottom: 1px solid var(--border);
}
.cart-header h2 { font-size: 1.1rem; font-weight: 700; }

.cart-items { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cart-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.cart-empty svg { margin: 0 auto 12px; opacity: .4; }

.cart-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; background: var(--bg); border-radius: var(--radius-sm); }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: .9rem; }
.cart-item-price { color: var(--orange); font-weight: 700; font-size: .88rem; }
.qty-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 700;
  color: var(--orange); transition: var(--transition);
}
.qty-btn:hover { background: var(--orange); color: var(--white); border-color: var(--orange); }
.qty-value { font-weight: 700; font-size: .9rem; min-width: 20px; text-align: center; }

.cart-footer { padding: 16px; border-top: 1px solid var(--border); }
.cart-summary { margin-bottom: 14px; }
.cart-row { display: flex; justify-content: space-between; font-size: .9rem; padding: 4px 0; }
.cart-row.total { font-weight: 800; font-size: 1.05rem; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 6px; }
.cart-row.commission { font-size: .78rem; color: var(--text-muted); }

/* ── Checkout ── */
.checkout-page { max-width: 640px; margin: 0 auto; padding: 30px 20px; }
.checkout-page h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.checkout-page .subtitle { color: var(--text-muted); margin-bottom: 28px; font-size: .9rem; }

.form-section { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.form-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; color: var(--orange); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .95rem; font-family: inherit; background: var(--white); transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244,123,32,.15);
}
.form-group textarea { resize: vertical; min-height: 80px; }

.order-summary-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.order-summary-card h3 { font-weight: 700; margin-bottom: 12px; }
.order-items-list { margin-bottom: 12px; }
.oi-row { display: flex; justify-content: space-between; font-size: .88rem; padding: 3px 0; }
.oi-row.total { font-weight: 800; font-size: 1rem; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 6px; }

/* Yappy Section */
.yappy-section { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-align: center; }
.yappy-section h3 { font-weight: 700; margin-bottom: 8px; }
.yappy-section p { font-size: .85rem; color: var(--text-muted); margin-bottom: 20px; }
.yappy-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #0066CC; color: white;
  padding: 14px 28px; border-radius: 8px; font-weight: 700; font-size: 1rem;
  transition: var(--transition); width: 100%; justify-content: center;
}
.yappy-btn:hover { background: #0052A3; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,102,204,.3); }
.yappy-btn svg { flex-shrink: 0; }
.yappy-logo-text { font-size: 1.2rem; font-weight: 900; letter-spacing: -1px; }
.secure-note { margin-top: 10px; font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 4px; }

/* ── Order Status ── */
.status-page { max-width: 600px; margin: 0 auto; padding: 30px 20px; text-align: center; }
.status-icon { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.status-icon.success { background: var(--green-light); }
.status-icon.pending { background: var(--orange-light); }
.status-icon.error   { background: #ffeaea; }
.status-page h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.status-page p { color: var(--text-muted); margin-bottom: 24px; }

.order-detail-card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); text-align: left; margin-bottom: 20px; }
.order-id { font-family: monospace; font-size: 1.1rem; font-weight: 700; color: var(--orange); }
.status-steps { display: flex; flex-direction: column; gap: 0; margin: 20px 0; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-dot-col { display: flex; flex-direction: column; align-items: center; width: 24px; flex-shrink: 0; }
.step-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .6rem; background: var(--white); flex-shrink: 0; }
.step-line { width: 2px; height: 30px; background: var(--border); }
.step.done .step-dot { background: var(--green); border-color: var(--green); color: white; }
.step.active .step-dot { background: var(--orange); border-color: var(--orange); color: white; animation: pulse 1.5s infinite; }
.step-label { padding-top: 2px; font-size: .88rem; font-weight: 500; }
.step.done .step-label { color: var(--green); font-weight: 600; }
.step.active .step-label { color: var(--orange); font-weight: 600; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,123,32,.5); }
  50% { box-shadow: 0 0 0 8px rgba(244,123,32,0); }
}

/* ── Loading & States ── */
.loading-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; gap: 14px; color: var(--text-muted); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-wrap { text-align: center; padding: 40px 20px; }
.error-wrap h3 { color: #c0392b; margin-bottom: 8px; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--dark); color: var(--white); padding: 12px 18px;
  border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.3); max-width: 300px;
  animation: slideInRight .3s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { background: var(--green); }
.toast.error   { background: #c0392b; }
.toast.info    { background: var(--orange); }
@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Section padding ── */
.page-content { padding: 28px 20px; max-width: 1100px; margin: 0 auto; }
.page-content-narrow { padding: 28px 20px; max-width: 700px; margin: 0 auto; }

/* ── Admin & Business dashboards in separate files ── */

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero { padding: 40px 16px; }
  .menu-layout { grid-template-columns: 1fr; }
  .cat-nav { position: static; }
  .cart-drawer { width: 100%; }
  .product-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .product-grid { grid-template-columns: 1fr; }
}
