/* ============================================================
   ROOZY — shared mockup stylesheet
   Shopper side = blue theme   (body.theme-blue)
   Delivery side = green theme (body.theme-green)
   Admin side   = slate theme  (body.theme-admin)
   Design language: rounded, friendly, Segoe UI, pill buttons,
   white cards, doodle-tinted page background.
   ============================================================ */

:root {
  --blue: #027bc4;   /* exact brand blue from Benny's A06 swatch */
  --blue-dark: #04619b;
  --blue-bg: #d9edf9;
  --green: #5aa71c;
  --green-dark: #47850f;
  --green-bg: #edf7e2;
  --order-green: #43b02a;
  --order-green-light: #8fd35e;
  --slate: #2f3a45;
  --slate-dark: #222b34;
  --slate-bg: #eef1f4;
  --tan: #c89b6c;
  --brown: #4a3123;
  --gray-card: #9aa0a6;
  --text: #1c2733;
  --radius-card: 18px;
  --radius-big: 24px;
  --shadow-card: 0 2px 8px rgba(20, 40, 70, .12);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: #cfd6dd;
  -webkit-font-smoothing: antialiased;
}

/* The app column — phone-width, centered on desktop, full-bleed on phones */
.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 32px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
}
.theme-blue  .app { background: var(--blue-bg); }
.theme-green .app { background: var(--green-bg); }
.theme-admin .app { background: var(--slate-bg); }

/* subtle doodle texture over the page background */
.theme-blue  .app { background-image: radial-gradient(rgba(255,255,255,.55) 1.5px, transparent 1.6px); background-size: 26px 26px; }
.theme-green .app { background-image: radial-gradient(rgba(255,255,255,.55) 1.5px, transparent 1.6px); background-size: 26px 26px; }

/* ---------- theme plumbing ---------- */
.theme-blue  { --brand: var(--blue);  --brand-dark: var(--blue-dark);  --brand-bg: var(--blue-bg); }
.theme-green { --brand: var(--green); --brand-dark: var(--green-dark); --brand-bg: var(--green-bg); }
.theme-admin { --brand: var(--slate); --brand-dark: var(--slate-dark); --brand-bg: var(--slate-bg); }

/* ============================ HEADER ============================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--brand);
  color: #fff;
}
.menu-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}
.menu-btn span { display:block; width:18px; height:2.5px; border-radius:2px; background: var(--brand); margin: 2px 0; }
.brand { display: flex; align-items: center; gap: 9px; margin: 0 auto; }
.kanga-chip {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}
.kanga-chip img { width: 32px; height: auto; display: block; }
.brand-word { font-size: 24px; font-weight: 700; letter-spacing: .3px; }
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid #fff;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
}
.avatar svg { width: 100%; height: 100%; }

/* back-chip used on sub-screens */
.back-chip {
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; color: var(--brand);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700;
  text-decoration: none;
  flex: none;
}
.screen-title { font-size: 21px; font-weight: 700; margin: 0 auto; color: #fff; }

/* ====================== SLIDE-DOWN DRAWER ====================== */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 25, 40, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
  z-index: 90;
}
.drawer-overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; left: 50%;
  transform: translate(-50%, -102%);
  width: 100%; max-width: 430px;
  max-height: 88dvh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--brand-dark), var(--brand));
  color: #fff;
  border-radius: 0 0 var(--radius-big) var(--radius-big);
  transition: transform .38s cubic-bezier(.3, .8, .3, 1);
  z-index: 100;
  padding-bottom: 6px;
}
.drawer.open { transform: translate(-50%, 0); }
.drawer-top { display: flex; align-items: center; justify-content: center; padding: 16px 16px 4px; position: relative; }
.drawer-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  background: #fff; border: 3px solid #fff; overflow: hidden;
  display: grid; place-items: center;
}
.drawer-avatar svg { width: 100%; height: 100%; }
.drawer-name { text-align: center; font-weight: 700; font-size: 17px; margin-top: 6px; }
.drawer-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 11px 16px;
  margin: 10px 16px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  border: none; color: #fff; width: calc(100% - 32px); text-align: left;
}
.drawer-item .ico {
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: var(--brand);
  display: grid; place-items: center;
  flex: none; font-size: 16px;
}
.drawer-item .ico img { width: 20px; height: 20px; object-fit: contain; }
.drawer-card {
  background: rgba(255, 255, 255, .13);
  border-radius: var(--radius-card);
  margin: -2px 16px 10px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.55;
  display: none;
}
.drawer-card.open { display: block; }
.drawer-card .edit-chip {
  float: right;
  background: #fff; color: var(--brand);
  border: none; border-radius: 999px;
  font-weight: 700; font-size: 13px;
  padding: 4px 16px; cursor: pointer;
}
.drawer-handle {
  width: 64px; height: 5px; border-radius: 3px;
  background: rgba(255, 255, 255, .65);
  margin: 10px auto 8px;
  cursor: pointer;
}

/* ======================== CATEGORY BAR ======================== */
.cat-bar {
  display: flex; align-items: center; gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  background: var(--brand);
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-tile { flex: none; border-radius: 12px; overflow: hidden; border: 3px solid transparent; cursor: pointer; padding: 0; background: none; }
.cat-tile img { display: block; height: 58px; width: auto; }
.cat-tile.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.4); }

/* density toggle button (2-per-row / 3-per-row) — pinned at the right
   edge of the category bar so it never scrolls out of view */
.density-btn {
  flex: none;
  margin-left: auto;
  position: sticky;
  right: 0;
  width: 46px; height: 40px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,.85);
  background: var(--brand);
  box-shadow: -8px 0 10px -2px rgba(0,0,0,.25);
  cursor: pointer;
  display: grid; place-items: center;
  gap: 0;
}
.density-btn .dots { display: flex; gap: 4px; }
.density-btn .dots i { width: 9px; height: 9px; border-radius: 2.5px; background: #fff; display: block; }

/* ===================== BEING-DELIVERED RIBBON ===================== */
.ribbon {
  background: var(--order-green);
  color: #fff;
  padding: 8px 12px;
  display: none;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
}
.ribbon.show { display: flex; }
.ribbon .ribbon-label { font-weight: 700; font-size: 15px; flex: none; }
.ribbon .thumb {
  background: #fff; border-radius: 10px;
  height: 56px; width: 56px; flex: none;
  display: grid; place-items: center; overflow: hidden;
}
.ribbon .thumb img { max-height: 52px; max-width: 52px; object-fit: contain; }

/* ========================= PRODUCT GRID ========================= */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
}
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.prod {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 6px;
  position: relative;
  cursor: pointer;
  transition: transform .12s;
  border: 3px solid transparent;
}
.prod:active { transform: scale(.97); }
.prod img { width: 100%; height: auto; display: block; border-radius: 9px; }
.prod .badge {
  position: absolute; top: 6px; right: 6px;
  width: 34%; max-width: 64px;
  display: none;
}
.prod.ordering { border-color: var(--order-green); box-shadow: 0 0 0 3px rgba(67, 176, 42, .25); }
.prod.ordering .badge { display: block; }
.prod.out { pointer-events: none; }
.prod.out img { filter: grayscale(1); opacity: .45; }
.prod .info-chip {
  position: absolute; bottom: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; font-style: italic; font-family: Georgia, serif;
  text-decoration: none;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.prod .out-chip {
  display: none;
  position: absolute; left: 8%; right: 8%; top: 42%;
  background: rgba(90, 96, 102, .92);
  color: #fff; text-align: center;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  padding: 5px 4px;
}
.prod.out .out-chip { display: block; }

/* ========================= PILL BUTTONS ========================= */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  color: #fff;
}
.btn-brand { background: var(--brand); }
.btn-green { background: var(--order-green); box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.btn-gray  { background: var(--gray-card); }
.btn-ghost { background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.75); }
.btn:active { transform: translateY(1px); }

/* ========================= JOB CARDS (delivery) ========================= */
.job-card {
  border-radius: var(--radius-big);
  padding: 12px;
  margin: 12px;
  color: #fff;
  box-shadow: var(--shadow-card);
  position: relative;
}
.job-card.incoming { background: var(--blue); }
.job-card.accepted { background: var(--green); }
.job-card.expired  { background: var(--gray-card); }
.job-card.expired .door-wrap img,
.job-card.expired .thumbs { filter: grayscale(1); opacity: .55; }
.door-wrap { position: relative; border-radius: 16px; overflow: hidden; }
.door-wrap img, .door-wrap svg { width: 100%; aspect-ratio: 16 / 10.5; object-fit: cover; display: block; }
.eta-bubble {
  position: absolute; top: 10px; left: 10px;
  background: var(--brand);
  border: 3px solid #fff;
  color: #fff;
  border-radius: 999px;
  padding: 5px 15px;
  font-weight: 800;
  font-size: 17px;
}
.eta-bubble::after {
  content: ""; position: absolute; left: 14px; bottom: -9px;
  border: 6px solid transparent; border-top-color: #fff;
}
.addr-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 4px 4px;
  font-size: 16.5px;
}
.addr-row .est { font-size: 14px; opacity: .85; }
.addr-row .est b { font-size: 21px; opacity: 1; }
.thumbs { display: flex; justify-content: center; gap: 10px; padding: 6px 0 10px; }
.thumbs .thumb {
  background: #fff; border-radius: 12px;
  width: 76px; height: 76px;
  display: grid; place-items: center; overflow: hidden;
}
.thumbs .thumb img { max-width: 68px; max-height: 68px; object-fit: contain; }

/* countdown ring */
.countdown {
  position: absolute; top: -8px; right: -8px;
  width: 58px; height: 58px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-card);
  display: grid; place-items: center;
  z-index: 5;
}
.countdown svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.countdown .num { font-weight: 800; font-size: 17px; color: var(--blue); }

/* queue rows */
.queue-row {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--gray-card);
  color: #fff;
  border-radius: 999px;
  padding: 13px 20px;
  margin: 10px 14px;
  font-weight: 700;
  font-size: 16px;
}
.queue-row .est { font-size: 13px; font-weight: 600; opacity: .9; }
.queue-row .est b { font-size: 18px; }

/* ===================== SLIDE-TO-DELIVER ===================== */
.slide-row { display: flex; align-items: center; gap: 12px; padding: 4px 2px 8px; }
.slide-track {
  flex: 1;
  position: relative;
  height: 56px;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.slide-track .slide-label {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-weight: 800; font-size: 19px;
  color: var(--green);
}
.slide-knob {
  position: absolute; top: 4px; left: 4px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--order-green-light);
  display: grid; place-items: center;
  color: #2e6b0d; font-size: 20px; font-weight: 800;
  cursor: grab;
  z-index: 2;
}
.slide-track.done { background: var(--order-green); }
.slide-track.done .slide-label { color: #fff; }
.slide-track.done .slide-knob { background: #fff; color: var(--order-green); cursor: default; }
.nav-btn {
  flex: none;
  width: 62px;
  text-align: center;
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
}
.nav-btn .nav-circle {
  width: 52px; height: 52px; margin: 0 auto 3px;
  background: #fff; border-radius: 50%;
  display: grid; place-items: center;
}
.nav-btn .nav-circle svg { width: 26px; height: 26px; fill: var(--green); }

/* ========================= TABS (delivery) ========================= */
.tabs {
  display: flex;
  gap: 8px;
  padding: 8px 12px 10px;
  background: var(--brand);
  position: sticky;
  top: 62px;
  z-index: 55;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 4px;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
}
.tab img { height: 46px; width: auto; border-radius: 8px; }
.tab.active { background: #fff; color: var(--brand); }

/* ========================= EMPTY STATE ========================= */
.empty-panel {
  background: #e3e5e8;
  border-radius: var(--radius-big);
  margin: 16px;
  padding: 48px 24px;
  text-align: center;
  color: #8b9096;
  font-size: 16.5px;
  line-height: 1.5;
}
.empty-panel svg { width: 120px; height: auto; margin-bottom: 12px; fill: #b3b8bd; }

/* ========================= FORMS / LOGIN ========================= */
.login-hero {
  background: linear-gradient(180deg, var(--brand-dark), var(--brand));
  color: #fff;
  text-align: center;
  padding: 44px 20px 70px;
  border-radius: 0 0 var(--radius-big) var(--radius-big);
}
.login-hero .kanga-big {
  width: 92px; height: 92px;
  background: #fff; border-radius: 50%;
  margin: 0 auto 10px;
  display: grid; place-items: center;
  overflow: hidden;
}
.login-hero .kanga-big img { width: 72px; }
.login-hero h1 { margin: 4px 0 2px; font-size: 32px; }
.login-hero p { margin: 0; opacity: .9; font-size: 15px; }
.card {
  background: #fff;
  border-radius: var(--radius-big);
  box-shadow: var(--shadow-card);
  margin: 16px;
  padding: 20px;
}
.card.overlap { margin-top: -44px; position: relative; }
.card h2 { margin: 0 0 4px; font-size: 20px; color: var(--brand); }
.card .sub { margin: 0 0 14px; color: #66707a; font-size: 14px; line-height: 1.5; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: #55606b; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  padding: 12px 15px;
  border: 1.5px solid #ccd4db;
  border-radius: 999px;
  outline-color: var(--brand);
  background: #fff;
}
.field textarea { border-radius: var(--radius-card); resize: none; }
.code-boxes { display: flex; gap: 9px; justify-content: center; }
.code-boxes input {
  width: 46px; height: 54px;
  text-align: center;
  font-size: 24px; font-weight: 700;
  border: 1.5px solid #ccd4db;
  border-radius: 12px;
  outline-color: var(--brand);
}
.hint { text-align: center; font-size: 13px; color: #7a848e; margin: 10px 0 0; line-height: 1.5; }
.hint a { color: var(--brand); font-weight: 600; }

/* choice tiles (car vs home) */
.choice-tile {
  border: 2.5px solid #ccd4db;
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
}
.choice-tile.selected { border-color: var(--brand); background: var(--brand-bg); }
.choice-tile .big-emoji { font-size: 38px; flex: none; }
.choice-tile h3 { margin: 0 0 3px; font-size: 16.5px; }
.choice-tile p { margin: 0; font-size: 13px; color: #66707a; line-height: 1.45; }

/* ========================= MISC ========================= */
.section-label {
  font-size: 14px; font-weight: 700; color: #66707a;
  text-transform: uppercase; letter-spacing: .6px;
  margin: 18px 18px 6px;
}
.pill-note {
  background: #fff;
  border-radius: 999px;
  margin: 10px 16px;
  padding: 10px 18px;
  font-size: 13.5px;
  color: #55606b;
  box-shadow: var(--shadow-card);
}
.footer-note {
  text-align: center;
  color: #8b95a0;
  font-size: 12px;
  padding: 18px 24px 24px;
  margin-top: auto;
}

/* inventory check grid */
.inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 2px; }
.inv-item { position: relative; background: #fff; border: 2px solid #dde3e8; border-radius: 12px; padding: 5px; cursor: pointer; }
.inv-item img.pic { width: 100%; height: auto; display: block; }
.inv-item .chk {
  position: absolute; top: -7px; left: -7px;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: #fff;
  border: 2px solid #b9c2ca;
  display: grid; place-items: center;
  font-weight: 900; color: #fff; font-size: 15px;
}
.inv-item.checked { border-color: var(--order-green); }
.inv-item.checked .chk { background: var(--order-green); border-color: var(--order-green); }

/* earnings placeholder */
.stat-row { display: flex; gap: 10px; margin: 12px 16px; }
.stat-card {
  flex: 1;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 14px;
  text-align: center;
}
.stat-card .big { font-size: 24px; font-weight: 800; color: var(--brand); }
.stat-card .lbl { font-size: 12px; color: #7a848e; font-weight: 600; }

/* generic list row (delivered history) */
.list-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin: 10px 14px;
  padding: 10px 14px;
}
.list-row .thumb {
  width: 54px; height: 54px; flex: none;
  border-radius: 10px; background: #f2f4f6;
  display: grid; place-items: center; overflow: hidden;
}
.list-row .thumb img { max-width: 48px; max-height: 48px; object-fit: contain; }
.list-row .info { flex: 1; min-width: 0; }
.list-row .info b { display: block; font-size: 15px; }
.list-row .info span { font-size: 12.5px; color: #7a848e; }
.list-row .amt { font-weight: 800; color: var(--green); font-size: 16px; }

/* ===================== DESKTOP LAYOUT (≥900px) =====================
   Pages that opt in with <body class="… wide-desktop"> stretch into a
   full-width website on big screens; everything else stays a centered
   phone-style column (standard for logins and deliverer screens). */
@media (min-width: 900px) {
  .wide-desktop .app { max-width: 1160px; }
  .wide-desktop .app-header { padding: 12px 22px; }
  .wide-desktop .cat-bar { padding: 12px 20px; gap: 10px; }
  .wide-desktop .ribbon { padding: 10px 20px; }
  .wide-desktop .grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    padding: 18px 24px;
  }
  .wide-desktop .grid.cols-2 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  .wide-desktop .pill-note { max-width: 680px; margin-left: auto; margin-right: auto; }
}

/* ========================= ADMIN (desktop-friendly too) ========================= */
.theme-admin .app { max-width: 900px; }
.admin-side-note { font-size: 12px; opacity: .75; font-weight: 400; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-card); }
.admin-table th { background: var(--slate); color: #fff; text-align: left; font-size: 13px; padding: 10px 14px; }
.admin-table td { padding: 10px 14px; border-top: 1px solid #e6eaee; font-size: 14px; vertical-align: middle; }
.admin-table img.prod-mini { height: 44px; width: auto; }
.tag { display: inline-block; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 3px 12px; }
.tag.ok { background: #e0f4d8; color: #3c8413; }
.tag.low { background: #fdeeda; color: #b06a00; }
.tag.out { background: #eceff2; color: #7a848e; }
.tag.pending { background: #dcebfb; color: #1465ad; }
