/* ============================================================
   MIDPOINT — Online ordering styles (mobile-first)
   css/order.css  (reuses main.css design tokens, with fallbacks)
   ============================================================ */
:root {
  --ord-bg: var(--black, #141210);
  --ord-card: var(--carbon, #1c1a17);
  --ord-surface: var(--surface, #232019);
  --ord-line: var(--border, #35302a);
  --ord-text: var(--bone, #efe9df);
  --ord-dim: var(--bone-dim, #b7afa2);
  --ord-muted: var(--bone-muted, #8a7f72);
  --ord-flame: var(--flame, #d4500a);
  --ord-flame-h: var(--flame-hover, #e8631a);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--ord-bg); color: var(--ord-text);
  font-family: var(--font-body, 'Barlow', sans-serif); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; padding-bottom: 80px;
}
a { color: inherit; text-decoration: none; }

/* Top bar */
.ord-top {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1rem; background: rgba(20,18,16,0.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ord-line);
}
.ord-logo { font-family: var(--font-display, 'Bebas Neue', sans-serif); font-size: 1.6rem; letter-spacing: 0.06em; }
.ord-langs { display: flex; gap: 0.15rem; margin-left: auto; }
.ord-lang {
  font-family: var(--font-condensed, 'Barlow Condensed', sans-serif); font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.08em; padding: 0.3rem 0.5rem; color: var(--ord-muted); border-radius: 3px;
}
.ord-lang.is-active { color: var(--ord-flame); background: rgba(212,80,10,0.12); }
.ord-cart-btn { position: relative; background: none; border: none; color: var(--ord-text); font-size: 1.4rem; cursor: pointer; padding: 0.2rem; }
.ord-cart-count {
  position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--ord-flame); color: #fff; border-radius: 9px; font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-condensed, sans-serif);
}

/* Banner + closed */
.ord-banner { background: rgba(212,80,10,0.12); border-bottom: 1px solid var(--ord-line); padding: 0.7rem 1rem; font-size: 0.9rem; }
.ord-banner strong { color: var(--ord-flame); }
.ord-banner span { display: block; color: var(--ord-dim); font-size: 0.82rem; }
.ord-closed { background: #3a1010; color: #ffb4a0; padding: 0.85rem 1rem; text-align: center; font-weight: 600; }

/* Sticky category nav */
.ord-nav {
  position: sticky; top: 52px; z-index: 30; display: flex; gap: 0.4rem; overflow-x: auto;
  padding: 0.6rem 1rem; background: var(--ord-bg); border-bottom: 1px solid var(--ord-line);
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.ord-nav::-webkit-scrollbar { display: none; }
.ord-nav-link {
  white-space: nowrap; font-family: var(--font-condensed, sans-serif); font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ord-dim);
  padding: 0.35rem 0.7rem; border: 1px solid var(--ord-line); border-radius: 999px;
}
.ord-nav-link:active { background: var(--ord-surface); }

/* Search */
.ord-search-wrap { padding: 0.75rem 1rem 0; }
.ord-search {
  width: 100%; padding: 0.75rem 1rem; font-size: 16px; color: var(--ord-text);
  background: var(--ord-surface); border: 1px solid var(--ord-line); border-radius: 8px; outline: none;
}
.ord-search:focus { border-color: var(--ord-flame); }

/* Menu */
.ord-menu { padding: 0.5rem 1rem 2rem; max-width: 760px; margin: 0 auto; }
.ord-loading, .ord-empty { text-align: center; color: var(--ord-muted); padding: 3rem 0; }
.ord-cat { padding-top: 1.25rem; scroll-margin-top: 110px; }
.ord-cat-title {
  font-family: var(--font-display, 'Bebas Neue', sans-serif); font-size: 1.5rem; letter-spacing: 0.04em;
  margin: 0 0 0.6rem; color: var(--ord-text);
}
.ord-item {
  display: flex; gap: 0.85rem; width: 100%; text-align: left; cursor: pointer;
  background: var(--ord-card); border: 1px solid var(--ord-line); border-radius: 10px;
  padding: 0.85rem; margin-bottom: 0.6rem; color: inherit;
}
.ord-item:active { border-color: var(--ord-flame); }
.ord-item-txt { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }
.ord-item-name { font-weight: 600; font-size: 1rem; }
.ord-item-desc { font-size: 0.85rem; color: var(--ord-dim); line-height: 1.4; }
.ord-item-price { font-family: var(--font-condensed, sans-serif); font-weight: 700; color: var(--ord-flame); margin-top: 0.15rem; }
.ord-item-img { flex: 0 0 74px; height: 74px; border-radius: 8px; background-size: cover; background-position: center; }
.ord-badge {
  font-family: var(--font-condensed, sans-serif); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em;
  background: var(--ord-flame); color: #fff; padding: 0.1rem 0.4rem; border-radius: 3px; vertical-align: middle;
}

/* Sticky cart bar */
.ord-cartbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 45;
  width: calc(100% - 2rem); max-width: 720px; display: flex; align-items: center; gap: 0.75rem;
  background: var(--ord-flame); color: #fff; border: none; border-radius: 10px;
  padding: 0.9rem 1.1rem; font-size: 1rem; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.ord-cartbar:hover { background: var(--ord-flame-h); }
.ord-cartbar-count { background: rgba(0,0,0,0.25); border-radius: 6px; padding: 0.1rem 0.55rem; font-weight: 700; }
.ord-cartbar-label { font-family: var(--font-condensed, sans-serif); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.ord-cartbar-total { margin-left: auto; font-weight: 700; }

/* Bottom sheet + drawer shared backdrops */
.ord-sheet-backdrop, .ord-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 50;
}
/* Item bottom-sheet */
.ord-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; max-height: 88vh; overflow-y: auto;
  background: var(--ord-card); border-top-left-radius: 16px; border-top-right-radius: 16px;
  border-top: 1px solid var(--ord-line); padding: 1.25rem 1.15rem 1.5rem;
  transform: translateY(100%); transition: transform 0.22s ease;
}
.ord-sheet.is-open { transform: translateY(0); }
.ord-sheet-close, .ord-drawer-close {
  position: absolute; top: 0.75rem; right: 0.9rem; background: none; border: none; color: var(--ord-muted);
  font-size: 1.3rem; cursor: pointer;
}
.ord-sheet-name { font-family: var(--font-display, sans-serif); font-size: 1.5rem; margin: 0 2rem 0.3rem 0; letter-spacing: 0.03em; }
.ord-sheet-desc { color: var(--ord-dim); font-size: 0.9rem; margin: 0 0 1rem; }
.ord-grp { border-top: 1px solid var(--ord-line); padding: 0.85rem 0; }
.ord-grp-title { font-family: var(--font-condensed, sans-serif); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; color: var(--ord-dim); margin-bottom: 0.5rem; }
.ord-grp-title em { color: var(--ord-flame); font-style: normal; font-size: 0.7rem; }
.ord-grp-err { outline: 1px solid var(--ord-flame); outline-offset: 4px; border-radius: 6px; }
.ord-opt {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.2rem; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ord-opt input { width: 20px; height: 20px; accent-color: var(--ord-flame); }
.ord-opt-name { flex: 1; }
.ord-opt-price { color: var(--ord-flame); font-weight: 600; }
.ord-notes { width: 100%; background: var(--ord-surface); border: 1px solid var(--ord-line); border-radius: 8px; color: var(--ord-text); padding: 0.6rem; font-size: 16px; resize: vertical; }
.ord-qtyrow { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0 0.5rem; }
.ord-qty { display: inline-flex; align-items: center; gap: 0.9rem; }
.ord-qty button { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--ord-line); background: var(--ord-surface); color: var(--ord-text); font-size: 1.3rem; cursor: pointer; }
.ord-qty.small button { width: 30px; height: 30px; font-size: 1.1rem; }
.ord-add {
  width: 100%; margin-top: 0.75rem; padding: 1rem; border: none; border-radius: 10px;
  background: var(--ord-flame); color: #fff; font-family: var(--font-condensed, sans-serif); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.95rem; cursor: pointer;
}
.ord-add:hover { background: var(--ord-flame-h); }

/* Cart drawer */
.ord-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; width: 100%; max-width: 460px; overflow-y: auto;
  background: var(--ord-card); border-left: 1px solid var(--ord-line); padding: 1.25rem 1.15rem 2rem;
  transform: translateX(100%); transition: transform 0.22s ease;
}
.ord-drawer.is-open { transform: translateX(0); }
.ord-drawer-title { font-family: var(--font-display, sans-serif); font-size: 1.6rem; margin: 0 0 1rem; }
.ord-line { display: grid; grid-template-columns: 1fr auto auto auto; gap: 0.5rem; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid var(--ord-line); }
.ord-line-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ord-line-name { font-weight: 600; }
.ord-line-opt { font-size: 0.8rem; color: var(--ord-dim); }
.ord-line-price { font-weight: 700; color: var(--ord-flame); font-family: var(--font-condensed, sans-serif); }
.ord-line-del { background: none; border: none; color: var(--ord-muted); font-size: 0.9rem; cursor: pointer; }
.ord-total { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; font-size: 1.1rem; }
.ord-total strong { font-family: var(--font-condensed, sans-serif); font-size: 1.35rem; color: var(--ord-flame); }
.ord-form { display: flex; flex-direction: column; gap: 0.75rem; }
.ord-form label { display: flex; flex-direction: column; gap: 0.3rem; font-family: var(--font-condensed, sans-serif); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ord-dim); }
.ord-typerow { display: flex; gap: 0.5rem; }
.ord-type { flex: 1; padding: 0.75rem; border: 1px solid var(--ord-line); background: var(--ord-surface); color: var(--ord-dim); border-radius: 8px; cursor: pointer; font-family: var(--font-condensed, sans-serif); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.85rem; }
.ord-type.on { background: var(--ord-flame); color: #fff; border-color: var(--ord-flame); }
.ord-form input, .ord-form select, .ord-form textarea {
  background: var(--ord-surface); border: 1px solid var(--ord-line); border-radius: 8px; color: var(--ord-text);
  padding: 0.7rem 0.8rem; font-size: 16px; outline: none; font-family: var(--font-body, sans-serif);
}
.ord-form input:focus, .ord-form select:focus, .ord-form textarea:focus { border-color: var(--ord-flame); }
.ord-place {
  margin-top: 0.5rem; padding: 1rem; border: none; border-radius: 10px; background: var(--ord-flame); color: #fff;
  font-family: var(--font-condensed, sans-serif); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  font-size: 0.95rem; cursor: pointer;
}
.ord-place:disabled { opacity: 0.6; cursor: default; }
.ord-err { color: #ff9a80; font-size: 0.85rem; }

/* Confirmation */
.ord-confirm { text-align: center; padding: 2rem 0.5rem; }
.ord-confirm-ico { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; background: var(--ord-flame); color: #fff; font-size: 2rem; display: flex; align-items: center; justify-content: center; }
.ord-confirm h3 { font-family: var(--font-display, sans-serif); font-size: 1.6rem; margin: 0 0 0.75rem; }
.ord-confirm p { margin: 0.35rem 0; color: var(--ord-dim); }
.ord-confirm-ref strong, .ord-confirm p strong { color: var(--ord-text); }
.ord-confirm-thanks { margin-top: 1rem; color: var(--ord-flame); font-weight: 600; }

/* Larger screens: menu two columns, drawer as side panel */
@media (min-width: 760px) {
  .ord-menu { display: block; }
  .ord-sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -45%); width: 460px; max-width: 92vw; border-radius: 14px; border: 1px solid var(--ord-line); opacity: 0; transition: opacity 0.18s ease, transform 0.18s ease; }
  .ord-sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
}
