/* SupermarketAR — shared styles for all five interfaces. */

:root {
  --bg: #0e1116;
  --panel: #1b2027;
  --panel-2: #232a33;
  --text: #f1f4f8;
  --muted: #9aa6b2;
  --accent: #2bd576;     /* customer green */
  --accent-dark: #16a85a;
  --operator: #e2462f;   /* operator red */
  --operator-dark: #b8351f;
  --line: #2c343f;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);

  --cat-Food: #f4a300;
  --cat-Drinks: #2b8ad5;
  --cat-Fresh: #2bd576;
  --cat-Home: #a36bf4;
  --cat-Hardware: #8a949e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  background: var(--accent);
  color: #03200f;
  font-weight: 700;
}
button.secondary { background: var(--panel-2); color: var(--text); }
button.danger { background: var(--operator); color: #fff; }
button:active { transform: translateY(1px); }

input, select {
  font: inherit;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}
label { display: block; font-size: .82rem; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  color: #03200f;
  background: var(--muted);
}
.badge.cat-Food { background: var(--cat-Food); }
.badge.cat-Drinks { background: var(--cat-Drinks); color: #fff; }
.badge.cat-Fresh { background: var(--cat-Fresh); }
.badge.cat-Home { background: var(--cat-Home); color: #fff; }
.badge.cat-Hardware { background: var(--cat-Hardware); color: #fff; }

.price-now { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.price-was { color: var(--muted); text-decoration: line-through; margin-left: 8px; }
.discount-tag {
  display: inline-block; background: var(--operator); color: #fff;
  font-weight: 800; padding: 2px 8px; border-radius: 8px; font-size: .8rem;
}

/* ---- App-bar -------------------------------------------------------- */
.appbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.appbar h1 { font-size: 1rem; margin: 0; }
.appbar.operator { background: var(--operator); }
.appbar.operator h1 { color: #fff; }
.mode-pill {
  margin-left: auto; padding: 4px 12px; border-radius: 999px;
  font-weight: 800; font-size: .72rem; letter-spacing: .04em;
}
.mode-pill.operator { background: #fff; color: var(--operator); }
.mode-pill.customer { background: var(--accent); color: #03200f; }

/* ---- Cards / lists -------------------------------------------------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; box-shadow: var(--shadow);
}
.offer-card { display: flex; flex-direction: column; gap: 6px; }
.offer-card .head { display: flex; justify-content: space-between; align-items: center; }
.offer-card .product { font-weight: 700; }
.offer-card .where { color: var(--muted); font-size: .82rem; }

.stat-bar { display: flex; gap: 12px; flex-wrap: wrap; }
.stat {
  background: var(--panel-2); border-radius: 12px; padding: 12px 16px; min-width: 120px;
}
.stat .n { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.stat .l { color: var(--muted); font-size: .78rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--panel-2); color: var(--text); padding: 12px 18px;
  border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s; z-index: 9999; border: 1px solid var(--line);
}
.toast.show { opacity: 1; }
.toast.error { border-color: var(--operator); }

/* ---- AR overlay panels --------------------------------------------- */
.overlay {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--panel); border-top-left-radius: 18px; border-top-right-radius: 18px;
  box-shadow: var(--shadow); padding: 18px 18px 24px;
  transform: translateY(110%); transition: transform .28s ease;
  max-height: 80vh; overflow: auto;
}
.overlay.show { transform: translateY(0); }
.overlay .grip { width: 44px; height: 5px; background: var(--line); border-radius: 99px; margin: 0 auto 12px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; }
.tab {
  white-space: nowrap; padding: 8px 14px; border-radius: 999px;
  background: var(--panel-2); color: var(--muted); font-weight: 700; font-size: .82rem;
}
.tab.active { background: var(--accent); color: #03200f; }

.searchbar { display: flex; gap: 8px; }
.searchbar input { flex: 1; }

.hint { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }

/* ---- AR scene framing ---------------------------------------------- */
.ar-frame { position: fixed; inset: 0; z-index: 1; }
.ar-top { position: fixed; top: 0; left: 0; right: 0; z-index: 40; }
.reticle {
  position: fixed; top: 50%; left: 50%; width: 180px; height: 180px;
  transform: translate(-50%, -50%); border: 3px dashed rgba(255,255,255,.55);
  border-radius: 18px; z-index: 30; pointer-events: none;
}
.scan-hint {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.55); padding: 8px 14px; border-radius: 99px;
  font-size: .85rem; z-index: 35;
}

/* ---- Navigation ----------------------------------------------------- */
.map { position: relative; width: 100%; aspect-ratio: 1 / 1; background: var(--panel-2); border-radius: 14px; overflow: hidden; }
.map .shelf { position: absolute; width: 30px; height: 18px; background: var(--line); border-radius: 4px; transform: translate(-50%, -50%); font-size: .55rem; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.map .shelf.target { background: var(--operator); color: #fff; }
.map .here { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%); box-shadow: 0 0 0 6px rgba(43,213,118,.25); transition: all .4s ease; }
.map .entrance { position: absolute; transform: translate(-50%, -50%); font-size: .6rem; color: var(--muted); }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* Shelf-unit footprints, drawn to metric scale on the nav map & dashboard plan */
.map .gondola, .floorplan .gondola {
  position: absolute; transform: translate(-50%, -50%);
  background: var(--line); border: 1px solid var(--panel-2);
  border-radius: 5px; opacity: .55;
}
.floorplan .entrance { position: absolute; transform: translate(-50%, -50%); font-size: .62rem; color: var(--muted); white-space: nowrap; }
.compass { width: 70px; height: 70px; border-radius: 50%; border: 2px solid var(--line); position: relative; margin: 0 auto; }
.compass .needle { position: absolute; top: 50%; left: 50%; width: 4px; height: 30px; background: var(--operator); transform-origin: bottom center; transform: translate(-50%, -100%) rotate(0deg); border-radius: 2px; }
.nav-arrow { font-size: 3rem; text-align: center; transition: transform .3s ease; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

/* Floor plan (dashboard) */
.floorplan { position: relative; width: 100%; aspect-ratio: 4 / 3; background: var(--panel-2); border-radius: 14px; }
.floorplan .cell {
  position: absolute; transform: translate(-50%, -50%);
  width: 78px; height: 46px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); font-size: .62rem;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px;
}
.floorplan .cell.selected { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 2px var(--accent) inset; }
