:root {
  --bg-main: #050013;
  --bg-elevated: #0b0224;
  --accent-pink: #ff2d92;
  --accent-cyan: #00e6ff;
  --accent-purple: #7a2bff;
  --text-main: #ffffff;
  --text-muted: #a0a0c0;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #24003d, #050013 55%);
  color: var(--text-main);
}

.app-root {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  /* Дополнительно отодвигаем контент вниз ~72px, чтобы не залезать под верхнюю панель Telegram/"остров" и кнопку "Закрыть" */
  padding: calc(env(safe-area-inset-top, 16px) + 12px) 16px
    calc(env(safe-area-inset-bottom, 16px) + 8px);
  /* Внешний контейнер не скроллится, скролл только внутри .screen-scroll */
  overflow: hidden;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* позволяет внутренним блокам со flex:1 корректно скроллиться */
}

/* Внутренний скролл-контейнер экрана: верх/низ остаются на месте,
   прокручивается только центральный контент (списки товаров и т.п.) */
.screen-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Хедер города: слева название, справа кнопка смены города */
.city-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.city-header-title {
  flex: 1 1 auto;
  min-width: 0;
}

.city-header-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.brand-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 45, 146, 0.32), rgba(0, 230, 255, 0.16));
  font-size: 13px;
  font-weight: 600;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(0, 230, 255, 0.8);
  object-fit: cover;
}

.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.brand-logo {
  width: 220px;
  max-width: 70vw;
  margin-bottom: 32px;
}

.splash-logo-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  margin-bottom: 24px;
  animation: splashToTop 0.55s ease-out;
}

.city-title {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.city-picker {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scroll-snap-type: y mandatory;
}

/* Скрываем системный скроллбар в большинстве браузеров */
.city-picker {
  scrollbar-width: none; /* Firefox */
}

.city-picker::-webkit-scrollbar {
  width: 0; /* WebKit */
  height: 0;
}

.city-picker::before,
.city-picker::after {
  content: "";
  position: sticky;
  left: 0;
  right: 0;
  height: 40px;
  pointer-events: none;
  z-index: 1;
}

.city-picker::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(5, 0, 19, 0.95), transparent);
}

.city-picker::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(5, 0, 19, 0.95), transparent);
}

.city-picker .card {
  scroll-snap-align: center;
  width: 100%;
  text-align: center;
}

/* Кнопки выбора города: принудительно светлый текст и отключение нативного стилизования кнопок,
   чтобы на Windows/Android Telegram текст не становился чёрным */
.city-picker button.card {
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(135deg, #0b0224, #12052f);
  color: var(--text-main) !important;
}

/* Любые кнопки-карточки (города, разделы магазина и т.п.) и весь их контент
   форсируем в светлый цвет, чтобы перебить системный стиль кнопок
   на Android/Windows/Telegram */
button.card,
button.card * {
  color: var(--text-main) !important;
  -webkit-text-fill-color: var(--text-main) !important;
}

.city-item-active {
  transform: scale(1.04) translateZ(0);
  border-color: rgba(0, 230, 255, 0.9);
  background: linear-gradient(90deg, rgba(0, 230, 255, 0.18), rgba(255, 45, 146, 0.26));
  position: relative;
  z-index: 2;
  /* Ещё более сильное неоновое свечение для выбранного города */
  text-shadow:
    0 0 10px rgba(0, 230, 255, 1),
    0 0 22px rgba(255, 45, 146, 1);
}

.city-item-dim {
  opacity: 0.55;
}

@keyframes splashToTop {
  from {
    transform: translateY(30vh) scale(1.05);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.fade-out {
  animation: fadeOut 0.5s ease-in forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Слайд-анимации между основными разделами (магазин/корзина/админ) */
.slide-left {
  animation: slideLeft 0.35s ease-out forwards;
}

.slide-right {
  animation: slideRight 0.35s ease-out forwards;
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.bottom-nav {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  margin-bottom: 4px; /* чуть выше системной полосы */
}

.bottom-nav.hidden {
  display: none;
}

.nav-button {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 45, 146, 0.22), rgba(0, 230, 255, 0.08));
  color: var(--text-main);
  font-size: 14px;
}

.nav-button.active {
  border-color: var(--accent-pink);
  box-shadow: 0 0 16px rgba(255, 45, 146, 0.5);
}

/* Компактная кнопка "Назад" в верхней части экрана товаров */
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  margin-top: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 0, 19, 0.8);
  color: var(--text-main);
  font-size: 14px;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.card {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0b0224, #12052f);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 14px;
  /* Явно задаём цвет текста для карточек, чтобы на кнопках на Windows/Android текст не становился чёрным */
  color: var(--text-main);
}

.card-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-product-text {
  flex: 1;
  min-width: 0;
}

.card-product-image {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  /* картинка полностью помещается внутрь */
  object-fit: contain;
  /* Белый фон под PNG без фона */
  background: #ffffff;
  padding: 4px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  /* Базовый светлый цвет заголовков */
  color: var(--text-main);
}

/* Неоновое свечение для заголовков разделов (Напитки, Энергетики и т.д.) */
button.card[data-role="section"] .card-title {
  text-shadow:
    0 0 6px rgba(0, 230, 255, 0.9),
    0 0 14px rgba(255, 45, 146, 0.9);
}

.card-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* Бейджи статусов в админ-панели */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
}

.status-paid {
  background: rgba(0, 200, 120, 0.18);
  color: #4ef2a3;
}

.status-rejected {
  background: rgba(255, 45, 146, 0.18);
  color: #ff6b9e;
}

.status-processing {
  background: rgba(255, 184, 0, 0.18);
  color: #ffd36b;
}

/* Превью чеков в админ-панели */
.admin-receipt-thumb-link {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 8px;
}

.admin-receipt-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.soft-toggle {
  transition: opacity 0.22s ease-out, max-height 0.22s ease-out, transform 0.22s ease-out;
  overflow: hidden;
}

.soft-hidden {
  opacity: 0;
  max-height: 0;
  transform: translateY(4px);
  pointer-events: none;
}

.soft-visible {
  opacity: 1;
  max-height: 60px;
  transform: translateY(0);
}

.cart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 0, 19, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.icon-btn.danger {
  border-color: rgba(255, 45, 146, 0.8);
  color: var(--accent-pink);
}

.btn-primary {
  margin-top: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-cyan));
  color: #fff;
  font-size: 15px;
}

.btn-primary:disabled {
  opacity: 0.4;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.input-group label {
  font-size: 13px;
  color: var(--text-muted);
}

.input-group input {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 0, 19, 0.85);
  color: var(--text-main);
}
