@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&display=swap');

:root {
  --ink: #1c1917;
  --ink-soft: #44403c;
  --cream: #faf7f2;
  --cream-dark: #f0ebe3;
  --rust: #c2410c;
  --rust-hover: #9a3412;
  --sage: #4d7c5c;
  --sage-light: #e8f0ea;
  --gold: #b45309;
  --white: #ffffff;
  --border: #e7e0d6;
  --shadow: 0 4px 24px rgba(28, 25, 23, 0.08);
  --shadow-lg: 0 12px 48px rgba(28, 25, 23, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --nav-height: 72px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
}

/* ── Navigation ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.logo span {
  color: var(--rust);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#auth-links {
  display: flex;
  gap: 8px;
}

#user-menu {
  display: none;
  align-items: center;
  gap: 16px;
}

.user-greeting {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cart-link:hover {
  border-color: var(--rust);
  box-shadow: var(--shadow);
}

.cart-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--rust);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--rust);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--rust-hover);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--ink-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 16px;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--cream-dark);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Hero ── */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-content h1 em {
  font-style: italic;
  color: var(--rust);
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin-bottom: 32px;
  max-width: 440px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-image {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-lg);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(194, 65, 12, 0.15));
}

/* ── Sections ── */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ── Filters ── */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-btn {
  padding: 8px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}

.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.search-box {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--rust);
}

.search-box::before {
  content: '⌕';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  font-size: 1.1rem;
}

/* ── Menu Grid ── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.menu-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.25s, box-shadow 0.25s;
}

.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.menu-card-image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.menu-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.menu-card:hover .menu-card-image img {
  transform: scale(1.05);
}

.menu-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: var(--sage);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.menu-card-body {
  padding: 20px;
}

.menu-card-category {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rust);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.menu-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.menu-card-body p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

/* ── Auth Pages ── */
.auth-page {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.auth-card .subtitle {
  color: var(--ink-soft);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: none;
}

.form-error.show {
  display: block;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.auth-footer a {
  color: var(--rust);
  font-weight: 600;
}

/* ── Cart Page ── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: flex;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.cart-item-image {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
}

.cart-item-details h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.cart-item-price {
  color: var(--rust);
  font-weight: 600;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  width: 32px;
  height: 32px;
  background: var(--cream);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--ink);
  transition: background 0.2s;
}

.qty-btn:hover {
  background: var(--cream-dark);
}

.qty-value {
  width: 36px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.remove-btn {
  background: none;
  border: none;
  color: #b91c1c;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
}

.remove-btn:hover {
  text-decoration: underline;
}

.cart-summary {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.cart-summary h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.summary-row.total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--ink-soft);
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 12px;
}

.empty-state p {
  margin-bottom: 24px;
}

/* ── Orders ── */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.order-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.order-date {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-Pending { background: #fef3c7; color: #92400e; }
.status-Confirmed { background: #dbeafe; color: #1e40af; }
.status-Preparing { background: #e0e7ff; color: #3730a3; }
.status-OutForDelivery { background: #d1fae5; color: #065f46; }
.status-Delivered { background: var(--sage-light); color: var(--sage); }
.status-Cancelled { background: #fee2e2; color: #991b1b; }

.order-items-list {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.order-total {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

/* ── Admin ── */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  background: var(--cream-dark);
  padding: 4px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.admin-table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: var(--cream);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.status-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--white);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--white);
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 200;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ── Footer ── */
.footer {
  margin-top: 64px;
  padding: 32px 24px;
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  text-align: center;
  font-size: 0.9rem;
}

.footer .logo {
  color: var(--white);
  margin-bottom: 8px;
  display: inline-block;
}

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--ink-soft);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--rust);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-image {
    order: -1;
    max-height: 320px;
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ══════════════════════════════════════
   MODERN APP UI — Multi-restaurant
   ══════════════════════════════════════ */

.app-body {
  padding-bottom: 88px;
  background: #f4f4f5;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e4e4e7;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

.app-header.simple .app-header-inner {
  grid-template-columns: auto 1fr auto;
}

.app-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.header-search {
  flex: 1;
}

.header-search input {
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: #f4f4f5;
  border-radius: 999px;
  font-size: 0.9rem;
  outline: none;
}

.header-search input:focus {
  background: #ebebed;
  box-shadow: 0 0 0 2px var(--rust);
}

.header-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f4f4f5;
  font-size: 1.1rem;
  text-decoration: none;
}

.cart-icon-btn .cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  display: none;
  min-width: 18px;
  height: 18px;
  font-size: 0.7rem;
}

.header-auth, .header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.header-user { display: none; }
.header-user a { color: var(--rust); font-weight: 600; }

.page-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-align: center;
}

.back-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

.back-link:hover { color: var(--ink); }

.app-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

.hero-compact {
  padding: 28px 0 20px;
}

.hero-compact h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.hero-compact h1 em {
  font-style: italic;
  color: var(--rust);
}

.hero-compact p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.section-tight {
  margin-bottom: 28px;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

/* Restaurant cards */
.restaurants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.restaurant-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  border-top: 4px solid var(--brand, var(--rust));
}

.restaurant-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.1);
}

.restaurant-card-img {
  position: relative;
  height: 140px;
  overflow: hidden;
}

.restaurant-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.restaurant-emoji {
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.restaurant-card-body {
  padding: 14px 16px 16px;
}

.restaurant-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.restaurant-card-top h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.rating {
  font-size: 0.85rem;
  font-weight: 600;
  color: #b45309;
}

.restaurant-card-body p {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.restaurant-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  flex-wrap: wrap;
}

/* Quick picks */
.quick-picks-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.quick-picks-scroll::-webkit-scrollbar { display: none; }

.quick-item {
  flex: 0 0 220px;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  scroll-snap-align: start;
}

.quick-item img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.quick-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-item-rest {
  font-size: 0.7rem;
  color: var(--rust);
  font-weight: 600;
  text-transform: uppercase;
}

.quick-item-info strong {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-item-info span:last-child {
  font-size: 0.8rem;
  font-weight: 700;
}

.quick-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--rust);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  transition: transform 0.15s;
}

.quick-add-btn:active { transform: scale(0.9); }

/* Restaurant page */
.restaurant-header {
  max-width: 900px;
  margin: 0 auto;
}

.restaurant-hero {
  position: relative;
  height: 200px;
  overflow: hidden;
  border-radius: 0 0 20px 20px;
}

.restaurant-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.restaurant-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 20%, rgba(0,0,0,0.75));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: #fff;
}

.restaurant-hero-emoji { font-size: 2rem; margin-bottom: 4px; }

.restaurant-hero-overlay h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}

.restaurant-hero-meta {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 4px;
}

.restaurant-main { margin-top: -8px; }

.menu-toolbar { padding: 12px 0 8px; }

.search-box.compact input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
  font-size: 0.9rem;
  outline: none;
}

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.filter-pills::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.filter-pill.active {
  background: var(--ink);
  color: #fff;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.menu-row-img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.menu-row-info {
  flex: 1;
  min-width: 0;
}

.menu-row-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.menu-row-info p {
  font-size: 0.78rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.menu-row-price {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--rust);
}

.add-btn-round {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--rust);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(194,65,12,0.35);
}

.add-btn-round:active { transform: scale(0.92); }

.inline-qty {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--rust);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.qty-btn-sm {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  font-weight: 600;
}

.inline-qty span {
  min-width: 24px;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Sticky cart bar */
.sticky-cart {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: calc(100% - 32px);
  max-width: 500px;
  padding: 14px 20px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  pointer-events: none;
}

.sticky-cart.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.sticky-cart-right {
  font-weight: 700;
}

/* Checkout */
.checkout-main { padding-top: 8px; }

.checkout-restaurant {
  background: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.checkout-restaurant span { color: var(--ink-soft); display: block; font-size: 0.8rem; }

.checkout-items {
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 12px;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid #f4f4f5;
}

.checkout-item:last-child { border-bottom: none; }

.checkout-item img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
}

.checkout-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkout-item-info strong { font-size: 0.9rem; }
.checkout-item-info span { font-size: 0.8rem; color: var(--rust); font-weight: 600; }

.checkout-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.checkout-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.checkout-section .optional {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.checkout-section textarea,
.checkout-section input[type="text"],
.checkout-section input[type="tel"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}

.checkout-section textarea:focus,
.checkout-section input:focus {
  border-color: var(--rust);
}

.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.payment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 2px solid #e4e4e7;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.payment-card input { display: none; }

.payment-card.selected {
  border-color: var(--rust);
  background: #fff7ed;
}

.payment-icon { font-size: 1.5rem; }

.payment-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.payment-info strong { font-size: 0.82rem; }
.payment-info span { font-size: 0.7rem; color: var(--ink-soft); }

.payment-extra {
  margin-top: 12px;
}

.payment-extra label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.payment-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.checkout-summary {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.btn-checkout {
  padding: 16px;
  font-size: 1rem;
  border-radius: 14px;
}

.footer-mini {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.success-banner {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.success-banner strong { color: #065f46; display: block; margin-bottom: 4px; }
.success-banner p { font-size: 0.9rem; color: #047857; }

.fawry-code {
  margin-top: 10px;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #065f46;
}

.order-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

@media (max-width: 500px) {
  .payment-grid { grid-template-columns: 1fr; }
  .app-header-inner { grid-template-columns: auto 1fr; }
  .header-search { grid-column: 1 / -1; order: 3; }
  .nav-actions { justify-self: end; }
}

/* ── Demo payment flow ── */
.pay-amount-box {
  background: linear-gradient(135deg, var(--ink) 0%, #3f3f46 100%);
  color: #fff;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}

.pay-amount-box span { font-size: 0.85rem; opacity: 0.8; display: block; }
.pay-amount-box strong { font-family: var(--font-display); font-size: 2rem; display: block; margin: 4px 0; }
.pay-amount-box small { opacity: 0.7; font-size: 0.85rem; }

.demo-sandbox-banner {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.payment-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.payment-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 2px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-tab span:first-child { font-size: 1.4rem; }
.payment-tab.active { border-color: var(--rust); background: #fff7ed; color: var(--rust); }

.pay-panel-desc { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 16px; }

.cod-steps { display: flex; flex-direction: column; gap: 10px; }
.cod-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  padding: 10px 12px;
  background: #f4f4f5;
  border-radius: 8px;
}
.cod-step span {
  width: 24px; height: 24px;
  background: var(--rust);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}

.card-preview {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  border-radius: 14px;
  padding: 20px;
  color: #fff;
  margin-bottom: 20px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-chip {
  width: 40px; height: 28px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  border-radius: 6px;
}

.card-number-preview {
  font-family: monospace;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  margin: 12px 0;
}

.card-preview-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  text-transform: uppercase;
  opacity: 0.85;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.otp-input {
  font-size: 1.5rem !important;
  letter-spacing: 0.3em;
  text-align: center;
  font-weight: 700;
}

.otp-sent-msg {
  background: #ecfdf5;
  color: #065f46;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.fawry-code-display {
  background: #fefce8;
  border: 2px dashed #ca8a04;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-top: 16px;
}

.fawry-code-display span { font-size: 0.8rem; color: var(--ink-soft); display: block; }
.fawry-code-display strong {
  font-family: monospace;
  font-size: 1.75rem;
  color: #a16207;
  display: block;
  margin: 8px 0;
  letter-spacing: 0.05em;
}

.fawry-amount { font-weight: 700; color: var(--ink); margin-top: 8px; }

.payment-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.payment-overlay.active { opacity: 1; pointer-events: auto; }

.processing-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.processing-title { font-weight: 700; margin-top: 16px; font-size: 1.05rem; }
.processing-sub { color: var(--ink-soft); font-size: 0.9rem; margin-top: 4px; }

.demo-credentials {
  margin-top: 24px;
  padding: 16px;
  background: #f4f4f5;
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.demo-credentials h4 { color: var(--ink); margin-bottom: 8px; font-size: 0.85rem; }
.demo-credentials p { margin-bottom: 4px; }

.pay-status { font-weight: 600; }
.pay-Paid { color: #059669; }
.pay-PayOnDelivery { color: #b45309; }
.pay-Failed { color: #dc2626; }

.btn-success { background: #059669 !important; color: #fff !important; }
