:root {
  --bg: #0a0d13;
  --bg-elevated: #12161f;
  --bg-elevated-2: #171c27;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-primary: #eef1f7;
  --text-secondary: #8b93a7;
  --text-muted: #5c6478;

  --accent: #3ea6ff;
  --accent-strong: #58b4ff;
  --accent-soft: rgba(62, 166, 255, 0.14);
  --accent-glow: 0 0 0 1px rgba(62, 166, 255, 0.35), 0 8px 24px rgba(62, 166, 255, 0.18);

  --success: #3ddc84;
  --warning: #ffb020;
  --danger: #ff5c5c;

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

  --tabbar-h: 74px;
  --topbar-h: 56px;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 15px;
  line-height: 1.45;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 0; height: 0; }

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}

/* ---------------------------------------------------------------- */
/* Topbar                                                            */
/* ---------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 13, 19, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 14px;
}

.brand__logo {
  color: var(--accent);
  font-size: 16px;
  filter: drop-shadow(0 0 6px rgba(62, 166, 255, 0.6));
}

.brand__name { color: var(--text-primary); }

.topbar__dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.dot--green { background: var(--success); color: var(--success); }
.dot--yellow { background: var(--warning); color: var(--warning); }
.dot--red { background: var(--danger); color: var(--danger); }

/* ---------------------------------------------------------------- */
/* Screens                                                            */
/* ---------------------------------------------------------------- */
.screen {
  display: none;
  flex: 1;
  padding: 16px;
  animation: fadeIn 0.18s ease;
}
.screen.is-active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 4px 0 16px;
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------- */
/* City selection                                                    */
/* ---------------------------------------------------------------- */
#screen-city.is-active { display: flex; align-items: center; }

.city-card {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 20px;
}

.city-card__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
}

.city-card__subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 20px;
}

.city-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.city-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.city-option:active { transform: scale(0.98); }
.city-option:hover, .city-option:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}
.city-option__arrow { color: var(--text-muted); }

/* ---------------------------------------------------------------- */
/* Age gate (18+/21+ verification)                                   */
/* ---------------------------------------------------------------- */
.age-gate-card { text-align: center; }
.age-gate-card__icon {
  font-size: 44px;
  margin-bottom: 8px;
}
.city-option--confirm {
  justify-content: center;
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}
.city-option--confirm:hover, .city-option--confirm:focus-visible {
  box-shadow: var(--accent-glow);
}
.city-option--decline {
  justify-content: center;
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}
.city-option--decline:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------------------------------------------------------------- */
/* Category chips                                                    */
/* ---------------------------------------------------------------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
}

.chip {
  flex: none;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: var(--accent-glow);
}

/* ---------------------------------------------------------------- */
/* Product grid                                                      */
/* ---------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.product-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.product-card:active { transform: scale(0.98); }
.product-card:hover { border-color: var(--border-strong); }

.product-card__photo-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-elevated-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-card__photo { width: 100%; height: 100%; object-fit: cover; }
.product-card__photo-placeholder { font-size: 30px; opacity: 0.35; }

.product-card__body { padding: 10px 12px 12px; }
.product-card__name {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card__price {
  font-size: 13px;
  color: var(--accent-strong);
  font-weight: 700;
}
.product-card__price span {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 11px;
}

/* ---------------------------------------------------------------- */
/* Buttons                                                            */
/* ---------------------------------------------------------------- */
.btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--primary {
  background: var(--accent);
  color: #06131f;
  box-shadow: 0 8px 20px rgba(62, 166, 255, 0.28);
}
.btn--primary:not(:disabled):hover { background: var(--accent-strong); }

.btn--ghost {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn--ghost:hover { border-color: var(--border-strong); }

.btn--block { width: 100%; }

.btn--icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 16px;
}

/* ---------------------------------------------------------------- */
/* Inputs                                                             */
/* ---------------------------------------------------------------- */
.input {
  width: 100%;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.input:focus { border-color: var(--accent); }
.input--textarea { min-height: 70px; resize: vertical; }
.input::placeholder { color: var(--text-muted); }

/* ---------------------------------------------------------------- */
/* Empty state                                                        */
/* ---------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state__icon { font-size: 38px; margin-bottom: 10px; opacity: 0.6; }
.empty-state__title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.empty-state__text { font-size: 13px; }

/* ---------------------------------------------------------------- */
/* Cart                                                                */
/* ---------------------------------------------------------------- */
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.cart-item__photo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-elevated-2);
  flex: none;
}

.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item__flavor { font-size: 12px; color: var(--text-secondary); }
.cart-item__price { font-size: 12.5px; color: var(--accent-strong); font-weight: 700; margin-top: 2px; }

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.cart-item__qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated-2);
  color: var(--text-primary);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cart-item__qty-value { min-width: 18px; text-align: center; font-size: 13px; font-weight: 600; }

.cart-note { margin-bottom: 14px; }

.cart-summary {
  position: sticky;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.cart-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.cart-summary__row span:last-child {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
}

/* ---------------------------------------------------------------- */
/* Orders                                                              */
/* ---------------------------------------------------------------- */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.order-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.order-card__id { font-weight: 700; font-size: 14px; }
.order-card__status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status--new { background: rgba(62, 166, 255, 0.14); color: var(--accent-strong); }
.status--booked { background: rgba(255, 176, 32, 0.14); color: var(--warning); }
.status--completed { background: rgba(61, 220, 132, 0.14); color: var(--success); }
.status--cancelled { background: rgba(255, 92, 92, 0.14); color: var(--danger); }

.order-card__items { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 8px; }
.order-card__items div { margin-bottom: 2px; }
.order-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.order-card__total { color: var(--accent-strong); font-weight: 700; font-size: 13.5px; }

/* ---------------------------------------------------------------- */
/* Profile                                                             */
/* ---------------------------------------------------------------- */
.profile-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 16px;
  margin-bottom: 16px;
}
.profile-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.profile-card__row:last-child { border-bottom: none; }
.profile-card__label { color: var(--text-secondary); }
.profile-card__value { font-weight: 600; }

/* ---------------------------------------------------------------- */
/* Tabbar                                                              */
/* ---------------------------------------------------------------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: rgba(10, 13, 19, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  position: relative;
  cursor: pointer;
}
.tab__icon { font-size: 20px; filter: grayscale(1); opacity: 0.6; transition: all 0.15s ease; }
.tab.is-active { color: var(--accent-strong); }
.tab.is-active .tab__icon { filter: none; opacity: 1; }

.tab__badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #06131f;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 8px rgba(62, 166, 255, 0.6);
}

[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------- */
/* Modal (карточка товара)                                            */
/* ---------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: flex-end;
}
.modal-overlay.is-open { display: flex; }

.modal {
  width: 100%;
  max-height: 88vh;
  background: var(--bg-elevated);
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.2s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 13, 19, 0.6);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.modal__photo-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-elevated-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal__photo { width: 100%; height: 100%; object-fit: contain; }

.modal__body { padding: 18px 18px 4px; }
.modal__title { font-size: 19px; font-weight: 800; margin: 0 0 6px; }
.modal__description { font-size: 13.5px; color: var(--text-secondary); margin: 0 0 18px; }

.modal__block { margin-bottom: 18px; }
.modal__block-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.tier-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tier-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 8px 12px;
  background: var(--bg-elevated-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.tier-row__price { color: var(--accent-strong); font-weight: 700; }

.flavor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.flavor-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.15s ease;
}
.flavor-chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); box-shadow: var(--accent-glow); }
.flavor-chip.is-disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 16px;
}
.qty-stepper__btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated-2);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
}
.qty-stepper__value { font-size: 18px; font-weight: 700; min-width: 24px; text-align: center; }

.modal__footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}
.modal__price { font-size: 18px; font-weight: 800; color: var(--accent-strong); }

/* ---------------------------------------------------------------- */
/* Toast                                                               */
/* ---------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 12px);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 200;
  white-space: nowrap;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
