/* styles.css — все стили PWA программы лояльности */

/* ── ПЕРЕМЕННЫЕ ─────────────────────────────────────────────────────────── */
:root {
  --accent: #6366f1;
  --accent-light: #e0e7ff;
  --accent-dark: #4f46e5;
  --accent-2: #8b5cf6;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.14);
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --nav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  /* Уровни лояльности */
  --bronze: #cd7f32;
  --silver: #9ca3af;
  --gold: #f59e0b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1e;
    --surface: #141929;
    --surface-2: #1a2035;
    --border: #2a3348;
    --text: #f1f5f9;
    --text-2: #94a3b8;
    --text-3: #4b5568;
    --accent-light: #1e1b4b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  }
}

/* ── СБРОС И БАЗОВЫЕ СТИЛИ ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ── SPLASH SCREEN ──────────────────────────────────────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: splash-out 0.4s ease-in 0.4s forwards;
  opacity: 1;
}

.splash-logo {
  width: 96px;
  height: 96px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin-bottom: 24px;
  animation: splash-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.splash-title {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  animation: splash-fade 0.5s ease 0.1s both;
}

.splash-sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin-top: 8px;
  animation: splash-fade 0.5s ease 0.2s both;
}

.splash-dots {
  display: flex;
  gap: 6px;
  margin-top: 48px;
  animation: splash-fade 0.5s ease 0.3s both;
}

.splash-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}
.splash-dot:nth-child(1) {
  animation: dot-pulse 0.8s ease 0s infinite;
}
.splash-dot:nth-child(2) {
  animation: dot-pulse 0.8s ease 0.15s infinite;
}
.splash-dot:nth-child(3) {
  animation: dot-pulse 0.8s ease 0.3s infinite;
}

@keyframes splash-pop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes splash-fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes splash-out {
  to {
    opacity: 0;
    pointer-events: none;
  }
}
@keyframes dot-pulse {
  0%,
  100% {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1);
  }
  50% {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.3);
  }
}

/* ── ОНБОРДИНГ ──────────────────────────────────────────────────────────── */
.onboarding {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 500;
  display: flex;
  flex-direction: column;
}

.onboarding-slides {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.onboarding-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  text-align: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
}

.onboarding-slide.prev {
  transform: translateX(-100%);
  opacity: 0;
}
.onboarding-slide.active {
  transform: translateX(0);
  opacity: 1;
}
.onboarding-slide.next {
  transform: translateX(100%);
  opacity: 0;
}

.onboarding-icon {
  width: 140px;
  height: 140px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  margin-bottom: 32px;
}

.onboarding-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
  line-height: 1.2;
}

.onboarding-desc {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.6;
}

.onboarding-footer {
  padding: 24px 24px calc(24px + var(--safe-bottom));
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.onboarding-dot {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  transition: all 0.3s;
}
.onboarding-dot.active {
  background: var(--accent);
  width: 24px;
}
.onboarding-dot:not(.active) {
  width: 6px;
}

/* ── ЭКРАНЫ ─────────────────────────────────────────────────────────────── */
.screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  scroll-behavior: smooth;
  animation: screen-in 0.25s ease;
}

.screen.no-nav {
  padding-bottom: 0;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── НИЖНЯЯ НАВИГАЦИЯ ───────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s;
  -webkit-user-select: none;
  user-select: none;
  padding-bottom: 4px;
  position: relative;
}

.nav-item.active {
  color: var(--accent);
}
.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item.active svg {
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.4));
}

/* Badge на вкладке */
.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}

/* ── КАРТОЧКИ ───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-body {
  padding: 20px;
}
.card + .card {
  margin-top: 12px;
}

/* ── ТИПОГРАФИЯ ─────────────────────────────────────────────────────────── */
h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
h2 {
  font-size: 20px;
  font-weight: 600;
}
h3 {
  font-size: 17px;
  font-weight: 600;
}

.text-sm {
  font-size: 13px;
}
.text-xs {
  font-size: 11px;
}
.text-muted {
  color: var(--text-2);
}
.text-hint {
  color: var(--text-3);
}
.text-accent {
  color: var(--accent);
}
.text-success {
  color: var(--success);
}
.text-danger {
  color: var(--danger);
}

/* ── КНОПКИ ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
  -webkit-user-select: none;
  user-select: none;
  padding: 15px 20px;
  width: 100%;
}

.btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-sm {
  padding: 9px 16px;
  font-size: 13px;
  border-radius: 8px;
  width: auto;
}

/* ── ФОРМЫ ──────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.form-input::placeholder {
  color: var(--text-3);
}

/* ── АВТОРИЗАЦИЯ ────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}

.auth-header {
  background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 100%);
  padding: calc(40px + var(--safe-top)) 28px 40px;
  position: relative;
  overflow: hidden;
}

.auth-header::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.auth-header::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: -20px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.auth-logo {
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.auth-title {
  color: #fff;
  margin-bottom: 8px;
}
.auth-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
}

.auth-body {
  flex: 1;
  padding: 28px 24px 32px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-2);
}
.auth-switch span {
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

/* ── PIN ПОЛЕ ───────────────────────────────────────────────────────────── */
.pin-dots {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 12px 0 24px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.pin-key {
  height: 68px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.pin-key:active {
  background: var(--accent-light);
  transform: scale(0.93);
}
.pin-key.del {
  font-size: 18px;
}

/* ── QR-ЭКРАН ───────────────────────────────────────────────────────────── */
.qr-screen {
  padding: 0;
}

.qr-top {
  background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 100%);
  padding: calc(20px + var(--safe-top)) 20px 28px;
  position: relative;
  overflow: hidden;
}

.qr-top::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.qr-top::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: 20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.qr-greeting {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2px;
}
.qr-name {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

/* ── УРОВЕНЬ ЛОЯЛЬНОСТИ ─────────────────────────────────────────────────── */
.loyalty-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  margin-top: 8px;
}

.loyalty-progress {
  margin-top: 12px;
}

.loyalty-progress-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  margin-bottom: 6px;
}

.loyalty-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loyalty-progress-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
}

/* ── СТАТИСТИКА ─────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 16px 16px 0;
}

.stat-box {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-box-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}
.stat-box-label {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 3px;
}

/* ── QR-КАРТОЧКА ────────────────────────────────────────────────────────── */
.qr-card-wrap {
  padding: 16px;
}

.qr-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
  border-radius: var(--r-xl);
  padding: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(79, 70, 229, 0.4);
}

/* Блик на карточке */
.qr-card::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.qr-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.07) 0%,
    transparent 100%
  );
  pointer-events: none;
}

.qr-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.qr-card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 4px;
}

.qr-card-name {
  font-size: 18px;
  font-weight: 700;
}
.qr-card-number {
  font-size: 11px;
  opacity: 0.5;
  margin-top: 2px;
  font-family: monospace;
}

.qr-card-level {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.qr-image-wrap {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.qr-image-wrap img {
  width: 190px;
  height: 190px;
  display: block;
}

.qr-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.qr-expires {
  font-size: 11px;
  opacity: 0.65;
}
.qr-timer {
  font-weight: 700;
  font-size: 16px;
  opacity: 1 !important;
}

.qr-timer-wrap {
  text-align: right;
}
.qr-timer-label {
  font-size: 10px;
  opacity: 0.6;
  margin-bottom: 2px;
}

.qr-refresh-btn {
  width: 100%;
  padding: 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.qr-refresh-btn:active {
  background: var(--surface-2);
  transform: scale(0.98);
}

/* ── SKELETON LOADER ────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--border) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 8px;
}

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

.skeleton-card {
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* ── СПИСОК СКИДОК ──────────────────────────────────────────────────────── */
.page-wrap {
  padding: 16px;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 12px 18px;
  border: 1.5px solid var(--border);
  border-radius: 30px;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.categories::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.discount-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.discount-card {
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.discount-card:active {
  transform: scale(0.97);
}

.discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.discount-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: linear-gradient(135deg, var(--accent-light), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}

.discount-info {
  padding: 10px 12px 14px;
}
.discount-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
}
.price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.price-new {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}
.price-old {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: line-through;
}

/* ── АКЦИИ И НОВОСТИ ────────────────────────────────────────────────────── */
.promo-card {
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  transition: transform 0.2s;
}
.promo-card:active {
  transform: scale(0.99);
}

.promo-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
}

.promo-body {
  padding: 16px;
}
.promo-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}
.promo-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
}
.promo-date {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 10px;
}

/* ── ИСТОРИЯ ПОКУПОК ────────────────────────────────────────────────────── */
.purchase-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.purchase-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.purchase-info {
  flex: 1;
}
.purchase-store {
  font-size: 14px;
  font-weight: 600;
}
.purchase-date {
  font-size: 12px;
  color: var(--text-2);
}
.purchase-amount {
  text-align: right;
}
.purchase-total {
  font-size: 15px;
  font-weight: 700;
}
.purchase-saved {
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}

/* ── ПРОФИЛЬ ────────────────────────────────────────────────────────────── */
.profile-header {
  background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 100%);
  padding: calc(32px + var(--safe-top)) 24px 36px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
}
.profile-phone {
  font-size: 14px;
  opacity: 0.75;
  margin-top: 4px;
}
.profile-level {
  margin-top: 12px;
}

.profile-section {
  padding: 20px 16px;
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s;
}
.profile-item:active {
  transform: scale(0.98);
}
.profile-item-icon {
  font-size: 22px;
  width: 36px;
  text-align: center;
}
.profile-item-label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}
.profile-item-arrow {
  color: var(--text-3);
  font-size: 20px;
}

/* ── ОБЩИЕ УТИЛИТЫ ──────────────────────────────────────────────────────── */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}
.empty-state-icon {
  font-size: 60px;
  margin-bottom: 16px;
}
.empty-state-text {
  font-size: 16px;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9998;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}
.toast.success {
  background: var(--success);
  color: #fff;
}
.toast.error {
  background: var(--danger);
  color: #fff;
}

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  padding: calc(20px + var(--safe-top)) 16px 0;
  margin-bottom: 4px;
}

.load-more {
  text-align: center;
  padding: 16px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ── МОДАЛЬНОЕ ОКНО ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.modal-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 24px 24px calc(24px + var(--safe-bottom));
  animation: slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slide-up {
  from {
    transform: translateY(100%);
  }
}
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
}
