/* ================================================================
   ZDOROVAYA KRASOTA — css/booking.css
   Premium Booking & Gift Certificates Interface (Variant B)
   ================================================================ */

/* === Booking Page Base === */
.booking-page {
  background: linear-gradient(180deg, var(--color-background-alt) 0%, var(--color-surface-container-low) 100%);
  min-height: 100vh;
  padding-bottom: 80px;
}

.booking-main {
  padding-top: 100px;
  padding-bottom: 60px;
}

/* === CRM 8.32: Glassmorphism для карточек === */
.glass-card {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(139, 76, 85, 0.05);
  /* === CRM 8.41: Конкретные свойства вместо 'all' === */
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
/* === CRM 8.45: Glass-эффект на мобильных (полупрозрачный + blur) === */
@media (max-width: 768px) {
  .glass-card,
  .card--glass,
  .service-card {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    background: rgba(255, 255, 255, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
  }
  /* Выделение должно работать поверх */
  .service-card.selected {
    background: rgba(139, 76, 85, 0.15) !important;
  }
  /* Ecosystem-card — glass-эффект */
  .ecosystem-card {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    background: rgba(255, 255, 255, 0.45) !important;
  }
}
/* === CRM 9.9: Hover только для устройств с мышью === */
@media (hover: hover) {
  .glass-card:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(139, 76, 85, 0.1);
  }
}

/* === Skeleton Loading === */
.skeleton-loading {
  margin-top: 16px;
}

.skeleton-slot {
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* ================================================================
   CRM 8.13: Компактный мобильный календарь + десктопное ограничение
   ================================================================ */

/* === CRM 8.13: Контейнер календаря — mobile-first === */
.calendar-container {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px;
  box-sizing: border-box;
}

/* Заголовок календаря (месяц + стрелки) — mobile */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.calendar-header h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--color-on-surface, #201a1b);
}

.calendar-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--color-surface-container, #f8ebeb);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background-color 0.2s;
  font-size: 14px;
  color: var(--color-on-surface);
  box-sizing: border-box;
}

.calendar-nav-btn:hover {
  background: var(--color-primary, #8b4c55);
  color: #fff;
}

/* === CRM 8.13: Дни недели — компактные на мобильном === */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
  text-align: center;
}

.calendar-weekday {
  font-size: 9px;
  font-weight: 600;
  color: #8b4c55;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 0;
  box-sizing: border-box;
}

/* === CRM 8.13: Сетка дней — компактная на мобильном === */
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

/* Ячейка дня — компактная на мобильном */
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  min-height: 28px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  color: var(--color-on-surface, #201a1b);
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.calendar-day:hover {
  background: rgba(139, 76, 85, 0.12);
  transform: scale(1.03);
}

.calendar-day--selected {
  background: #8b4c55;
  color: white;
  box-shadow: 0 4px 12px rgba(139, 76, 85, 0.3);
  pointer-events: none;
  cursor: default;
}

.calendar-day--today {
  position: relative;
}
.calendar-day--today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(139, 76, 85, 0.4);
}

.calendar-day--past {
  opacity: 0.3;
  pointer-events: none;
  cursor: not-allowed;
  text-decoration: line-through;
}

.calendar-day--empty,
.calendar-day.empty {
  visibility: hidden;
  pointer-events: none;
}

/* === CRM 8.13: Tablet (768px+) === */
@media (min-width: 768px) {
  .calendar-container {
    max-width: 480px;
    padding: 12px;
  }

  .calendar-header h2 {
    font-size: 16px;
  }

  .calendar-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .calendar-weekdays {
    gap: 6px;
  }

  .calendar-weekday {
    font-size: 11px;
  }

  .calendar-days {
    gap: 6px;
  }

  .calendar-day {
    font-size: 13px;
    min-height: 40px;
    border-radius: 10px;
  }
}

/* === CRM 8.13: Desktop (1024px+) — жёсткое ограничение === */
@media (min-width: 1024px) {
  .calendar-container {
    max-width: 520px;
    padding: 16px;
  }

  .calendar-header h2 {
    font-size: 18px;
  }

  .calendar-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .calendar-weekdays {
    gap: 8px;
  }

  .calendar-weekday {
    font-size: 12px;
  }

  .calendar-days {
    gap: 8px;
  }

  .calendar-day {
    font-size: 14px;
    min-height: 48px;
    border-radius: 12px;
  }

  .calendar-day:hover:not(.calendar-day--selected):not(.calendar-day--past):not(.calendar-day--empty) {
    transform: scale(1.08);
  }
}

/* === Slots === */
.slots-container {
  animation: slideDown 0.4s var(--ease-out-expo, 0.3s ease-out);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === CRM 8.10: Контейнер слотов === */
#slots-container {
  width: 100%;
  padding: 8px 0;
}

#slots-container h3 {
  margin-bottom: 16px;
  text-align: left;
}

/* === CRM 8.10: Сетка слотов на десктопе === */
#slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 640px) {
  #slots-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
}

@media (min-width: 1024px) {
  #slots-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
  }
}

/* === CRM 8.10: Стили кнопок слотов === */
.slot-btn {
  min-height: 48px;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  color: var(--color-on-surface, #201a1b);
  text-align: center;
  letter-spacing: 0.02em;
}

.slot-btn:hover:not(.slot-btn--booked):not(.slot-btn--blocked) {
  background: rgba(139, 76, 85, 0.12);
  transform: scale(1.03);
}

.slot-btn--available {
  background: rgba(255, 255, 255, 0.4);
  color: #3D2224;
}

.slot-btn--booked {
  background: rgba(127, 29, 29, 0.15);
  color: #7f1d1d;
  text-decoration: line-through;
  pointer-events: none;
  opacity: 0.6;
}

.slot-btn--blocked {
  background: rgba(107, 114, 128, 0.15);
  color: rgba(107, 114, 128, 0.6);
  cursor: not-allowed;
  pointer-events: none;
}

.slot-btn--selected {
  background: #8b4c55 !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(139, 76, 85, 0.3);
  pointer-events: none;
}

@media (min-width: 640px) {
  .slot-btn {
    min-height: 52px;
  }
}

@media (min-width: 1024px) {
  .slot-btn {
    min-height: 52px;
    font-size: 15px;
  }
}

/* === CRM 8.32.1: Service Cards (Variant B) — синхронизированы с .glass-card === */
.service-card {
  position: relative;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(139, 76, 85, 0.05);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === CRM 8.56: Выбранная карточка — плавное поднятие + выделение === */
.service-card.selected {
  border-color: var(--color-primary, #8b4c55) !important;
  background: rgba(139, 76, 85, 0.12) !important;
  transform: translateY(-4px) scale(1.02) !important;
  opacity: 1 !important;
  box-shadow: 0 8px 32px rgba(139, 76, 85, 0.2) !important;
  transition: transform 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s !important;
  pointer-events: auto;
}
/* === CRM 12.3: Service-card после выбора — интерактивный === */
.service-card.selected:active {
  transform: none !important;
  opacity: 1 !important;
}
/* === CRM 8.56: Убрать :active с карточек услуг === */
@media (max-width: 768px) {
  .service-card:active {
    transform: none !important;
    opacity: 1 !important;
  }
}

/* === CRM 8.62: Оптимизация service-card для всех браузеров === */
.service-card {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: auto;
}

/* === CRM 8.32: Анимации переходов между шагами === */
.booking-step {
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.booking-step.hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}
.booking-step.active {
  opacity: 1;
  transform: translateY(0);
}

/* === CRM 8.32: Анимации переходов между шагами === */
#calendar-days {
  transition: opacity 0.3s ease-out;
}

/* Анимация для слотов */
.slot-btn {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.slot-btn--selected {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(139, 76, 85, 0.3);
}

/* === CRM 8.32: Мобильная оптимизация быстродействия === === ЗАМЕНЕНО НА CRM 9.5 === */
@media (max-width: 768px) {
  /* Ускоряем все transition на мобильных */
  .glass-card,
  .service-card,
  .slot-btn,
  .calendar-day,
  .btn-premium-cta {
    transition-duration: 0.2s !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

/* === CRM 8.32.2: Мобильное выравнивание карточек услуг === */
@media (max-width: 768px) {
  /* Контейнер Step 1 */
  #step-1 {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
  }
  /* Grid — строго одна колонка, все карточки одинаковой ширины */
  #step-1 .grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    align-items: stretch !important;
  }
  /* ВСЕ карточки услуг — одинаковая ширина */
  .service-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box;
  }
  /* Заголовок шага */
  .booking-step h2 {
    text-align: center;
  }
}
/* Планшет (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  #step-1 {
    max-width: 90%;
    margin: 0 auto;
  }
  #step-1 .grid {
    max-width: 800px;
    margin: 0 auto;
  }
}

/* === CRM 8.33: Компактная Bottom Navigation Panel === */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(139, 76, 85, 0.1);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
  padding: 4px 0;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}
.mobile-bottom-nav__inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 360px;
  margin: 0 auto;
  width: 100%;
}
.mobile-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  text-decoration: none;
  color: #524344;
  font-size: 10px;
  font-weight: 500;
  transition: color 0.2s;
  flex: 1;
}
.mobile-bottom-nav__item:hover,
.mobile-bottom-nav__item--active {
  color: #8b4c55;
}
.mobile-bottom-nav__icon {
  width: 20px;
  height: 20px;
}
/* Скрываем на десктопе */
@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none;
  }
}

/* CRM 8.34: Единый стиль для всех 3 карточек правой колонки booking.html */
.ecosystem-card {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(139, 76, 85, 0.05);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* CRM 8.48: Hover только для desktop */
@media (hover: hover) and (min-width: 769px) {
  .ecosystem-card:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(139, 76, 85, 0.1);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
}
/* CRM 8.58: Выбранный ecosystem-card — только поднятие */
.ecosystem-card.is-selected {
  transform: translateY(-4px) !important;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
/* Отключаем hover на touch для выбранных */
@media (hover: none) {
  .ecosystem-card.is-selected:hover {
    transform: translateY(-4px) !important;
  }
}
.ecosystem-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ecosystem-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(139, 76, 85, 0.1);
}
.ecosystem-card__icon svg,
.ecosystem-card__icon img {
  width: 22px;
  height: 22px;
}
.ecosystem-card__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-on-surface);
  line-height: 1.3;
}
.ecosystem-card__desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-on-surface-variant);
}
.ecosystem-card .btn-premium-cta {
  align-self: flex-start;
  margin-top: 4px;
}
/* === CRM 8.35: Плавный скролл к якорю === */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* offset для фиксированной шапки */
}
@media (max-width: 768px) {
  html {
    scroll-padding-top: 80px;
  }
}

/* ================================================================
   CRM 13.9: Мобильные стили карточек (booking)
   GPU слои через translate3d(0,0,0) + will-change: transform
   Возвращены анимации карточек (transform + scale)
   ================================================================ */
@media (max-width: 768px) {
  /* 1. Все интерактивные элементы — GPU слой (translate3d) */
  .service-card,
  .ecosystem-card,
  .glass-card,
  .btn-premium-cta,
  .result-card {
    transform: translate3d(0,0,0) !important;
    -webkit-transform: translate3d(0,0,0) !important;
    will-change: transform !important;
    /* Анимации как ДО CRM 12.9 */
    transition: transform 0.12s ease-out, opacity 0.12s ease-out !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }
  /* 2. Тап — scale + opacity (INSTANT, zero transition) */
  .service-card.is-tapping,
  .ecosystem-card.is-tapping,
  .glass-card.is-tapping,
  .btn-premium-cta.is-tapping,
  .result-card.is-tapping {
    transform: translate3d(0,0,0) scale(0.97) !important;
    -webkit-transform: translate3d(0,0,0) scale(0.97) !important;
    opacity: 0.92 !important;
    transition: none !important;
  }
  /* 3. Выбранная service-card — поднятие + цвет */
  .service-card.selected {
    transform: translate3d(0,0,0) translateY(-4px) scale(1.02) !important;
    -webkit-transform: translate3d(0,0,0) translateY(-4px) scale(1.02) !important;
    background: rgba(139, 76, 85, 0.14) !important;
    border-color: rgba(139, 76, 85, 0.3) !important;
    box-shadow: 0 4px 12px rgba(139, 76, 85, 0.1) !important;
    opacity: 1 !important;
    transition: transform 0.15s ease-out !important;
  }
  /* 4. Выбранная ecosystem-card — ТОЛЬКО поднятие, БЕЗ цвета */
  .ecosystem-card.is-selected {
    transform: translate3d(0,0,0) translateY(-4px) scale(1.02) !important;
    -webkit-transform: translate3d(0,0,0) translateY(-4px) scale(1.02) !important;
    opacity: 1 !important;
    transition: transform 0.15s ease-out !important;
  }
  /* 5. Header — glassmorphism */
  .booking-header {
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
  }
}
/* 6. Hover — только desktop */
@media (max-width: 768px) and (hover: none) {
  .service-card:hover,
  .ecosystem-card:hover,
  .glass-card:hover,
  .result-card:hover {
    transform: translateZ(0) !important;
    opacity: 1 !important;
  }
}


