:root {
  --bg:        #0a0a0a;
  --surface:   #131313;
  --surface-2: #1c1c1c;
  --border:    #262626;
  --text:      #f5f5f5;
  --muted:     #8a8a8a;
  --dim:       #5a5a5a;
  --accent:    #f5f5f5;
  --danger:    #ff5252;
  --gold:      #d4b062;
  --radius:    18px;
  --radius-sm: 12px;
  --gap:       14px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bot:    env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  /* Hide all scrollbars visually but keep scrolling functional */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

img { display: block; max-width: 100%; }
button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
input, textarea, select {
  font-family: inherit; color: inherit;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; width: 100%;
  font-size: 15px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--text); }

#app {
  max-width: 780px;
  margin: 0 auto;
  padding-top: var(--safe-top);
  padding-bottom: calc(80px + var(--safe-bot));
}

/* ---------- top hero ---------- */

.hero {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.hero video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.6) saturate(0.9);
}
.hero .grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0) 0%, rgba(10,10,10,0.9) 100%);
}
.hero .brand {
  position: absolute; top: 18px; left: 20px;
}
.hero .brand img { width: 42px; height: 42px; border-radius: 10px; opacity: 0.95; }
.hero .city {
  position: absolute; left: 20px; bottom: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text); font-weight: 700;
  padding: 8px 14px; border: 1px solid rgba(255,255,255,0.14); border-radius: 999px;
  background: rgba(10,10,10,0.55); backdrop-filter: blur(10px);
}
.hero .city::before { content: '◉'; font-size: 10px; color: var(--gold); }

/* ---------- banners ---------- */

.banners {
  padding: 12px 16px 0;
  display: grid;
  gap: var(--gap);
}
.banner {
  position: relative;
  height: 140px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}
.banner img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.55);
}
.banner .content {
  position: absolute; left: 22px; right: 22px; bottom: 18px;
}
.banner h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: 0.01em; color: #fff; }
.banner p  { margin: 4px 0 0; color: rgba(255,255,255,0.75); font-size: 12px; font-weight: 600; }

/* ---------- section header ---------- */

.section {
  padding: 8px 16px 4px;
  display: flex; align-items: center; justify-content: space-between;
}
.section h3 {
  margin: 0; font-size: 20px; font-weight: 800; letter-spacing: 0.01em;
}
.section .link { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- promo carousel ---------- */

.promo-scroll {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 8px 16px 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.promo-scroll::-webkit-scrollbar { display: none; }
.promo-card {
  flex: 0 0 88%;
  scroll-snap-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface);
  cursor: pointer;
}
.promo-card img { width: 100%; height: 100%; object-fit: cover; }
.promo-card .promo-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.75) 100%);
}
.promo-card .promo-text {
  position: absolute; left: 18px; right: 18px; bottom: 16px;
}
.promo-card .promo-title {
  font-size: 18px; font-weight: 800; letter-spacing: 0.01em;
  color: #fff;
}
.promo-card .promo-sub {
  font-size: 12px; color: rgba(255,255,255,0.8); margin-top: 4px;
  font-weight: 600;
}
.promo-dots {
  display: flex; justify-content: center; gap: 6px;
  padding: 8px 0 0;
}
.promo-dots .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dim); transition: background 0.25s, width 0.25s;
  cursor: pointer;
}
.promo-dots .dot.on { background: var(--text); width: 18px; border-radius: 3px; }

/* ---------- category chips ---------- */

.chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 8px 16px 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.chip.active { background: var(--text); color: #0a0a0a; border-color: var(--text); }

/* Page head — used on catalog / category / profile screens */
.page-head {
  padding: 22px 20px 8px;
  display: flex; align-items: center; gap: 14px;
}
.page-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: 0.01em; flex: 1; }
.page-head .page-city {
  color: var(--muted); font-size: 12px; font-weight: 700;
  margin-left: auto;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
}
.hamburger {
  width: 40px; height: 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
}
.hamburger span {
  display: block; width: 16px; height: 2px; background: var(--text); border-radius: 1px;
}

.mini-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--surface-2);
  font-size: 14px;
}

/* Search input */
.search { padding: 4px 16px 8px; }
.search input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px; padding: 12px 14px;
}
.search input:focus { border-color: var(--gold); }

/* Category list — vertical rows with expandable subs */
.cat-list { padding: 8px 16px 0; }
.cat-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 8px;
  overflow: hidden;
}
.cat-item .cat-main {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  cursor: pointer;
}
.cat-item .cat-name {
  flex: 1; font-weight: 700; font-size: 15px;
}
.cat-item .cat-count {
  color: var(--muted); font-size: 11px; font-weight: 600;
  padding-right: 4px;
}
.cat-item .cat-arrow { display: none; }
.cat-item .cat-subs { display: none; padding: 0 8px 8px; }
.cat-item.open .cat-subs { display: block; }
.cat-item .sub-item {
  padding: 12px 14px; margin: 4px 0;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.cat-item .sub-item:hover { background: #262626; }
.cat-item .cat-all { color: var(--gold); }

/* ---------- product grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 4px 16px 24px;
}
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.card .img {
  aspect-ratio: 1/1;
  width: 100%;
  object-fit: cover;
  background: var(--surface-2);
}
.card .body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.card .name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.card .price { font-weight: 800; font-size: 14px; color: var(--gold); }
.card .rating { font-size: 11px; color: var(--muted); font-weight: 600; }
.card .promo {
  position: absolute; top: 8px; left: 8px;
  background: var(--gold); color: #111;
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em;
  padding: 3px 7px; border-radius: 999px;
}
.card .price.out { color: var(--muted); font-weight: 700; }

/* Product photo gallery — horizontal snap-scroll */
.gallery { position: relative; background: var(--surface); }
.gallery-scroll {
  display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.gallery-scroll img {
  flex: 0 0 100%; width: 100%; aspect-ratio: 4/3; object-fit: cover;
  scroll-snap-align: start;
}
.gallery-dots {
  position: absolute; left: 0; right: 0; bottom: 12px;
  display: flex; justify-content: center; gap: 6px;
}
.gallery-dots .dot {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5);
}
.gallery-dots .dot.on { background: #fff; width: 18px; border-radius: 3px; }

/* Filter groups (inside sheet) */
.fgroup { margin-bottom: 14px; }
.fgroup .flbl {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row-check {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 12px 14px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
}
.row-check input { width: auto; }
.filter-chip { color: var(--text); background: var(--surface-2); border-color: var(--border); }

/* order timer / dispute banner */
.timer {
  display: inline-block; margin-top: 4px;
  font-size: 11px; color: var(--gold); font-weight: 700;
}
.banner-note {
  padding: 12px 14px; border-radius: 12px;
  background: rgba(212,176,98,0.08);
  border: 1px solid rgba(212,176,98,0.3);
  color: var(--gold); font-size: 13px; font-weight: 600;
  text-align: center;
}

/* section h3.mini */
.section h3.mini {
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted);
}

.empty {
  padding: 40px 16px; text-align: center;
  color: var(--muted); font-size: 14px;
}

/* ---------- product page ---------- */

.pv {
  padding: 0 0 24px;
}
.pv .hero-img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  background: var(--surface);
}
.pv .head { padding: 20px 20px 8px; }
.pv h1 { margin: 0 0 6px; font-size: 26px; font-weight: 900; letter-spacing: 0.01em; }
.pv .rating { color: var(--muted); font-size: 13px; margin-bottom: 12px; font-weight: 600; }
.pv .desc { color: var(--muted); font-size: 14px; line-height: 1.5; padding: 0 20px 20px; }

.variants {
  padding: 0 20px 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.variant {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  background: var(--surface);
}
.variant.active { border-color: var(--text); background: var(--surface-2); }
.variant .amt { font-size: 13px; color: var(--muted); font-weight: 600; }
.variant .p   { font-size: 15px; font-weight: 800; margin-top: 4px; color: var(--gold); }
.variant .k   { font-size: 10px; margin-top: 4px; color: var(--muted); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }

.city-pick {
  margin: 0 20px 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  display: flex; align-items: center; justify-content: space-between;
}
.city-pick .val { font-weight: 700; }

.btn {
  display: block; width: calc(100% - 40px);
  margin: 8px 20px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--text); color: #0a0a0a;
  font-size: 15px; font-weight: 800;
  text-align: center; letter-spacing: 0.02em;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn:disabled { opacity: 0.5; }

.reviews { padding: 8px 20px 20px; }
.review {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px;
}
.review:last-child { border-bottom: 0; }
.review .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); }
.review .avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.review .who { font-weight: 700; font-size: 13px; }
.review .stars { color: var(--gold); font-size: 12px; }
.review .txt { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.4; }

.stars-input { display: flex; gap: 4px; padding: 0 20px 8px; font-size: 22px; color: var(--dim); }
.stars-input span.on { color: var(--gold); }
.review-form { padding: 0 20px 20px; }
.review-form textarea { min-height: 88px; resize: vertical; }

/* ---------- profile ---------- */

.prof {
  padding: 24px 16px 8px;
  display: flex; align-items: center; gap: 14px;
}
.prof .avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: var(--muted);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
}
.prof .avatar img { width: 100%; height: 100%; object-fit: cover; }
.prof .name { font-size: 20px; font-weight: 800; margin: 0; }
.prof .sub { font-size: 13px; color: var(--muted); font-weight: 600; }

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 10px 16px;
}
.tile h4 {
  margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--muted);
}
.balance-row { display: flex; align-items: baseline; gap: 8px; }
.balance-row .val { font-size: 30px; font-weight: 900; }
.balance-row .cur { font-size: 15px; color: var(--muted); font-weight: 700; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row-2 .btn { margin: 0; width: auto; padding: 12px; }

/* clickable row inside a tile (settings-style) */
.row-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 14px 4px;
  font-size: 14px; font-weight: 600; color: var(--text);
  background: transparent; text-align: left;
}
.row-btn + .row-btn { border-top: 1px solid rgba(255,255,255,0.04); }
.row-btn .lbl { font-weight: 600; }
.row-btn .val { color: var(--muted); font-weight: 700; font-size: 13px; }

.code {
  display: inline-block; padding: 2px 6px; background: var(--surface-2);
  border-radius: 4px; font-family: monospace; font-weight: 700; color: var(--gold);
}

.wallet-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0;
  font-size: 13px;
}
.wallet-row + .wallet-row { margin-top: 2px; }
.wallet-row .lbl { color: var(--muted); font-weight: 700; }
.wallet-row .addr { font-family: monospace; font-size: 11px; color: var(--muted); }
.wallet-row button { color: var(--gold); font-weight: 700; font-size: 12px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; }

.list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  font-size: 14px;
}
.list-row .lbl { font-weight: 600; }
.list-row .val { color: var(--muted); font-weight: 600; font-size: 13px; }

.order-row { display: flex; gap: 12px; padding: 12px 16px 12px 0; }
.order-row + .order-row { margin-top: 4px; }
.order-row img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.order-row .info { flex: 1; }
.order-row .info .n { font-weight: 700; font-size: 14px; }
.order-row .info .s { font-size: 12px; color: var(--muted); }
.order-row .st {
  align-self: flex-start;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
}
.order-row .st.delivered { background: rgba(212,176,98,0.15); color: var(--gold); }
.order-row .st.pending { background: rgba(255,255,255,0.06); color: var(--text); }

/* ---------- work page ---------- */

.work-hero {
  margin: 16px; height: 180px; position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.work-hero img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.55); }
.work-hero .t {
  position: absolute; inset: 0; padding: 24px;
  display: flex; align-items: flex-end;
  font-size: 32px; font-weight: 900; letter-spacing: 0.02em;
}
.work-body { padding: 0 20px 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.work-body h4 { color: var(--text); margin: 20px 0 8px; font-size: 16px; }

/* ---------- tabbar ---------- */

#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(10,10,10,0.94);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 8px calc(8px + var(--safe-bot));
  z-index: 100;
  justify-content: space-around;
}
#tabbar .tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px;
  color: var(--dim);
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
}
#tabbar .tab .ico { font-size: 20px; line-height: 1; }
#tabbar .tab.active { color: var(--text); }

/* ---------- modal ---------- */

.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeInBg 0.2s ease;
}
@keyframes fadeInBg { from { background: rgba(0,0,0,0); } to { background: rgba(0,0,0,0.75); } }
.modal .sheet {
  background: var(--bg);
  border-top-left-radius: 24px; border-top-right-radius: 24px;
  width: 100%; max-width: 780px;
  padding: 12px 20px calc(20px + var(--safe-bot));
  max-height: 82vh; overflow-y: auto;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal .sheet-drag {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--dim);
  margin: 0 auto 14px;
}
.modal h3 { margin: 0 0 16px; font-size: 18px; font-weight: 800; text-align: center; }
.modal .row { display: grid; gap: 10px; margin-bottom: 12px; }
.modal .actions { display: flex; gap: 10px; margin-top: 16px; }
.modal .actions .btn { flex: 1; margin: 0; width: auto; }

.sheet-tabs {
  display: flex; gap: 6px; padding: 4px;
  background: var(--surface);
  border-radius: 12px; margin-bottom: 14px;
}
.sheet-tab {
  flex: 1; padding: 10px;
  border-radius: 9px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  background: transparent;
}
.sheet-tab.active { background: var(--surface-2); color: var(--text); }

.city-list {
  margin-top: 10px;
  max-height: 50vh; overflow-y: auto;
}
.city-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  margin: 4px 0;
  font-size: 14px; font-weight: 600;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}
.city-row.active { background: var(--surface-2); color: var(--gold); }
.city-tag {
  font-size: 10px; font-weight: 800; letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface-2); padding: 4px 8px; border-radius: 6px;
}

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; top: 20px;
  transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  z-index: 300;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border); border-top-color: var(--text);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 14px 20px; font-size: 14px; font-weight: 700; color: var(--muted);
}
