/* =====================================================
   PokeTime — Premium Mobile App Design System
   ===================================================== */

:root {
  /* Brand palette: coral pink + teal + deep green */
  --accent:        #FB495E;   /* coral pink — primary */
  --accent-deep:   #E03048;   /* darker pink (hover/active) */
  --accent-light:  #FFE5E9;   /* pink wash */
  --accent-2:      #B8E6E2;   /* mint */

  --teal:          #14B8A6;   /* teal — secondary accent */
  --teal-deep:     #0E9586;
  --teal-light:    #E0F7F4;

  --bg:            #F0FAFB;   /* light cyan background */
  --surface:       #FFFFFF;
  --surface-2:     #E5F2F3;   /* slightly darker than bg */

  --ink:           #094947;   /* deep teal-green — text/dark */
  --ink-2:         #587A78;   /* muted teal-green */
  --ink-3:         #A8C0BE;   /* light teal-green */

  --brand-ink:     #094947;   /* firmly dark brand color — same in both themes (используется для фирменных тёмных фонов, градиентов и т.п., НЕ для текста) */

  --border:        #D7EAE8;
  --border-2:      #B8E6E2;

  --success:       #16A34A;
  --danger:        #DC2626;
  --warning:       #D97706;
  --info:          #2563EB;

  --shadow-xs: 0 1px 3px rgba(9,73,71,.05);
  --shadow-sm: 0 2px 8px rgba(9,73,71,.08);
  --shadow:    0 4px 20px rgba(9,73,71,.10);
  --shadow-lg: 0 12px 40px rgba(9,73,71,.15);

  --r-xs:  6px;
  --r-sm:  10px;
  --r:     14px;
  --r-lg:  20px;
  --r-xl:  28px;

  --tab-bar-h:  68px;
  --app-bar-h:  56px;
  --page-px:    16px;

  /* Legacy aliases for old templates */
  --poke-dark:        var(--ink);
  --poke-pink:        var(--accent);
  --poke-mint:        var(--accent-2);
  --poke-teal:        var(--accent);
  --poke-white:       var(--surface);
  --poke-bg:          var(--bg);
  --poke-light-green: var(--bg);
  --poke-card-shadow: var(--shadow-xs);
  --poke-card-border: 1px solid var(--border);
}

/* ── Dark theme ─────────────────────────────────────
   Глубокий тёмно-бирюзовый фон с сохранением фирменного
   кораллового акцента и мяты. */
[data-theme="dark"] {
  --bg:            #0B1F1D;
  --surface:       #142F2D;
  --surface-2:     #1B3A37;

  --ink:           #E6F1F0;
  --ink-2:         #9DBBB7;
  --ink-3:         #5E7E7A;

  --brand-ink:     #094947;   /* same as light theme — keeps brand gradients dark in dark theme */

  --border:        #1F4441;
  --border-2:      #2A5650;

  --accent:        #FB495E;
  --accent-deep:   #FF6B7E;
  --accent-light:  #3D1E22;
  --accent-2:      #B8E6E2;

  --teal:          #2DD4BF;
  --teal-deep:     #14B8A6;
  --teal-light:    #163D38;

  --success:       #22C55E;
  --danger:        #F87171;
  --warning:       #FBBF24;
  --info:          #60A5FA;

  --shadow-xs: 0 1px 3px rgba(0,0,0,.30);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.40);
  --shadow:    0 4px 20px rgba(0,0,0,.50);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.60);

  color-scheme: dark;
}
[data-theme="dark"] body { background: var(--bg); color: var(--ink); }

/* В тёмной теме навигационные плашки используют тёмный полупрозрачный фон */
[data-theme="dark"] .app-bar { background: rgba(20, 47, 45, 0.86); }
[data-theme="dark"] .bottom-tab-bar { background: rgba(20, 47, 45, 0.92) !important; border-top-color: var(--border) !important; box-shadow: 0 -4px 24px rgba(0,0,0,.4) !important; }
[data-theme="dark"] .desktop-nav { background: rgba(20, 47, 45, 0.92); border-bottom-color: var(--border); }

/* Светло-розовые фоны статусных бэйджей плохо читаются на тёмном — заменяем на тёмный с цветным акцентом */
[data-theme="dark"] .status-pending    { background: rgba(217,119,6,.15); color: #FBBF24; }
[data-theme="dark"] .status-cancelled  { background: rgba(248,113,113,.15); color: var(--danger); }
[data-theme="dark"] .alert-danger,
[data-theme="dark"] .alert-error       { background: rgba(248,113,113,.12) !important; color: var(--danger) !important; }
[data-theme="dark"] .alert-warning     { background: rgba(251,191,36,.12) !important; color: var(--warning) !important; }
[data-theme="dark"] .badge.bg-warning  { background: rgba(251,191,36,.15) !important; color: #FBBF24 !important; }
[data-theme="dark"] .badge.bg-danger   { background: rgba(248,113,113,.15) !important; color: var(--danger) !important; }
[data-theme="dark"] .btn-icon.danger,
[data-theme="dark"] .settings-row-icon.red,
[data-theme="dark"] [style*="background:#FFF1F2"] { background: rgba(248,113,113,.12) !important; }

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI',
               system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ── Mobile App Bar ────────────────────────────────── */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--app-bar-h);
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--page-px);
  gap: 10px;
}

.app-bar-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.app-bar-logo span { color: var(--accent); }

.app-bar-title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-bar-spacer { flex: 1; }

.app-bar-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  color: var(--ink);
  font-size: 19px;
  position: relative;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.app-bar-action:active { transform: scale(.90); background: var(--border); }

.cart-badge-app {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
  line-height: 1;
}
.cart-badge-app.visible { display: flex; }

/* ── Bottom Tab Bar ────────────────────────────────── */
.bottom-tab-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 99999 !important;
  display: flex !important;
  transform: none !important;
  max-width: none !important;
  background: #FFFFFF;
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid var(--border-2);
  box-shadow: 0 -4px 24px rgba(9, 73, 71, .08);
  align-items: flex-start;
  padding-top: 10px;
  padding-bottom: env(safe-area-inset-bottom, 6px);
  height: calc(var(--tab-bar-h) + env(safe-area-inset-bottom, 0px));
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1px;
  transition: color .15s, transform .1s;
  position: relative;
  text-decoration: none;
  padding: 0;
  background: none;
  border: none;
}
.tab-item:active { transform: scale(.88); }
.tab-item.active { color: var(--accent); }

.tab-item .bi {
  font-size: 22px;
  line-height: 1;
  display: block;
}

.tab-cart-badge {
  position: absolute;
  top: -3px;
  right: calc(50% - 21px);
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid #fff;
  line-height: 1;
}

/* ── Page wrapper ──────────────────────────────────── */
.page {
  padding-bottom: calc(var(--tab-bar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  min-height: 100vh;
}

/* ── Section helpers ───────────────────────────────── */
.section { padding: 0 var(--page-px); }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 24px var(--page-px) 12px;
}

.section-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.section-gap { height: 24px; }
.divider     { height: 8px; background: var(--bg); }

/* ── Hero Banner ───────────────────────────────────── */
.hero-banner {
  margin: 12px var(--page-px) 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  aspect-ratio: 2.1 / 1;
  background: linear-gradient(135deg, var(--brand-ink) 0%, var(--teal-deep) 50%, var(--accent) 100%);
  display: flex;
  align-items: flex-end;
  padding: 20px;
}

.hero-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .45;
  mix-blend-mode: luminosity;
}

.hero-banner-body { position: relative; z-index: 1; color: #fff; }

.hero-banner-title {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.hero-banner-sub {
  font-size: 12px;
  opacity: .80;
  margin-bottom: 16px;
}

.hero-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 22px;
  transition: transform .1s;
}
.hero-banner-btn:active { transform: scale(.94); }

/* ── Quick Actions ─────────────────────────────────── */
.quick-actions {
  display: flex !important;
  flex-direction: row;
  justify-content: space-between;
  gap: 10px;
  padding: 16px var(--page-px);
  width: 100%;
  box-sizing: border-box;
}

.quick-action {
  flex: 1 1 0;
  min-width: 0;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.quick-action-icon {
  width: 58px;
  height: 58px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  transition: transform .1s, background .15s;
  flex-shrink: 0;
}
.quick-action:active .quick-action-icon {
  transform: scale(.88);
  background: var(--surface-2);
}

.quick-action-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  text-align: center;
  white-space: nowrap;
}

/* ── Category Pills ────────────────────────────────── */
.cat-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  display: flex;
  gap: 8px;
  padding: 0 var(--page-px) 2px;
  margin-bottom: 14px;
}
.cat-scroll::-webkit-scrollbar { display: none; }

.cat-pill {
  flex-shrink: 0;
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Menu Card (horizontal) ────────────────────────── */
.menu-list { display: flex; flex-direction: column; gap: 10px; padding: 0 var(--page-px); }

.menu-card {
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  /* «парение» над поверхностью */
  transform: translateY(-2px);
  box-shadow:
    0 1px 2px rgba(9, 73, 71, .04),
    0 10px 28px rgba(9, 73, 71, .09);
  transition: transform .25s cubic-bezier(.4,.2,.2,1),
              box-shadow .25s cubic-bezier(.4,.2,.2,1);
}
.menu-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 2px 4px rgba(9, 73, 71, .06),
    0 18px 40px rgba(9, 73, 71, .14);
}
.menu-card:active {
  transform: translateY(0) scale(.985);
  box-shadow:
    0 1px 3px rgba(9, 73, 71, .05),
    0 4px 12px rgba(9, 73, 71, .08);
  transition-duration: .1s;
}
/* В тёмной теме тени плотнее и от чистого чёрного */
[data-theme="dark"] .menu-card {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .25),
    0 10px 28px rgba(0, 0, 0, .40);
}
[data-theme="dark"] .menu-card:hover {
  box-shadow:
    0 2px 6px rgba(0, 0, 0, .35),
    0 18px 40px rgba(0, 0, 0, .55);
}
[data-theme="dark"] .menu-card:active {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, .30),
    0 4px 12px rgba(0, 0, 0, .35);
}

.menu-card-img {
  width: 88px;
  height: 88px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}

.menu-card-body { flex: 1; min-width: 0; }

.menu-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-card-desc {
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-card-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: #fff;
  border-radius: 11px;
  border: none;
  font-size: 20px;
  line-height: 1;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.btn-add:active { transform: scale(.84); background: var(--accent-deep); }

/* ── Promo/About Card ──────────────────────────────── */
.promo-card {
  margin: 0 var(--page-px);
  background: var(--accent-light);
  border-radius: var(--r-xl);
  padding: 24px 20px;
}

.promo-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.3;
}

.promo-card-text {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 16px;
}

.promo-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--ink-2);
}

.promo-feature-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── Buttons ───────────────────────────────────────── */
.btn-primary-app {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 54px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(251,73,94,.30);
}
.btn-primary-app:hover  { background: var(--accent-deep); color: #fff; }
.btn-primary-app:active { transform: scale(.97); box-shadow: none; }

.btn-secondary-app {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 54px;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn-secondary-app:active { transform: scale(.97); background: var(--surface-2); }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  border: none;
  flex-shrink: 0;
}
.btn-icon:active { transform: scale(.88); }
.btn-icon.danger { background: #FFF1F2; color: var(--danger); }

/* ── Auth Screen ───────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  padding-top: env(safe-area-inset-top, 0px);
}

.auth-top {
  padding: 48px var(--page-px) 32px;
  text-align: center;
}

.auth-brand {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
  display: block;
  margin-bottom: 36px;
}
.auth-brand span { color: var(--accent); }

.auth-headline {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 14px;
  color: var(--ink-2);
}

.auth-form-area {
  flex: 1;
  padding: 0 var(--page-px) 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-footer-link {
  text-align: center;
  font-size: 14px;
  color: var(--ink-2);
  padding: 8px 0 24px;
}

.auth-footer-link a {
  color: var(--accent);
  font-weight: 600;
}

/* ── Form Inputs ───────────────────────────────────── */
.input-group-app {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.input-app {
  height: 52px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 0 16px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  width: 100%;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input-app::placeholder { color: var(--ink-3); }
.input-app:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(251,73,94,.12);
  background: var(--surface);
}
textarea.input-app {
  height: auto;
  padding: 14px 16px;
  resize: none;
  line-height: 1.5;
}

.input-hint {
  font-size: 11px;
  color: var(--ink-3);
}

/* ── Settings rows ─────────────────────────────────── */
.settings-section {
  background: var(--surface);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background .1s;
  cursor: pointer;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:active     { background: var(--bg); }

.settings-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--accent);
  flex-shrink: 0;
}

.settings-row-icon.green  { background: #F0FDF4; color: var(--success); }
.settings-row-icon.blue   { background: #EFF6FF; color: var(--info); }
.settings-row-icon.red    { background: #FFF1F2; color: var(--danger); }
.settings-row-icon.gray   { background: var(--surface-2); color: var(--ink-2); }

.settings-row-body { flex: 1; }
.settings-row-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.settings-row-value {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 1px;
}

.settings-row-arrow {
  color: var(--ink-3);
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Profile header ────────────────────────────────── */
.profile-hero {
  background: var(--surface);
  padding: 24px var(--page-px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -1px;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.profile-meta {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 2px;
}

/* ── Loyalty Card ──────────────────────────────────── */
.loyalty-card {
  margin: 0 var(--page-px);
  border-radius: var(--r-xl);
  padding: 26px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, var(--brand-ink) 0%, var(--teal-deep) 55%, var(--accent) 100%);
  min-height: 165px;
}

.loyalty-card::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.10);
  pointer-events: none;
}
.loyalty-card::after {
  content: '';
  position: absolute;
  bottom: -24px; right: 16px;
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.06);
  pointer-events: none;
}

.loyalty-brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: 10px;
}

.loyalty-balance {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}

.loyalty-unit {
  font-size: 13px;
  opacity: .65;
  margin-top: 4px;
  margin-bottom: 22px;
}

.loyalty-stats {
  display: flex;
  gap: 28px;
}

.loyalty-stat-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .55;
  margin-bottom: 3px;
}

.loyalty-stat-value {
  font-size: 16px;
  font-weight: 700;
}

/* ── QR Section ────────────────────────────────────── */
.qr-section {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  padding: 28px var(--page-px);
  margin: 0 var(--page-px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.qr-frame {
  background: #fff;
  border-radius: var(--r);
  padding: 10px;
  box-shadow: var(--shadow);
}

.qr-frame img {
  width: 200px;
  height: 200px;
  border-radius: 6px;
  display: block;
}

.qr-timer {
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.qr-timer.expired { color: var(--danger); }

.qr-hint {
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.5;
}

/* ── Order rows ────────────────────────────────────── */
.order-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.order-row:last-child { border-bottom: none; }

.order-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.order-body  { flex: 1; min-width: 0; }
.order-num   { font-size: 14px; font-weight: 600; color: var(--ink); }
.order-meta  { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.order-price { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pending    { background: #FFFBEB; color: #D97706; }
.status-preparing  { background: #EFF6FF; color: #2563EB; }
.status-delivering { background: #F0FDF4; color: var(--success); }
.status-delivered  { background: #F0FDF4; color: var(--success); }
.status-cancelled  { background: #FFF1F2; color: var(--danger); }

/* ── Recipe rows ───────────────────────────────────── */
.recipe-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.recipe-row:last-child { border-bottom: none; }

.recipe-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: var(--accent);
  flex-shrink: 0;
}

.recipe-body  { flex: 1; min-width: 0; }
.recipe-name  { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipe-meta  { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.recipe-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Contact info rows ─────────────────────────────── */
.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.contact-row:last-child { border-bottom: none; }

.contact-row-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--accent);
  flex-shrink: 0;
}
.contact-row-label { font-size: 11px; color: var(--ink-3); margin-bottom: 1px; font-weight: 500; letter-spacing: 0.3px; text-transform: uppercase; }
.contact-row-value { font-size: 15px; font-weight: 500; color: var(--ink); }

/* ── Empty state ───────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
  text-align: center;
  gap: 10px;
}

.empty-state-icon {
  font-size: 52px;
  opacity: .18;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.empty-state-sub {
  font-size: 13px;
  color: var(--ink-2);
}

/* ── Toast ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--app-bar-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: calc(100% - 32px);
  max-width: 400px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-app {
  background: rgba(9,73,71,.92);
  backdrop-filter: blur(20px);
  color: #fff;
  border-radius: var(--r);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in .3s cubic-bezier(.34,1.56,.64,1);
  pointer-events: auto;
}

.toast-app.toast-success { background: rgba(22,163,74,.92); }
.toast-app.toast-error   { background: rgba(220,38,38,.92); }
.toast-app.toast-warning { background: rgba(217,119,6,.92); }
.toast-app.toast-info    { background: rgba(37,99,235,.92); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Bootstrap overrides ───────────────────────────── */
.form-control, .form-select {
  height: 52px !important;
  background: var(--bg) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--r) !important;
  font-size: 15px !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  transition: border-color .15s, box-shadow .15s, background .15s !important;
}
.form-control::placeholder  { color: var(--ink-3) !important; }
.form-control:focus, .form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(251,73,94,.12) !important;
  background: var(--surface) !important;
}
textarea.form-control { height: auto !important; padding: 14px 16px !important; }

.form-label  { font-size: 13px !important; font-weight: 500 !important; color: var(--ink-2) !important; }
.form-text   { font-size: 11px !important; color: var(--ink-3) !important; }

.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  border-radius: var(--r) !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  color: #fff !important;
}
.btn-primary:hover  { background: var(--accent-deep) !important; border-color: var(--accent-deep) !important; }
.btn-primary:active { transform: scale(.97) !important; }

.btn-danger   { border-radius: var(--r-sm) !important; font-weight: 600 !important; }
.btn-sm       { border-radius: var(--r-sm) !important; }
.btn-lg       { border-radius: var(--r) !important; height: 54px !important; font-weight: 600 !important; }

.card {
  border: 1px solid var(--border) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--shadow-xs) !important;
}

.alert {
  border: none !important;
  border-radius: var(--r-sm) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}
.alert-success { background: #F0FDF4 !important; color: var(--success) !important; }
.alert-danger, .alert-error { background: #FFF1F2 !important; color: var(--danger) !important; }
.alert-warning { background: #FFFBEB !important; color: var(--warning) !important; }
.alert-info    { background: #EFF6FF !important; color: var(--info) !important; }

.badge.bg-warning  { background: #FFFBEB !important; color: #D97706 !important; }
.badge.bg-primary  { background: #EFF6FF !important; color: #2563EB !important; }
.badge.bg-success  { background: #F0FDF4 !important; color: var(--success) !important; }
.badge.bg-danger   { background: #FFF1F2 !important; color: var(--danger) !important; }
.badge.bg-info     { background: #F0FDF4 !important; color: var(--success) !important; }
.badge            { border-radius: 20px !important; font-weight: 600 !important; font-size: 11px !important; }

/* ── Desktop top nav (hidden by default, shown ≥1024px) ─ */
.desktop-nav { display: none; }

/* === Tablet (720-1023px): centered "phone-frame" layout === */
@media (min-width: 720px) and (max-width: 1023.98px) {
  body {
    background: #D7EAE8;
    min-height: 100vh;
  }

  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(circle at 25% 30%, rgba(251,73,94,.08), transparent 50%),
      radial-gradient(circle at 75% 70%, rgba(20,184,166,.08), transparent 55%);
    pointer-events: none;
    z-index: 0;
  }

  .app-bar {
    max-width: 460px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .page {
    max-width: 460px;
    margin: 0 auto;
    background: var(--bg);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 100vh;
    box-shadow: 0 20px 60px rgba(9,73,71,.12);
    position: relative;
    z-index: 1;
  }

  .bottom-tab-bar {
    max-width: none !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    border-left: none;
    border-right: none;
  }

  .toast-container { max-width: 420px; }

  .page.auth-page {
    box-shadow: none;
    border: none;
    background: transparent;
    max-width: 460px;
  }
}

/* === Desktop (≥1024px): full-width with top navigation === */
@media (min-width: 1024px) {
  :root { --page-px: 24px; }

  /* Hide mobile chrome */
  .app-bar       { display: none !important; }
  .bottom-tab-bar { display: none !important; }

  /* Show desktop top nav */
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 32px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .desktop-nav-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.5px;
    flex-shrink: 0;
  }
  .desktop-nav-logo span { color: var(--accent); }

  .desktop-nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
    margin-left: 8px;
  }
  .desktop-nav-link {
    padding: 9px 14px;
    border-radius: 10px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
    white-space: nowrap;
  }
  .desktop-nav-link:hover { background: var(--surface-2); color: var(--ink); }
  .desktop-nav-link.active {
    background: var(--accent-light);
    color: var(--accent);
  }

  .desktop-nav-login {
    padding: 9px 18px;
    border-radius: 10px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid var(--border-2);
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
  }
  .desktop-nav-login:hover {
    background: var(--surface-2);
    border-color: var(--accent);
  }

  .desktop-nav-action {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--ink);
    font-size: 19px;
    transition: background .15s, transform .1s;
    flex-shrink: 0;
  }
  .desktop-nav-action:hover { background: var(--border); }
  .desktop-nav-action .cart-badge-app {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--surface);
    line-height: 1;
  }
  .desktop-nav-action .cart-badge-app.visible { display: flex; }

  /* Page: centered content with comfortable max-width */
  .page {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
    padding-bottom: 56px;
    min-height: calc(100vh - 70px);
  }

  /* Reset per-section side paddings to use page padding */
  .section,
  .section-header,
  .cat-scroll,
  .menu-list,
  .quick-actions {
    padding-left: 0;
    padding-right: 0;
  }
  .hero-banner,
  .promo-card,
  .qr-section,
  .loyalty-card,
  .loyalty-flip-wrap {
    margin-left: 0;
    margin-right: 0;
  }
  .shelf-scroll { padding-left: 0; padding-right: 0; }

  /* Hero banner — bigger and wider */
  .hero-banner {
    aspect-ratio: 3.6 / 1;
    margin-top: 28px;
    border-radius: 28px;
    padding: 40px;
  }
  .hero-banner-title { font-size: 36px; margin-bottom: 8px; }
  .hero-banner-sub   { font-size: 15px; margin-bottom: 22px; }
  .hero-banner-btn   { font-size: 15px; padding: 12px 24px; }

  /* Quick actions: equal spacing */
  .quick-actions { padding-top: 28px; padding-bottom: 28px; gap: 16px; }
  .quick-action-icon {
    width: 76px;
    height: 76px;
    font-size: 30px;
    border-radius: 22px;
  }
  .quick-action-label { font-size: 13px; }

  /* Section header */
  .section-header { padding-top: 32px; padding-bottom: 16px; }
  .section-title  { font-size: 24px; }

  /* Menu grid: 4 columns of card-with-image-on-top */
  .menu-list {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
  .menu-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s, border-color .15s;
  }
  .menu-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border-2);
  }
  .menu-card-img {
    width: 100%;
    height: 200px;
    border-radius: 0;
  }
  .menu-card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
  .menu-card-name {
    font-size: 16px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    margin-bottom: 4px;
  }
  .menu-card-desc {
    font-size: 13px;
    flex: 1;
    margin-bottom: 14px;
  }
  .menu-card-price { font-size: 18px; }
  .btn-add { width: 38px; height: 38px; font-size: 22px; }

  /* Skeleton matches grid card shape */
  .menu-card-skel {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }
  .menu-card-skel .sk-img  { width: 100%; height: 200px; border-radius: 0; }
  .menu-card-skel .sk-body { padding: 16px 18px 18px; gap: 10px; }

  /* Promo / About card: 2-column with content on left */
  .promo-card {
    padding: 40px 44px;
    border-radius: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
    row-gap: 6px;
    align-items: start;
  }
  .promo-card-title {
    font-size: 26px;
    grid-column: 1 / -1;
    margin-bottom: 4px;
  }
  .promo-card-text {
    font-size: 15px;
    grid-column: 1 / -1;
    margin-bottom: 14px;
  }
  .promo-feature { font-size: 14px; }
  .promo-card > div:last-child { grid-column: 1 / -1; margin-top: 12px; }
  .promo-card .btn-primary-app { max-width: 280px !important; }

  /* Settings rows (contacts list etc.) — comfortable but not stretched */
  .settings-section { max-width: 720px; }

  /* Toast container — under top nav */
  .toast-container { top: 84px; max-width: 420px; }

  /* Auth page — keep centered card on desktop */
  .page.auth-page {
    max-width: 480px;
    padding-left: 32px;
    padding-right: 32px;
  }

  /* Shelf cards (horizontal popular row) — a bit larger */
  .shelf-card { width: 200px; }
  .shelf-card-img { height: auto; aspect-ratio: 1/1; }
}

/* Even wider screens: more breathing room */
@media (min-width: 1440px) {
  .menu-list { gap: 24px; }
  .hero-banner { aspect-ratio: 4 / 1; }
}

/* ── Utility ───────────────────────────────────────── */
.text-accent  { color: var(--accent); }
.text-muted-app { color: var(--ink-2); font-size: 13px; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.gap-4px { gap: 4px; }
.rounded-full { border-radius: 50%; }

/* ── Preorder page ─────────────────────────────────── */
.preorder-page { min-height: 100vh; background: var(--bg); }

.preorder-hero {
  background: linear-gradient(135deg, var(--brand-ink) 0%, var(--teal-deep) 50%, var(--accent) 100%);
  padding: 36px 16px 28px;
  margin-bottom: 24px;
  color: #fff;
  text-align: center;
}

.preorder-hero h1 {
  font-size: 1.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-bottom: .4rem;
  letter-spacing: -.3px;
}

.preorder-hero p { font-size: .95rem; opacity: .80; margin: 0; }

.section-card,
.checkout-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  height: 100%;
}

.cart-section { position: sticky; top: 70px; height: fit-content; }

.section-title.card-title,
.card-header h2 {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 1.1rem;
  padding-bottom: .7rem;
  border-bottom: 1.5px solid var(--border);
  font-weight: 700;
}

.card-header-section {
  margin-bottom: 1.25rem;
  padding-bottom: .9rem;
  border-bottom: 1.5px solid var(--border);
}

.card-header-section h2 {
  font-size: 1.15rem;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: .2rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-header-section h2 i { color: var(--accent); }
.card-header-section p { color: var(--ink-2); font-size: .875rem; margin: 0; }

.form-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; padding-bottom: 0; }

.form-section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  color: var(--ink);
  margin-bottom: .8rem;
  font-weight: 600;
}
.form-section-title i { color: var(--accent); }

.cart-item-page {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1rem;
  border-radius: var(--r-sm);
  margin-bottom: .6rem;
  background: var(--bg);
  border: 1px solid transparent;
  transition: background .15s, box-shadow .15s;
}
.cart-item-page:hover {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

.cart-item-details {
  flex: 1 1 auto;
  min-width: 0;
}
.cart-item-details h3 {
  font-size: .9rem;
  color: var(--ink);
  margin-bottom: .15rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-item-details p  { color: var(--ink-2); font-size: .8rem; }

.cart-item-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.cart-item-price {
  flex: 0 0 72px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--border-2);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all .15s;
}
.qty-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.qty-value { font-size: .9rem; font-weight: 700; min-width: 20px; text-align: center; }

.remove-item {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: #FFF1F2;
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  margin-left: .2rem;
}
.remove-item:hover { background: var(--danger); color: #fff; }

.empty-cart { text-align: center; padding: 2.5rem 1.5rem; color: var(--ink-2); }
.empty-icon { font-size: 2.5rem; display: block; margin-bottom: .7rem; opacity: .3; color: var(--ink); }
.empty-link {
  display: inline-block;
  margin-top: .7rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 7px 18px;
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  font-size: .875rem;
  transition: all .15s;
}
.empty-link:hover { background: var(--accent); color: #fff; }

.cart-summary {
  margin-top: 1.1rem;
  padding: 1.1rem;
  background: linear-gradient(135deg, var(--brand-ink) 0%, var(--teal-deep) 55%, var(--accent) 100%);
  border-radius: var(--r);
  color: #fff;
}
.summary-row { display: flex; justify-content: space-between; padding: .35rem 0; font-size: .9rem; }
.summary-value { font-weight: 700; }
.summary-value.price { font-size: 1.25rem; }

/* ── Skeleton loaders ──────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    #E4DFD8 40%,
    var(--surface-2) 80%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.menu-card-skel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.menu-card-skel .sk-img  { width: 88px; height: 88px; border-radius: var(--r-sm); flex-shrink: 0; }
.menu-card-skel .sk-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.menu-card-skel .sk-line { height: 11px; }
.menu-card-skel .sk-line.w-60 { width: 60%; }
.menu-card-skel .sk-line.w-90 { width: 90%; }
.menu-card-skel .sk-line.w-40 { width: 40%; }
.menu-card-skel .sk-line.w-25 { width: 25%; height: 16px; }

/* ── Bottom Sheet ──────────────────────────────────── */
.bs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: background .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.bs-overlay.open { background: rgba(0,0,0,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

.bs-sheet {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 14px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.32, .72, 0, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,.18);
}
.bs-overlay.open .bs-sheet { transform: translateY(0); }

.bs-handle {
  width: 38px;
  height: 4px;
  background: var(--border-2);
  border-radius: 2px;
  margin: 0 auto 18px;
}

.bs-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.bs-message {
  font-size: 14px;
  color: var(--ink-2);
  text-align: center;
  margin-bottom: 22px;
  line-height: 1.5;
}

.bs-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Image fade-in ─────────────────────────────────── */
img.fade-in {
  opacity: 0;
  transition: opacity .35s ease;
  background-color: var(--surface-2);
}
img.fade-in.loaded { opacity: 1; }

/* ── View Transitions (Chrome/Safari/etc.) ─────────── */
@supports (view-transition-name: none) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.22s;
    animation-timing-function: cubic-bezier(.32, .72, 0, 1);
  }
  ::view-transition-old(root) { animation-name: vt-fade-out; }
  ::view-transition-new(root) { animation-name: vt-fade-in;  }
}

@keyframes vt-fade-out {
  to   { opacity: 0; }
}
@keyframes vt-fade-in {
  from { opacity: 0; }
}

/* ── Loyalty card flip ─────────────────────────────── */
.loyalty-flip-wrap {
  perspective: 1200px;
  margin: 0 var(--page-px);
}

.loyalty-flip {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.32, .72, 0, 1);
  cursor: pointer;
}
.loyalty-flip.flipped { transform: rotateY(180deg); }

.loyalty-flip > .loyalty-card,
.loyalty-flip > .loyalty-card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  margin: 0 !important;
}

.loyalty-flip > .loyalty-card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  background: linear-gradient(140deg, var(--accent-deep) 0%, var(--brand-ink) 50%, var(--teal-deep) 100%);
  border-radius: var(--r-xl);
  padding: 24px 22px;
  color: #fff;
  overflow: hidden;
}

.loyalty-back-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: 14px;
}

.loyalty-back-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 130px;
  overflow-y: auto;
}

.loyalty-back-list::-webkit-scrollbar { width: 3px; }
.loyalty-back-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 3px; }

.loyalty-back-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.loyalty-back-row:last-child { border-bottom: none; }
.loyalty-back-row .lb-amount.plus  { color: #4ADE80; font-weight: 700; }
.loyalty-back-row .lb-amount.minus { color: #FCA5A5; font-weight: 700; }
.loyalty-back-row .lb-desc { opacity: .8; font-size: 12px; }

.loyalty-flip-hint {
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 10px;
  letter-spacing: .3px;
}

/* ── Menu shelves (horizontal product rows) ────────── */
.shelf {
  margin-top: 4px;
}

.shelf-scroll {
  display: flex;
  gap: 12px;
  padding: 12px var(--page-px) 28px;  /* доп. вертикальное пространство для теней */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.shelf-scroll::-webkit-scrollbar { display: none; }

.shelf-card {
  flex-shrink: 0;
  width: 160px;
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
  overflow: hidden;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  /* «парение» над поверхностью — как у .menu-card */
  transform: translateY(-2px);
  box-shadow:
    0 1px 2px rgba(9, 73, 71, .04),
    0 10px 24px rgba(9, 73, 71, .08);
  transition: transform .25s cubic-bezier(.4,.2,.2,1),
              box-shadow .25s cubic-bezier(.4,.2,.2,1);
}
.shelf-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 2px 4px rgba(9, 73, 71, .06),
    0 16px 36px rgba(9, 73, 71, .12);
}
.shelf-card:active {
  transform: translateY(0) scale(.985);
  box-shadow:
    0 1px 3px rgba(9, 73, 71, .05),
    0 4px 12px rgba(9, 73, 71, .08);
  transition-duration: .1s;
}
[data-theme="dark"] .shelf-card {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .25),
    0 10px 24px rgba(0, 0, 0, .38);
}
[data-theme="dark"] .shelf-card:hover {
  box-shadow:
    0 2px 6px rgba(0, 0, 0, .35),
    0 16px 36px rgba(0, 0, 0, .52);
}
[data-theme="dark"] .shelf-card:active {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, .28),
    0 4px 12px rgba(0, 0, 0, .35);
}

.shelf-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  background: var(--surface-2);
}

.shelf-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shelf-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shelf-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-top: auto;
}

.shelf-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.shelf-card-foot .btn-add {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 17px;
}
