@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Space+Mono:wght@400;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --purple: #6C1CFF;
  --purple-hover: #5612D6;
  --purple-soft: #F1EBFF;
  --purple-line: #D9C8FF;
  --purple-text: #6C1CFF;
  --green: #10B981;
  --green-soft: #ECFDF5;
  --red: #E63946;
  --amber: #F59E0B;
  --amber-soft: #FEF3C7;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 10px;

  --font-mono: 'Space Mono', monospace;
  --font-sans: 'Manrope', 'Cairo', sans-serif;
  --font-ar: 'Cairo', 'Manrope', sans-serif;
}

html[data-theme="light"] {
  --bg: #F1F2F5;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --card-bg: #FFFFFF;
  --subtle-bg: #F8FAFC;
  --text: #14121B;
  --muted: #64748B;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --card-shadow: 0 2px 8px -1px rgba(20, 18, 27, 0.05);
  --card-shadow-hover: 0 8px 20px -3px rgba(20, 18, 27, 0.09);
  --btn-text: #FFFFFF;
}

html[data-theme="dark"] {
  --bg: #0B0D13;
  --surface: #141722;
  --surface-elevated: #1B1F2D;
  --card-bg: #141722;
  --subtle-bg: #1B1F2E;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --border: #242938;
  --border-light: #1C212E;
  --purple-soft: #231742;
  --purple-line: #4E2A8C;
  --purple-text: #C4B5FD;
  --green-soft: #122822;
  --amber-soft: #2E2210;
  --card-shadow: 0 2px 10px -1px rgba(0, 0, 0, 0.35);
  --card-shadow-hover: 0 8px 25px -2px rgba(0, 0, 0, 0.55);
  --btn-text: #FFFFFF;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
  overflow-x: hidden;
}

html[dir="rtl"] body {
  font-family: var(--font-ar);
}

.mono {
  font-family: var(--font-mono);
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: background .15s ease, border-color .15s ease;
}

.header-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-header {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  direction: ltr !important;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  user-select: none;
  direction: ltr !important;
  unicode-bidi: isolate;
  color: var(--text);
}

.logo .k { color: var(--purple); }
.logo .rest { color: var(--text); }
.logo .chev { color: var(--purple); margin-left: 2px; }

.badge-template {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--purple-soft);
  color: var(--purple-text);
  border: 1px solid var(--purple-line);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all .15s ease;
}

.icon-btn:hover {
  border-color: var(--purple);
  background: var(--purple-soft);
  color: var(--purple-text);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  padding: 24px 0 16px;
  text-align: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

html[dir="rtl"] .eyebrow {
  font-family: var(--font-ar);
  letter-spacing: 0.02em;
}

html[data-theme="dark"] .eyebrow {
  color: var(--purple-text);
}

.eyebrow .chev {
  font-weight: 700;
}

h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

h1 span.highlight {
  color: var(--purple);
}

html[data-theme="dark"] h1 span.highlight {
  color: var(--purple-text);
}

.sub {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 52ch;
  margin: 0 auto 16px;
  line-height: 1.5;
}

.restaurant-meta-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  box-shadow: var(--card-shadow);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.meta-item svg {
  width: 15px;
  height: 15px;
  color: var(--purple);
  flex-shrink: 0;
}

html[data-theme="dark"] .meta-item svg {
  color: var(--purple-text);
}

.meta-item strong {
  color: var(--text);
  font-weight: 700;
}

/* ==========================================================================
   CONTROLS BAR (SEARCH + VIEW SWITCHER + TABS)
   ========================================================================== */
.controls-bar {
  position: sticky;
  top: 57px;
  z-index: 40;
  background: var(--bg);
  padding: 8px 0;
  margin-bottom: 12px;
  transition: background .15s ease;
}

.controls-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box svg {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

html[dir="rtl"] .search-box svg {
  left: auto;
  right: 12px;
}

.search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

html[dir="rtl"] .search-input {
  padding: 9px 36px 9px 12px;
}

.search-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-soft);
}

.search-input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.view-mode-toggle {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.view-btn {
  background: none;
  border: none;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
}

.view-btn.active {
  background: var(--purple-soft);
  color: var(--purple-text);
}

.view-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}

.cat-btn:hover {
  border-color: var(--purple-line);
  color: var(--text);
}

.cat-btn.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(108, 28, 255, 0.3);
}

/* ==========================================================================
   MULTI-ITEM DISHES GRID (2 COLUMNS MOBILE, 3 COLUMNS DESKTOP)
   ========================================================================== */
.menu-group {
  margin-bottom: 28px;
  scroll-margin-top: 130px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
}

.section-title .chev {
  font-family: var(--font-mono);
  color: var(--purple);
  font-weight: 700;
}

html[data-theme="dark"] .section-title .chev {
  color: var(--purple-text);
}

.section-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* Multi-Item Grid: Strict 2 items per row on ALL mobile screens (<768px) */
.dishes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 768px) {
  .dishes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1040px) {
  .dishes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

/* Card Styling */
.dish-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  position: relative;
}

.dish-card:hover {
  border-color: var(--purple-line);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.dish-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--subtle-bg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.dish-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.dish-card:hover .dish-img {
  transform: scale(1.04);
}

.corner {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--purple);
  opacity: 0.85;
  pointer-events: none;
  z-index: 3;
}

html[data-theme="dark"] .corner {
  color: var(--purple-text);
}

.corner.tl { top: 6px; left: 6px; }
.corner.br { bottom: 6px; right: 6px; transform: rotate(180deg); }

html[dir="rtl"] .corner.tl { left: auto; right: 6px; }
html[dir="rtl"] .corner.br { right: auto; left: 6px; transform: rotate(180deg); }

.badge-dish {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
}

html[dir="rtl"] .badge-dish {
  right: auto;
  left: 6px;
  font-family: var(--font-ar);
}

.badge-chef { background: rgba(108, 28, 255, 0.9); color: #FFFFFF; }
.badge-vegan { background: rgba(16, 185, 129, 0.9); color: #FFFFFF; }
.badge-popular { background: rgba(245, 158, 11, 0.9); color: #FFFFFF; }
.badge-traditional { background: rgba(20, 18, 27, 0.85); color: #FFFFFF; border: 1px solid rgba(255, 255, 255, 0.2); }

.dish-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  width: 100%;
  height: 100%;
  color: var(--muted);
}

.dish-placeholder svg {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  color: var(--purple);
  opacity: 0.8;
}

html[data-theme="dark"] .dish-placeholder svg {
  color: var(--purple-text);
}

.dish-placeholder span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--purple);
  letter-spacing: 0.05em;
}

html[data-theme="dark"] .dish-placeholder span {
  color: var(--purple-text);
}

.dish-placeholder small {
  font-size: 0.64rem;
  color: var(--muted);
  margin-top: 2px;
}

.dish-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.dish-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
}

.dish-name {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  min-height: 2.3em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish-code {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--subtle-bg);
  border: 1px solid var(--border);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.dish-desc {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.35;
  margin-bottom: 8px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  gap: 4px;
  margin-top: auto;
}

.dish-price {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

html[data-theme="dark"] .dish-price {
  color: var(--purple-text);
}

.dish-price .currency {
  font-size: 0.74rem;
  font-weight: 600;
  margin-left: 2px;
}

html[dir="rtl"] .dish-price .currency {
  margin-left: 0;
  margin-right: 2px;
}

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--purple-line);
  color: var(--purple-text);
  padding: 5px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
  white-space: nowrap;
}

.btn-add:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(108, 28, 255, 0.3);
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  background: var(--purple-soft);
  border: 1px solid var(--purple-line);
  border-radius: 6px;
  padding: 1px;
  gap: 1px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}

.qty-btn:hover {
  border-color: var(--purple);
  color: var(--purple-text);
}

.qty-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--purple-text);
  min-width: 18px;
  text-align: center;
}

/* ==========================================================================
   LIST VIEW ALTERNATIVE MODE
   ========================================================================== */
.dishes-grid.list-view {
  grid-template-columns: 1fr !important;
  gap: 10px;
}

.dishes-grid.list-view .dish-card {
  flex-direction: row;
  align-items: stretch;
}

.dishes-grid.list-view .dish-img-wrap {
  width: 120px;
  min-width: 120px;
  aspect-ratio: auto;
  border-bottom: none;
  border-inline-end: 1px solid var(--border);
}

@media (max-width: 480px) {
  .dishes-grid.list-view .dish-img-wrap {
    width: 90px;
    min-width: 90px;
  }
}

.dishes-grid.list-view .dish-body {
  padding: 10px 14px;
  justify-content: center;
}

.dishes-grid.list-view .dish-name {
  min-height: auto;
  font-size: 0.95rem;
}

.dishes-grid.list-view .dish-desc {
  -webkit-line-clamp: 3;
}

/* ==========================================================================
   FLOATING ORDER BAR
   ========================================================================== */
.floating-order-dock {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 680px;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 10px 16px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
  display: none;
  align-items: center;
  justify-content: space-between;
  animation: slideUp .25s ease;
  backdrop-filter: blur(10px);
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.dock-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dock-badge {
  background: var(--purple);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dock-calc {
  display: flex;
  flex-direction: column;
}

.dock-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dock-total {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.dock-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple);
  color: #FFFFFF;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 4px 14px rgba(108, 28, 255, 0.35);
}

.dock-action-btn:hover {
  background: var(--purple-hover);
  transform: translateY(-1px);
}

.dock-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ==========================================================================
   MODAL & RECEIPT
   ========================================================================== */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title .chev {
  font-family: var(--font-mono);
  color: var(--purple);
}

html[data-theme="dark"] .modal-title .chev {
  color: var(--purple-text);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
}

.modal-close-btn:hover {
  color: var(--text);
  background: var(--subtle-bg);
}

.modal-close-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}

.modal-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 220px;
  overflow-y: auto;
  padding-inline-end: 2px;
}

.modal-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--subtle-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  gap: 10px;
}

.modal-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.modal-item-thumb {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  flex-shrink: 0;
}

.modal-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-item-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.modal-item-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.modal-item-calc {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.modal-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.modal-item-total {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--purple-text);
  min-width: 62px;
  text-align: end;
}

.modal-qty-mini {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 4px;
  gap: 2px;
}

.modal-qty-mini button {
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-qty-mini button:hover {
  color: var(--purple);
}

.modal-qty-mini span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  min-width: 16px;
  text-align: center;
}

.dining-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.dining-opt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: var(--subtle-bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
}

.dining-opt-btn:hover {
  border-color: var(--purple-line);
  color: var(--text);
}

.dining-opt-btn.active {
  background: var(--purple-soft);
  border-color: var(--purple);
  color: var(--purple);
}

html[data-theme="dark"] .dining-opt-btn.active {
  background: #231640;
  border-color: #8B5CF6;
  color: #FFFFFF;
}

.dining-opt-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.modal-field {
  margin-bottom: 12px;
}

.modal-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.modal-field input,
.modal-field textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--subtle-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease;
}

.modal-field input:focus,
.modal-field textarea:focus {
  border-color: var(--purple);
  background: var(--surface);
}

.modal-field textarea {
  resize: vertical;
  min-height: 54px;
}

.modal-total-box {
  background: var(--surface);
  border: 1.5px solid var(--purple-line);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-total-box span {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}

.modal-total-box .grand-val {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--purple);
}

html[data-theme="dark"] .modal-total-box .grand-val {
  color: var(--purple-text);
}

.btn-primary-action {
  width: 100%;
  padding: 11px 16px;
  background: var(--purple);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s ease, transform .15s ease;
  box-shadow: 0 4px 14px rgba(108, 28, 255, 0.35);
}

.btn-primary-action:hover {
  background: var(--purple-hover);
  transform: translateY(-1px);
}

.btn-primary-action svg {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0;
}

.qr-screen {
  text-align: center;
  padding: 4px 0 8px;
}

.qr-box {
  background: #FFFFFF;
  border: 2px solid var(--purple-line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: inline-block;
  margin: 0 auto 14px;
  box-shadow: var(--card-shadow);
}

.receipt-card {
  background: var(--subtle-bg);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 12px;
  text-align: left;
  direction: ltr !important;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre;
  margin-bottom: 14px;
  max-height: 150px;
  overflow-y: auto;
  overflow-x: auto;
}

.qr-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-secondary-action {
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s ease;
}

.btn-secondary-action:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.btn-secondary-action svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  margin-top: 40px;
  padding: 24px 16px calc(var(--tabbar-height, 0px) + 40px);
  border-top: 1px solid var(--border);
  text-align: center;
  background: var(--surface);
}

.footer-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.footer-logo .k { color: var(--purple); }
.footer-logo .rest { color: var(--text); }
.footer-logo .chev { color: var(--purple); }

.footer-text {
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 48ch;
  margin: 0 auto 10px;
}

.footer-credits {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--purple);
}

html[data-theme="dark"] .footer-credits {
  color: var(--purple-text);
}

@media print {
  header, .controls-bar, .floating-order-dock, .hero, .modal-close-btn, .qr-actions-row {
    display: none !important;
  }
  .modal-dialog {
    border: none;
    box-shadow: none;
  }
}

/* ==========================================================================
   TEMPLATE SHOWCASE WIDGETS (MATCHING THE OTHER TEMPLATE)
   ========================================================================== */
.info-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

.feature-list li .chev {
  font-family: var(--font-mono);
  color: var(--purple);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

html[data-theme="dark"] .feature-list li .chev {
  color: var(--purple-text);
}

.customization-promise-block {
  background: var(--subtle-bg);
  border: 1.5px solid var(--purple-line);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
  text-align: center;
}

.custom-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple);
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(108, 28, 255, 0.35);
}

.custom-promise-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.custom-promise-desc {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 auto;
  max-width: 580px;
}
