/* Клиентский PWA — мобильные стили */
body {
  background: var(--c-bg);
  min-height: 100dvh;
  padding-bottom: calc(96px + var(--safe-bottom));
}

/* ===== App-shell ===== */
.appbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 12px;
  background: rgba(247, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(20,30,20,0.05);
}
.appbar h1 { margin: 0; font-size: 18px; font-weight: 700; }
.appbar .sub { font-size: 12px; color: var(--c-text-2); }
.appbar-back {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--c-surface); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; font-size: 18px; color: var(--c-text);
}

.appshell { max-width: 540px; margin: 0 auto; }
.content { padding: 16px; }

/* ===== Onboarding ===== */
.onboarding {
  min-height: 100dvh; padding: 24px;
  background: linear-gradient(160deg, #2D6A4F 0%, #1B4332 100%);
  color: #fff;
  display: flex; flex-direction: column; gap: 24px;
}
.onb-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.onb-logo { font-size: 64px; margin-bottom: 16px; }
.onb-title { font-size: 32px; font-weight: 800; line-height: 1.1; margin-bottom: 12px; }
.onb-sub { font-size: 16px; opacity: 0.85; line-height: 1.5; }
.onb-input {
  width: 100%; padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #fff; font-size: 16px;
}
.onb-input::placeholder { color: rgba(255,255,255,0.5); }
.onb-input:focus { outline: none; border-color: var(--c-accent); background: rgba(255,255,255,0.14); }
.onb-tg {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px; border-radius: var(--radius-md); width: 100%;
  background: #2AABEE; color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 6px 20px rgba(42,171,238,0.35);
}
.onb-or { text-align: center; color: rgba(255,255,255,0.6); font-size: 13px; }

/* ===== Карточки точек ===== */
.point-card {
  display: flex; gap: 14px; align-items: stretch;
  background: var(--c-surface);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s;
}
.point-card:active { transform: scale(0.98); }
.point-emoji {
  width: 58px; height: 58px; border-radius: 14px;
  display: grid; place-items: center; font-size: 30px; flex-shrink: 0;
}
.point-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.point-name { font-weight: 700; font-size: 16px; }
.point-sub { font-size: 13px; color: var(--c-text-2); }
.point-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.point-meta { text-align: right; display: flex; flex-direction: column; justify-content: space-between; }
.point-eta { font-weight: 700; font-size: 14px; color: var(--c-primary); }
.point-eta-label { font-size: 11px; color: var(--c-text-3); }

/* ===== Меню ===== */
.menu-section { margin-bottom: 24px; }
.menu-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--c-text-2); margin: 0 4px 12px;
}
.menu-item {
  display: flex; gap: 12px; align-items: stretch;
  background: var(--c-surface);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.menu-item.unavailable { opacity: 0.5; pointer-events: none; }
.menu-item-img {
  width: 76px; height: 76px; border-radius: 12px;
  display: grid; place-items: center; font-size: 38px; flex-shrink: 0;
  background: var(--c-surface-2);
}
.menu-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-item-name { font-weight: 700; font-size: 15px; line-height: 1.25; margin-bottom: 2px; }
.menu-item-desc { font-size: 12px; color: var(--c-text-2); line-height: 1.35; margin-bottom: auto; padding-bottom: 4px; }
.menu-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.menu-item-price { font-weight: 800; font-size: 15px; }
.menu-item-prep { font-size: 11px; color: var(--c-text-3); }
.qty-ctrl { display: inline-flex; align-items: center; gap: 8px; background: var(--c-primary-light); border-radius: 999px; padding: 4px; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--c-primary); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-size: 16px; line-height: 1;
}
.qty-btn:disabled { background: var(--c-text-3); }
.qty-num { min-width: 16px; text-align: center; font-weight: 700; font-size: 14px; color: var(--c-primary-dark); }
.add-btn {
  background: var(--c-primary); color: #fff; font-weight: 700; font-size: 14px;
  padding: 6px 14px; border-radius: 999px;
}

/* ===== Корзина (bottom bar) ===== */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: rgba(247, 248, 245, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(20,30,20,0.06);
  display: flex; justify-content: center;
}
.cartbar-inner { max-width: 540px; width: 100%; }
.cartbar-btn {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: var(--c-primary); color: #fff;
  padding: 14px 18px; border-radius: var(--radius-md);
  font-weight: 700; font-size: 16px;
  box-shadow: 0 8px 24px rgba(45,106,79,0.3);
}
.cartbar-count {
  background: rgba(255,255,255,0.22); padding: 4px 10px; border-radius: 999px; font-size: 13px;
}
.cartbar-eta { margin-left: auto; font-size: 13px; opacity: 0.85; }
.cartbar-total { font-weight: 800; font-size: 17px; }

/* ===== Слоты ===== */
.slots-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.slot {
  position: relative;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.slot:active { transform: scale(0.96); }
.slot-time { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.slot-status { font-size: 11px; color: var(--c-text-2); }
.slot-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 0 0 var(--radius-md) var(--radius-md); overflow: hidden; }
.slot-bar > div { height: 100%; transition: width 0.3s; }
.slot.free .slot-bar > div { background: var(--c-success); }
.slot.medium .slot-bar > div { background: var(--c-warning); }
.slot.high .slot-bar > div { background: #FB6D2F; }
.slot.full { opacity: 0.5; cursor: not-allowed; background: var(--c-surface-2); }
.slot.full .slot-bar > div { background: var(--c-danger); width: 100% !important; }
.slot.selected { border-color: var(--c-primary); background: var(--c-primary-light); transform: scale(1.02); box-shadow: 0 4px 14px rgba(45,106,79,0.2); }
.slot.recommended::before {
  content: 'самый ранний'; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: var(--c-accent); color: #1A1D24; font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.4px;
}

/* ===== Чекаут ===== */
.checkout-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--c-border);
}
.checkout-row:last-child { border-bottom: none; }
.checkout-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; font-weight: 800; font-size: 18px;
  border-top: 2px solid var(--c-text); margin-top: 8px;
}
.pay-method {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; background: var(--c-surface); border-radius: var(--radius-md); margin-bottom: 8px;
  border: 2px solid var(--c-border);
}
.pay-method.selected { border-color: var(--c-primary); background: var(--c-primary-light); }
.pay-method-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--c-surface-2); display: grid; place-items: center; font-size: 22px; }
.pay-method-body { flex: 1; }
.pay-method-name { font-weight: 700; font-size: 14px; }
.pay-method-sub { font-size: 12px; color: var(--c-text-2); }
.pay-radio {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--c-border); display: grid; place-items: center;
}
.pay-method.selected .pay-radio { border-color: var(--c-primary); }
.pay-method.selected .pay-radio::after {
  content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--c-primary);
}

/* ===== Активный заказ ===== */
.order-hero {
  background: linear-gradient(160deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  color: #fff; padding: 24px 20px 32px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  text-align: center; position: relative;
}
.order-hero-status { font-size: 13px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.order-hero-timer {
  font-size: 64px; font-weight: 800; line-height: 1; margin: 4px 0; letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}
.order-hero-label { font-size: 14px; opacity: 0.85; }
.order-progress {
  margin-top: 20px; height: 8px; background: rgba(255,255,255,0.15); border-radius: 999px; overflow: hidden;
}
.order-progress > div { height: 100%; background: var(--c-accent); border-radius: 999px; transition: width 0.4s; }
.order-num-large {
  background: rgba(255,255,255,0.12); display: inline-block; padding: 8px 20px;
  border-radius: 12px; font-size: 22px; font-weight: 800; margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.order-steps { padding: 20px 16px; }
.step {
  display: flex; gap: 14px; align-items: flex-start; padding: 12px 0;
  position: relative;
}
.step::before {
  content: ''; position: absolute; left: 13px; top: 32px; bottom: -8px; width: 2px; background: var(--c-border);
}
.step:last-child::before { display: none; }
.step-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-surface-2); color: var(--c-text-3);
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
  flex-shrink: 0; z-index: 1;
}
.step.done .step-mark { background: var(--c-primary); color: #fff; }
.step.active .step-mark { background: var(--c-accent); color: #1A1D24; box-shadow: 0 0 0 4px rgba(249, 168, 37, 0.25); }
.step-body { padding-top: 2px; }
.step-title { font-weight: 600; font-size: 14px; }
.step-time { font-size: 12px; color: var(--c-text-2); }

/* Карточка готового заказа */
.ready-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 20px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--c-success);
}
.ready-emoji { font-size: 56px; margin-bottom: 12px; }
.ready-num {
  display: inline-block; padding: 12px 28px; background: var(--c-primary-light); color: var(--c-primary-dark);
  border-radius: 16px; font-size: 36px; font-weight: 800; margin: 8px 0; letter-spacing: 1px;
}
.ready-instr { font-size: 14px; color: var(--c-text-2); margin: 12px 0; line-height: 1.5; }

/* История */
.history-card {
  background: var(--c-surface); border-radius: var(--radius-md); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
  display: flex; gap: 12px;
}
.history-num { font-weight: 800; color: var(--c-primary); font-size: 15px; }
.history-meta { flex: 1; }
.history-status { font-size: 12px; }

/* ===== Профиль ===== */
.profile-head {
  display: flex; gap: 14px; align-items: center;
  padding: 24px 16px;
}
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 800;
}
.profile-name { font-size: 20px; font-weight: 800; }
.profile-sub { font-size: 13px; color: var(--c-text-2); }

.menu-list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 14px; background: var(--c-surface); border-radius: var(--radius-md); margin-bottom: 8px;
}
.menu-list-icon { font-size: 22px; }
.menu-list-title { flex: 1; font-weight: 600; }
.menu-list-chev { color: var(--c-text-3); }

/* ===== История заказов ===== */
.history-filters {
  display: flex; gap: 6px; margin-bottom: 14px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.history-filter {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  font-size: 13px; font-weight: 600; color: var(--c-text-2);
  white-space: nowrap; cursor: pointer; transition: 0.15s;
}
.history-filter:hover { color: var(--c-text); }
.history-filter.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.history-filter-count {
  background: rgba(255,255,255,0.18); padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.history-filter:not(.active) .history-filter-count { background: var(--c-surface-2); color: var(--c-text-3); }

.history-date {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--c-text-3); margin: 16px 4px 8px;
}

.history-card-full {
  background: var(--c-surface); border-radius: var(--radius-md);
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.history-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.history-card-num { font-weight: 800; font-size: 16px; color: var(--c-primary); }
.history-items {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.history-item {
  background: var(--c-surface-2); padding: 4px 10px; border-radius: 999px;
  font-size: 12px; color: var(--c-text-2);
}
.history-cancel {
  background: var(--c-danger-light); color: var(--c-danger);
  padding: 8px 12px; border-radius: 8px; font-size: 12px;
  margin-bottom: 10px; line-height: 1.4;
}
.history-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 10px; border-top: 1px solid var(--c-border);
  flex-wrap: wrap;
}
.history-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.history-actions .btn { padding: 8px 14px; font-size: 13px; }

/* ===== ASAP-карточка ===== */
.asap-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #F9A825 0%, #FB6D2F 100%);
  color: #fff; border-radius: var(--radius-md);
  padding: 16px 18px; margin-bottom: 14px;
  width: 100%; text-align: left;
  box-shadow: 0 6px 18px rgba(249, 168, 37, 0.3);
  border: none; cursor: pointer; transition: transform 0.05s;
}
.asap-card:active { transform: scale(0.98); }
.asap-icon { font-size: 32px; }
.asap-body { flex: 1; min-width: 0; }
.asap-title { font-weight: 800; font-size: 16px; line-height: 1.2; }
.asap-sub { font-size: 12px; opacity: 0.92; margin-top: 2px; }
.asap-arrow { font-size: 22px; font-weight: 700; opacity: 0.9; }

.or-divider {
  text-align: center; margin: 16px 0 14px;
  color: var(--c-text-3); font-size: 12px; position: relative;
}
.or-divider::before, .or-divider::after {
  content: ''; position: absolute; top: 50%; width: 25%; height: 1px;
  background: var(--c-border);
}
.or-divider::before { left: 0; }
.or-divider::after { right: 0; }
.or-divider span { background: var(--c-bg); padding: 0 12px; }

/* ===== Стоп-лист бэйдж ===== */
.stop-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--c-danger); color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 700;
}

/* ===== Лояльность ===== */
.loyalty-card {
  background: linear-gradient(135deg, #2D6A4F 0%, #1B4332 50%, #143929 100%);
  color: #fff; border-radius: var(--radius-lg); padding: 20px; margin-top: 8px;
  position: relative; overflow: hidden;
}
.loyalty-card::after {
  content: '🍃'; position: absolute; right: -10px; top: -10px; font-size: 120px; opacity: 0.08; transform: rotate(20deg);
}
.loyalty-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.loyalty-label { font-size: 12px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.4px; }
.loyalty-balance { font-size: 36px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; margin-top: 4px; }
.loyalty-tier {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #1A1D24;
  white-space: nowrap;
}
.loyalty-stats {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.loyalty-stat-num { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.loyalty-stat-label { font-size: 12px; opacity: 0.7; }

/* ===== Любимые точки ===== */
.fav-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.fav-tile {
  background: var(--c-surface); border: 2px solid var(--c-border); border-radius: var(--radius-md);
  padding: 14px 10px; text-align: center; cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 96px;
}
.fav-tile.active { border-color: var(--c-accent); background: #FFF8E1; }
.fav-tile:active { transform: scale(0.97); }
.fav-star { position: absolute; top: 6px; right: 8px; color: var(--c-accent); font-size: 16px; }
.fav-tile .small { line-height: 1.2; }
