/*
 * TELEGRAM MINI APP — НЕЙЛ-МАСТЕР «АНАСТАСИЯ»
 * Дизайн-система в стиле нативного Telegram
 *
 * Файл разделён на секции:
 * 1. CSS-переменные и тема
 * 2. Сброс и базовые стили
 * 3. Splash-экран
 * 4. Контейнер экранов и переходы
 * 5. Нижняя навигация (Tab Bar)
 * 6. Типографика
 * 7. Кнопки
 * 8. Карточки и списки
 * 9. Чипы (фильтры)
 * 10. Экран: Главная
 * 11. Экран: Услуги
 * 12. Экран: Карточка услуги
 * 13. Экран: Выбор даты
 * 14. Экран: Подтверждение
 * 15. Экран: Успех
 * 16. Экран: Галерея
 * 17. Экран: Мои записи
 * 18. Lightbox
 * 19. Bottom Sheet
 * 20. Утилиты и анимации
 */


/* ============================================================
   1. CSS-ПЕРЕМЕННЫЕ / ТЕМА
   Фолбэки для тестирования в браузере без Telegram SDK.
   В Telegram SDK автоматически выставляет --tg-theme-* на :root.
   ============================================================ */
:root {
  /* Telegram тема — фолбэки для браузера */
  --tg-theme-bg-color: #ffffff;
  --tg-theme-secondary-bg-color: #f2f2f7;
  --tg-theme-text-color: #000000;
  --tg-theme-hint-color: #8e8e93;
  --tg-theme-link-color: #2AABEE;
  --tg-theme-button-color: #2AABEE;
  --tg-theme-button-text-color: #ffffff;
  --tg-theme-destructive-text-color: #FF3B30;

  /* Семантические переменные (используем везде в коде) */
  --bg:         var(--tg-theme-bg-color);
  --bg2:        var(--tg-theme-secondary-bg-color);
  --text:       var(--tg-theme-text-color);
  --hint:       var(--tg-theme-hint-color);
  --accent:     var(--tg-theme-button-color);
  --accent-txt: var(--tg-theme-button-text-color);
  --link:       var(--tg-theme-link-color);
  --danger:     #FF3B30;
  --success:    #34C759;
  --warning:    #FF9500;

  /* Производные */
  --accent-soft:   rgba(42, 171, 238, 0.12);
  --danger-soft:   rgba(255, 59, 48, 0.10);
  --success-soft:  rgba(52, 199, 89, 0.12);
  --separator:     rgba(60, 60, 67, 0.12);
  --overlay:       rgba(0, 0, 0, 0.4);

  /* Размеры */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-pill: 100px;

  /* Нижняя навигация */
  --tab-h:       58px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);

  /* Переходы */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Тёмная тема — переопределяем только нужные значения */
@media (prefers-color-scheme: dark) {
  :root {
    --tg-theme-bg-color: #1c1c1e;
    --tg-theme-secondary-bg-color: #2c2c2e;
    --tg-theme-text-color: #ffffff;
    --tg-theme-hint-color: #8e8e93;
    --separator: rgba(84, 84, 88, 0.6);
  }
}


/* ============================================================
   2. СБРОС И БАЗОВЫЕ СТИЛИ
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  /* Блокируем зум на iOS при фокусе на инпуте */
  font-size: 16px;
}

body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg2);
  color: var(--text);
  overflow: hidden;
  /* Предотвращаем bounce-scroll на iOS */
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

img {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  font-size: 16px; /* меньше 16px — Safari зумирует */
  border: none;
  outline: none;
  background: none;
  color: var(--text);
}

a {
  color: var(--link);
  text-decoration: none;
}

/* Скроллбары — убираем для мобильного вида */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }


/* ============================================================
   3. SPLASH-ЭКРАН
   ============================================================ */
.splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Аватар с инициалами */
.splash-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2AABEE 0%, #1a85c8 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 4px;
  box-shadow: 0 8px 24px rgba(42, 171, 238, 0.3);
}

.splash-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.splash-sub {
  font-size: 14px;
  color: var(--hint);
}

/* Анимированные точки загрузки */
.splash-dots {
  display: flex;
  gap: 6px;
  margin-top: 16px;
}

.splash-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: splash-pulse 1.2s ease-in-out infinite;
}

.splash-dot:nth-child(2) { animation-delay: 0.2s; }
.splash-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes splash-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1);   }
}


/* ============================================================
   4. КОНТЕЙНЕР ЭКРАНОВ И ПЕРЕХОДЫ
   ============================================================ */
.screens-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Снизу — высота tab bar + safe area */
  bottom: calc(var(--tab-h) + var(--safe-bottom));
  overflow: hidden;
}

/* Когда tab bar скрыт (флоу записи) — экраны занимают весь экран */
body.no-tabbar .screens-container {
  bottom: 0;
}

/* Каждый экран занимает весь контейнер */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background: var(--bg2);
  /* По умолчанию — смещён вправо (невидим) */
  transform: translateX(100%);
  transition: transform 0.3s var(--ease-out);
  will-change: transform;
  pointer-events: none;
}

/* Активный экран */
.screen.is-active {
  transform: translateX(0);
  pointer-events: all;
}

/* Экран "позади" — смещён чуть влево при навигации вперёд */
.screen.is-behind {
  transform: translateX(-28%);
  pointer-events: none;
}

/* Мгновенный сброс позиции без анимации */
.screen.no-transition {
  transition: none !important;
}


/* ============================================================
   5. НИЖНЯЯ НАВИГАЦИЯ (TAB BAR)
   ============================================================ */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg);
  border-top: 1px solid var(--separator);
  display: flex;
  z-index: 200;
  transition: transform 0.25s var(--ease-out), opacity 0.25s;
}

body.no-tabbar .tab-bar {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--hint);
  transition: color 0.15s, transform 0.1s;
  min-height: 44px;
}

.tab-btn:active {
  transform: scale(0.92);
}

.tab-btn.active {
  color: var(--accent);
}

.tab-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.tab-btn span {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}


/* ============================================================
   6. ТИПОГРАФИКА
   ============================================================ */

/* Заголовок страницы (крупный) */
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  padding: 16px 16px 8px;
}

/* Заголовок секции */
.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--hint);
  padding: 0 16px;
  margin-bottom: 8px;
}

/* Стандартный текст */
.text-body  { font-size: 16px; line-height: 1.5; }
.text-sm    { font-size: 14px; line-height: 1.4; }
.text-xs    { font-size: 12px; line-height: 1.3; }
.text-hint  { color: var(--hint); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* Шаг флоу записи */
.booking-step {
  font-size: 13px;
  color: var(--hint);
  padding: 8px 16px 0;
  font-weight: 500;
}


/* ============================================================
   7. КНОПКИ
   ============================================================ */

/* Базовая кнопка */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  width: 100%;
  border: none;
  user-select: none;
}

.btn:active {
  opacity: 0.75;
  transform: scale(0.98);
}

/* Основная кнопка — акцент */
.btn-primary {
  background: var(--accent);
  color: var(--accent-txt);
}

/* Вторичная кнопка */
.btn-secondary {
  background: var(--bg2);
  color: var(--text);
}

/* Прозрачная кнопка-ссылка */
.btn-ghost {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}

/* Кнопка опасного действия */
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Outline-кнопка */
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

/* CTA Вариант В — тёмная кнопка с золотой окантовкой и свечением */
.cta-dark-wrapper {
  position: relative;
  border-radius: calc(var(--radius-lg) + 2px);
}

/* Размытый золотой ореол снаружи */
.cta-dark-glow {
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-lg) + 3px);
  background: linear-gradient(135deg, #e8b840, #5a3a08, #e8b840);
  opacity: 0.55;
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

/* Сама кнопка */
.btn-cta-dark {
  position: relative;
  z-index: 1;
  min-height: 58px;
  border-radius: var(--radius-lg);
  color: #C5A357;
  background: linear-gradient(180deg, #1e1610 0%, #120e07 100%);
  border: 1px solid rgba(197, 163, 87, 0.72);
  box-shadow:
    0 0 20px rgba(197, 163, 87, 0.13) inset,
    0 0 1px  rgba(197, 163, 87, 0.4) inset;
  font-weight: 700;
  letter-spacing: 0.02em;
  overflow: hidden;
}

/* Тонкий золотой блик-линия сверху */
.btn-cta-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(197, 163, 87, 0.8),
    transparent
  );
  pointer-events: none;
}

/* Кнопка со стрелкой вправо */
.btn-arrow::after {
  content: '›';
  margin-left: auto;
  font-size: 20px;
  opacity: 0.4;
}


/* ============================================================
   8. КАРТОЧКИ И СПИСКИ
   ============================================================ */

/* Секция с карточками (белый фон на сером) */
.card-section {
  background: var(--bg);
  border-radius: var(--radius-lg);
  margin: 0 12px;
  overflow: hidden;
}

/* Карточка-строка (для списка услуг) */
.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  cursor: pointer;
  transition: background 0.15s;
  min-height: 72px;
  position: relative;
}

.card-row:active {
  background: var(--bg2);
}

/* Разделитель между строками */
.card-row + .card-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 104px; /* отступ от левого края с учётом фото */
  right: 0;
  height: 1px;
  background: var(--separator);
}

/* Иконка/превью услуги в строке */
.card-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  overflow: hidden;
  position: relative;
}

/* Текстовая часть строки */
.card-row-body {
  flex: 1;
  min-width: 0;
}

.card-row-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-row-meta {
  font-size: 13px;
  color: var(--hint);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-row-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

/* Стрелка вправо */
.card-arrow {
  color: var(--hint);
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.4;
}

/* Горизонтальные карточки для главной */
.h-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 16px 12px;
  scroll-snap-type: x mandatory;
}

.h-scroll > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Карточка популярной услуги (горизонтальный скролл) */
.popular-card {
  width: 140px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.popular-card:active {
  transform: scale(0.97);
  opacity: 0.85;
}

.popular-card-img {
  width: 140px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
  position: relative;
}

.popular-card-body {
  padding: 8px 10px 10px;
}

.popular-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}


/* ============================================================
   9. ЧИПЫ (ФИЛЬТРЫ)
   ============================================================ */
.chips-row {
  display: flex;
  gap: 8px;
  padding: 4px 16px 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--separator);
}

.chip:active {
  transform: scale(0.95);
}

.chip.active {
  background: var(--accent);
  color: white;
  border-color: transparent;
}


/* ============================================================
   10. ЭКРАН: ГЛАВНАЯ
   ============================================================ */

/* Шапка профиля мастера */
.home-header {
  background: var(--bg);
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.master-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2AABEE 0%, #1a85c8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.master-info {
  flex: 1;
  min-width: 0;
}

.master-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.master-spec {
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 6px;
}

.master-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--success);
}

.master-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

/* Кнопки действий на главной */
.home-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 16px;
}

/* Секция на главной */
.home-section {
  margin-bottom: 12px;
}

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 10px;
}

.home-section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.home-section-link {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

/* Сетка последних работ (2 колонки) */
.gallery-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin: 0 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.gallery-mini-item {
  aspect-ratio: 1;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  transition: opacity 0.15s;
}

.gallery-mini-item:active { opacity: 0.8; }

.gallery-mini-item .gi-emoji {
  font-size: 28px;
}

.gallery-mini-item .gi-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}


/* ============================================================
   11. ЭКРАН: УСЛУГИ
   ============================================================ */
.services-list {
  display: flex;
  flex-direction: column;
}

/* Разделитель категорий */
.services-divider {
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px 4px;
}


/* ============================================================
   12. ЭКРАН: КАРТОЧКА УСЛУГИ
   ============================================================ */

/* Большое фото услуги */
.service-hero {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

/* Блок с ценой и длительностью */
.service-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 16px 0;
}

.service-detail-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  padding: 0 16px;
  margin-bottom: 6px;
}

.service-price-big {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.service-duration-hint {
  font-size: 14px;
  color: var(--hint);
}

.service-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  padding: 10px 16px;
  opacity: 0.85;
}

.service-includes {
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 12px 16px 6px;
}

/* Горизонтальный скролл примеров работ */
.service-gallery-row {
  display: flex;
  gap: 8px;
  padding: 4px 16px 20px;
  overflow-x: auto;
}

.service-gallery-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: opacity 0.15s;
}

.service-gallery-thumb:active { opacity: 0.75; }

/* Отступ снизу для MainButton */
.screen-pb-main {
  height: 80px;
}


/* ============================================================
   13. ЭКРАН: ВЫБОР ДАТЫ
   ============================================================ */

/* Горизонтальный скролл дней */
.date-scroll {
  display: flex;
  gap: 8px;
  padding: 8px 16px 14px;
  overflow-x: auto;
}

/* Карточка одного дня */
.date-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 60px;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  background: var(--bg);
  border: 1.5px solid transparent;
}

.date-chip:active { transform: scale(0.94); }

.date-chip.active {
  background: var(--accent);
  border-color: transparent;
}

.date-chip.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.date-chip-dow {
  font-size: 11px;
  font-weight: 600;
  color: var(--hint);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.date-chip.active .date-chip-dow {
  color: rgba(255,255,255,0.75);
}

.date-chip-day {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.date-chip.active .date-chip-day {
  color: white;
}

/* Сетка слотов времени (3 в ряд) */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 16px 16px;
}

.slot-btn {
  height: 48px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
}

.slot-btn:active { transform: scale(0.95); }

.slot-btn.active {
  background: var(--accent);
  color: white;
}

.slot-btn.booked {
  background: var(--bg2);
  color: var(--hint);
  pointer-events: none;
  text-decoration: line-through;
  opacity: 0.6;
}

/* Подсказка */
.slots-hint {
  font-size: 13px;
  color: var(--hint);
  text-align: center;
  padding: 0 16px 12px;
}


/* ============================================================
   14. ЭКРАН: ПОДТВЕРЖДЕНИЕ
   ============================================================ */

/* Сводная карточка записи */
.confirm-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  margin: 0 12px 12px;
  padding: 16px;
  display: flex;
  gap: 14px;
}

.confirm-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--accent-soft);
}

.confirm-details {
  flex: 1;
  min-width: 0;
}

.confirm-service-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.confirm-meta {
  font-size: 14px;
  color: var(--hint);
  line-height: 1.5;
}

.confirm-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  align-self: center;
  flex-shrink: 0;
}

/* Карточка данных пользователя */
.user-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  margin: 0 12px 12px;
  overflow: hidden;
}

.user-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  min-height: 52px;
  border-bottom: 1px solid var(--separator);
}

.user-card-row:last-child {
  border-bottom: none;
}

.user-card-label {
  font-size: 15px;
  color: var(--hint);
  width: 90px;
  flex-shrink: 0;
}

.user-card-value {
  flex: 1;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

/* Поле комментария */
.comment-field {
  background: var(--bg);
  border-radius: var(--radius-lg);
  margin: 0 12px 12px;
  padding: 14px 16px;
}

.comment-label {
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 8px;
}

.comment-input {
  width: 100%;
  resize: none;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: transparent;
  min-height: 72px;
  border: none;
  outline: none;
}

.comment-input::placeholder {
  color: var(--hint);
  opacity: 0.7;
}

/* Поле телефона */
.phone-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-input {
  flex: 1;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  border: none;
  outline: none;
  background: transparent;
}

.phone-input::placeholder {
  color: var(--hint);
  font-weight: 400;
}


/* ============================================================
   15. ЭКРАН: УСПЕХ
   ============================================================ */
.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  min-height: 100%;
  text-align: center;
  gap: 0;
}

.success-icon-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--success-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: success-pop 0.5s var(--ease-spring) both;
}

@keyframes success-pop {
  0%  { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1);  opacity: 1; }
}

.success-icon-wrap svg {
  width: 48px;
  height: 48px;
  color: var(--success);
}

.success-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  animation: fade-up 0.4s ease 0.15s both;
}

.success-service {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  animation: fade-up 0.4s ease 0.2s both;
}

.success-datetime {
  font-size: 15px;
  color: var(--hint);
  margin-bottom: 24px;
  animation: fade-up 0.4s ease 0.25s both;
}

.success-notice {
  font-size: 13px;
  color: var(--hint);
  line-height: 1.5;
  margin-bottom: 32px;
  animation: fade-up 0.4s ease 0.3s both;
  max-width: 260px;
}

.success-btn-wrap {
  width: 100%;
  max-width: 320px;
  animation: fade-up 0.4s ease 0.35s both;
}

@keyframes fade-up {
  0%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0);   opacity: 1; }
}


/* ============================================================
   16. ЭКРАН: ГАЛЕРЕЯ
   ============================================================ */

/* Плотная сетка 2 колонки */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
}

.gallery-item {
  aspect-ratio: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  transition: opacity 0.15s, transform 0.15s;
  position: relative;
}

.gallery-item:active {
  opacity: 0.8;
  transform: scale(0.97);
}

.gi-emoji {
  font-size: 30px;
  z-index: 1;
}

.gi-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
  z-index: 1;
  letter-spacing: 0.2px;
}


/* ============================================================
   17. ЭКРАН: МОИ ЗАПИСИ
   ============================================================ */

/* Активная запись */
.booking-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  margin: 0 12px 10px;
  padding: 16px;
  overflow: hidden;
}

.booking-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.booking-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

/* Бейджи статусов */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.badge-confirmed {
  background: var(--success-soft);
  color: var(--success);
}

.badge-done {
  background: var(--bg2);
  color: var(--hint);
}

.badge-cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.booking-meta {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* Пустое состояние */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 12px;
}

.empty-emoji {
  font-size: 56px;
  margin-bottom: 8px;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.empty-sub {
  font-size: 14px;
  color: var(--hint);
  max-width: 220px;
  line-height: 1.5;
  margin-bottom: 8px;
}


/* ============================================================
   18. LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
}

.lightbox-close {
  position: absolute;
  top: calc(16px + var(--safe-top));
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
}

.lightbox-close svg { width: 20px; height: 20px; }
.lightbox-close:active { background: rgba(255,255,255,0.25); }

.lightbox-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 0 16px;
  z-index: 5;
}

.lightbox-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  position: relative;
  font-size: 48px;
  overflow: hidden;
  transition: transform 0.25s var(--ease-out);
}

.lightbox-item-label {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
}

.lightbox-arrow svg { width: 22px; height: 22px; }
.lightbox-arrow:active { background: rgba(255,255,255,0.22); }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

.lightbox-counter {
  position: absolute;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  z-index: 10;
}


/* ============================================================
   19. BOTTOM SHEET
   ============================================================ */
.bs-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.bs-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--overlay);
  transition: opacity 0.25s;
}

.bs-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.bs-card {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  padding: 0 16px calc(20px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.3s var(--ease-out);
  z-index: 1;
}

.bs-overlay.open .bs-card {
  transform: translateY(0);
}

/* Ручка для свайпа */
.bs-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--separator);
  margin: 12px auto 20px;
}

.bs-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.bs-sub {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 24px;
  line-height: 1.5;
}

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


/* ============================================================
   20. УТИЛИТЫ
   ============================================================ */

/* Разделитель-линия */
.divider {
  height: 1px;
  background: var(--separator);
  margin: 0 16px;
}

/* Блок с паддингами */
.px { padding-left: 16px; padding-right: 16px; }
.py { padding-top: 12px; padding-bottom: 12px; }
.p16 { padding: 16px; }
.mt8  { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mb12 { margin-bottom: 12px; }

/* Отступ снизу под MainButton Telegram */
.pb-main { padding-bottom: 72px; }

/* Заголовок экрана (в шапке) */
.screen-header {
  background: var(--bg);
  padding: 16px 16px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--separator);
}

.screen-header-row {
  padding: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Shimmer-анимация для скелетонов */
@keyframes shimmer {
  0%   { background-position: -300px 0; }
  100% { background-position:  300px 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    var(--bg2) 0%, var(--separator) 50%, var(--bg2) 100%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* Нижний безопасный отступ для скролла */
.safe-bottom-pad {
  height: calc(16px + var(--safe-bottom));
}


/* ============================================================
   21. ОФФЕР-МОДАЛКА
   ============================================================ */
.offer-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.offer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.offer-card {
  background: var(--bg);
  border-radius: 20px;
  padding: 28px 20px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s var(--ease-spring);
}

.offer-overlay.open .offer-card {
  transform: translateY(0) scale(1);
}

.offer-emoji {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 14px;
}

.offer-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 8px;
}

.offer-sub {
  font-size: 14px;
  color: var(--hint);
  line-height: 1.5;
  margin-bottom: 18px;
}

.offer-bullets {
  list-style: none;
  text-align: left;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.offer-bullets li {
  font-size: 14px;
  color: var(--text);
  padding-left: 20px;
  position: relative;
  line-height: 1.45;
}

.offer-bullets li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-size: 16px;
  line-height: 1.3;
}

.offer-btn {
  width: 100%;
  min-height: 48px;
  background: #2AABEE;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity 0.15s, transform 0.1s;
}

.offer-btn:active {
  opacity: 0.8;
  transform: scale(0.98);
}

.offer-skip {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--hint);
  cursor: pointer;
  padding: 6px;
  transition: color 0.15s;
}

/* ============================================================
   21. Экран: О мастере
   ============================================================ */

.home-header--link {
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}
.home-header--link:active {
  background: var(--bg2);
}
.master-chevron {
  flex-shrink: 0;
  color: var(--hint);
  margin-left: 4px;
}

.about-hero {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
  background: var(--bg2);
}
.about-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.about-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2AABEE 0%, #1a85c8 100%);
}
.about-body {
  padding: 20px 16px 32px;
}
.about-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.about-meta {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 2px;
}
.about-meta:last-of-type {
  margin-bottom: 14px;
}
.about-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 24px;
}
.about-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.about-call {
  text-decoration: none;
  justify-content: center;
}

/* ============================================================
   22. Блок отзывов (Главная)
   ============================================================ */

.reviews-row {
  padding-bottom: 4px;
}

.review-card {
  flex-shrink: 0;
  width: 264px;
  background: var(--bg2);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.review-head-info {
  min-width: 0;
}

.review-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-stars {
  font-size: 13px;
  color: var(--warning);
  letter-spacing: 1px;
  margin-top: 1px;
}

.review-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-tag {
  font-size: 12px;
  color: var(--hint);
  padding-top: 4px;
  border-top: 1px solid var(--separator);
}


/* ============================================================
   23. Хайлайты мастера (горизонтальная строка на главной)
   ============================================================ */
.master-highlights-scroll {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.master-highlight-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--bg);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--separator);
}

.master-highlight-chip span:first-child {
  font-size: 15px;
  line-height: 1;
}


/* ============================================================
   24. Траст-грид на экране «О мастере»
   ============================================================ */
.about-trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 20px;
}

.about-trust-item {
  background: var(--bg2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-trust-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}

.about-trust-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}

.about-address-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 16px;
}


/* ============================================================
   25. Подсказка расписания (экран выбора даты)
   ============================================================ */
.schedule-info-hint {
  font-size: 12px;
  color: var(--hint);
  padding: 0 16px 14px;
  line-height: 1.4;
}


/* ============================================================
   26. Ошибка телефона (экран подтверждения)
   ============================================================ */
.phone-input.invalid {
  color: var(--danger);
}

.phone-error-row {
  padding: 8px 16px 10px;
  background: var(--danger-soft);
}

.phone-error-text {
  font-size: 13px;
  color: var(--danger);
  font-weight: 500;
}


/* ============================================================
   27. Флоу-объяснение на экране успеха
   ============================================================ */
.success-flow {
  width: 100%;
  max-width: 320px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fade-up 0.4s ease 0.25s both;
  text-align: left;
}

.success-flow-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg2);
  padding: 10px 14px;
  border-radius: var(--radius-md);
}

.success-flow-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1.3;
}

.success-flow-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  opacity: 0.85;
}
