/* ============================================================
   ПОДОЛОГ — Общие стили
   Цвета: тёмно-зелёный фон + оранжевый акцент (из Figma)
   ============================================================ */

:root {
  --bg:        #0d2017;
  --bg-card:   #1a3d28;
  --bg-input:  #122b1e;
  --nav-bg:    #0f2a1c;
  --orange:    #e07c00;
  --orange-h:  #c46e00;
  --orange-l:  #ff9a20;
  --white:     #ffffff;
  --text:      #e8f0eb;
  --muted:     #8aab97;
  --border:    #2a5a3a;
  --danger:    #e05050;
  --success:   #4caf72;
  --radius:    8px;
  --shadow:    0 4px 20px rgba(0,0,0,.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Навигация ─────────────────────────────────────────────── */
.navbar {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; height: 60px;
}
.nav-logo {
  font-weight: 700; font-size: 1.2rem;
  color: var(--orange); margin-right: auto;
  white-space: nowrap;
  display: flex; align-items: center;
}
.nav-logo img {
  height: 40px !important;
  width: auto !important;
  max-width: 120px !important;
  max-height: 40px !important;
  object-fit: contain;
  display: block;
  transition: transform .2s;
}
.nav-logo:hover img { transform: scale(1.04); }

/* На мобильных — чуть меньше */
@media (max-width: 768px) {
  .nav-logo img {
    height: 32px !important;
    max-width: 100px !important;
    max-height: 32px !important;
  }
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius);
  font-size: .9rem; color: var(--muted);
  transition: color .2s, background .2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--white); background: var(--border); }
.nav-auth { margin-left: 8px; }

/* ── Кнопки ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: none; transition: background .2s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-h); }
.btn-secondary{ background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover{ background: var(--border); }
.btn-danger   { background: var(--danger); color: var(--white); }
.btn-danger:hover{ opacity: .85; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-outline {
  background: transparent; color: var(--orange);
  border: 1.5px solid var(--orange);
}
.btn-outline:hover { background: var(--orange); color: var(--white); }

/* ── Карточки ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ── Поля ввода ────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .85rem; color: var(--muted); }
.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
.form-control:focus { border-color: var(--orange); }
.form-control::placeholder { color: var(--muted); }
select.form-control { cursor: pointer; }

/* ── Модальные окна ────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 500; align-items: center; justify-content: center;
  padding: 20px;                 /* отступ чтобы модалка не прилипала к краям */
  overflow-y: auto;              /* прокрутка оверлея если модалка очень высокая */
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 90%; max-width: 420px;
  position: relative;
  box-shadow: var(--shadow);
  animation: slideUp .25s ease;
  max-height: calc(100vh - 40px);  /* не выше экрана */
  overflow-y: auto;                /* прокрутка содержимого */
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal h2 { font-size: 1.3rem; margin-bottom: 20px; color: var(--white); }
.modal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: var(--muted);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--white); }
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-switch { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 8px; }
.modal-switch a { color: var(--orange); cursor: pointer; }
.modal-switch a:hover { text-decoration: underline; }

/* ── Звёзды рейтинга ───────────────────────────────────────── */
.stars { display: flex; gap: 4px; }
.star { font-size: 1.2rem; color: var(--muted); cursor: pointer; }
.star.active { color: var(--orange); }

/* ── Статусы записей ───────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.badge-pending   { background: #3a3000; color: #f0c000; }
.badge-confirmed { background: #003020; color: var(--success); }
.badge-cancelled { background: #3a0000; color: var(--danger); }
.badge-completed { background: #002030; color: #60c0e0; }

/* ── Секция ────────────────────────────────────────────────── */
.section { padding: 48px 20px; }
.section-title {
  font-size: 1.6rem; font-weight: 700;
  margin-bottom: 24px; color: var(--white);
}
.section-title span { color: var(--orange); }

/* ── Сетки ─────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }

/* ── Подвал ────────────────────────────────────────────────── */
footer {
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  margin-top: auto;
}
footer .footer-links { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-bottom: 10px; }
footer .footer-links a:hover { color: var(--orange); }

/* ── Уведомление (toast) ───────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(40px);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: 12px 24px; border-radius: 40px;
  font-size: .9rem; box-shadow: var(--shadow);
  opacity: 0; transition: opacity .3s, transform .3s; z-index: 999;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { border-color: var(--success); }
#toast.error   { border-color: var(--danger); }

/* ── Spinner ───────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  animation: spin .7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Утилиты ───────────────────────────────────────────────── */
.text-orange { color: var(--orange); }
.text-muted  { color: var(--muted); }
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.w-full{ width: 100%; }
.hidden{ display: none !important; }

/* ── Адаптив ───────────────────────────────────────────────── */
@media(max-width:600px){
  .nav-inner  { gap: 8px; }
  .nav-links a{ padding: 6px 8px; font-size: .8rem; }
  .modal      { padding: 24px 18px; }
}

/* ============================================================
   АДАПТИВ — общие правила
   Breakpoints: tablet ≤ 900px, mobile ≤ 600px
   ============================================================ */

/* ── Бургер-кнопка (только мобильные) ─────────────────────── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.nav-burger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Мобильная шторка навигации ────────────────────────────── */
@media (max-width: 768px) {
  .nav-burger { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 16px 20px;
    gap: 4px;
    z-index: 199;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: var(--radius);
  }
  .nav-auth { display: none; } /* убираем из шапки — появляется в шторке */
}

/* ── Модальные окна на мобильных ───────────────────────────── */
@media (max-width: 500px) {
  .modal-overlay { align-items: flex-end; }
  .modal {
    width: 100%;
    max-width: 100% !important;
    border-radius: 16px 16px 0 0;
    padding: 24px 16px 32px;
    max-height: 92vh;
    overflow-y: auto;
  }
}

/* ── Секции ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 32px 16px; }
  .section-title { font-size: 1.3rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ── Footer ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  footer .footer-links { gap: 12px; font-size: .8rem; }
}

/* ── Toast ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #toast {
    left: 16px; right: 16px;
    transform: translateY(40px);
    border-radius: 12px;
    width: auto;
  }
  #toast.show { transform: translateY(0); }
}

/* ── Мобильная кнопка авторизации в шторке ─────────────────── */
/* По умолчанию скрыта — показывается только в бургер-меню */
.nav-auth-mobile {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
@media (max-width: 768px) {
  .nav-auth-mobile { display: flex !important; }
}

/* ============================================================
   КАЛЕНДАРЬ — общие стили (используется на всех страницах)
   ============================================================ */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; font-weight: 600;
}
.cal-nav {
  background: none; border: 1px solid var(--border);
  color: var(--text); padding: 4px 12px; border-radius: 6px;
  cursor: pointer; font-size: 1.2rem; line-height: 1;
  transition: background .15s;
}
.cal-nav:hover { background: var(--border); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  text-align: center; font-size: .75rem;
  color: var(--muted); padding: 4px 0; font-weight: 600;
}
.cal-day {
  text-align: center; padding: 8px 2px;
  border-radius: 6px; cursor: pointer;
  font-size: .9rem; transition: background .15s;
  user-select: none;
}
.cal-day:hover:not(.past):not(.weekend):not(.holiday) {
  background: var(--border);
}
.cal-day.past    { color: var(--muted); cursor: default; opacity: .45; }
.cal-day.weekend { color: var(--muted); cursor: default; opacity: .5; }
.cal-day.holiday { color: #c080e0; cursor: default; opacity: .65; }
.cal-day.selected {
  background: var(--orange) !important;
  color: #fff; font-weight: 700;
}

/* Слоты времени */
.time-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-top: 8px;
}
.time-btn {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 4px; text-align: center;
  cursor: pointer; font-size: .85rem; color: var(--text);
  transition: background .15s; user-select: none;
}
.time-btn:hover    { background: var(--border); }
.time-btn.selected {
  background: var(--orange); border-color: var(--orange);
  color: #fff; font-weight: 700;
}

/* Легенда календаря */
.cal-legend {
  display: flex; gap: 14px; margin-top: 10px;
  font-size: .75rem; color: var(--muted); flex-wrap: wrap;
}
.leg-item { display: flex; align-items: center; gap: 5px; }
.leg-dot  {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}

@media (max-width: 480px) {
  .cal-day { padding: 6px 1px; font-size: .82rem; }
  .time-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   КАЛЕНДАРЬ И ВЫБОР ВРЕМЕНИ — общие стили (все страницы)
   ============================================================ */

.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; font-weight: 600; color: var(--white);
}
.cal-nav {
  background: none; border: 1px solid var(--border);
  color: var(--text); padding: 4px 12px; border-radius: 6px;
  cursor: pointer; font-size: 1.2rem; line-height: 1;
  transition: background .15s;
}
.cal-nav:hover { background: var(--border); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  text-align: center; font-size: .75rem;
  color: var(--muted); padding: 4px 0; font-weight: 600;
}
.cal-day {
  text-align: center; padding: 8px 2px;
  border-radius: 6px; cursor: pointer;
  font-size: .88rem; transition: background .15s;
  min-width: 0;
}
.cal-day:hover:not(.past):not(.weekend):not(.holiday) {
  background: var(--border);
}
.cal-day.past    { color: var(--muted); cursor: default; opacity: .45; }
.cal-day.weekend { color: var(--muted); cursor: default; opacity: .5; }
.cal-day.holiday { color: #c080e0; cursor: default; opacity: .65; }
.cal-day.selected {
  background: var(--orange);
  color: var(--white);
  font-weight: 700;
}

/* Выбор времени */
.time-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.time-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 4px;
  text-align: center; cursor: pointer;
  font-size: .85rem; color: var(--text);
  transition: background .15s;
}
.time-btn:hover    { background: var(--border); }
.time-btn.selected {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff; font-weight: 700;
}

/* Легенда календаря */
.cal-legend {
  display: flex; gap: 14px; margin-top: 10px;
  font-size: .75rem; color: var(--muted); flex-wrap: wrap;
}
.leg-item { display: flex; align-items: center; gap: 5px; }
.leg-dot  {
  width: 10px; height: 10px;
  border-radius: 50%; display: inline-block;
}

/* Адаптив календаря */
@media (max-width: 400px) {
  .cal-day  { padding: 6px 1px; font-size: .78rem; }
  .time-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   ЛАЙТБОКС — увеличение изображений (все страницы)
   ============================================================ */
#lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.93);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#lightbox.open { display: flex; }

#lb-overlay {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; gap: 14px;
  max-width: 95vw; max-height: 95vh;
  animation: lbIn .22s ease;
}
@keyframes lbIn {
  from { transform: scale(.88); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
#lb-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  cursor: zoom-out;
}
#lb-title {
  color: rgba(255,255,255,.85);
  font-size: .95rem;
  text-align: center;
  max-width: 500px;
  padding: 0 16px;
}
#lb-close {
  position: fixed; top: 16px; right: 20px;
  background: rgba(255,255,255,.15);
  border: none; color: #fff;
  font-size: 1.8rem; line-height: 1;
  width: 44px; height: 44px;
  border-radius: 50%; cursor: pointer;
  transition: background .2s;
  z-index: 10000;
}
#lb-close:hover { background: rgba(255,255,255,.3); }

/* Адаптив лайтбокса */
@media (max-width: 600px) {
  #lb-img    { max-width: 95vw; max-height: 70vh; border-radius: 6px; }
  #lb-close  { top: 10px; right: 12px; width: 38px; height: 38px; font-size: 1.5rem; }
  #lb-title  { font-size: .85rem; }
}

/* Зум-курсор для кликабельных изображений */
.zoomable {
  cursor: zoom-in;
  transition: transform .2s, box-shadow .2s;
}
.zoomable:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

/* ── Галочка согласия ──────────────────────────────────────── */
.consent-group {
  margin-top: 4px;
  margin-bottom: 8px;
}
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.5;
}
.consent-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--orange);
}
.consent-label a {
  color: var(--orange);
  text-decoration: underline;
}
.consent-label a:hover { color: var(--orange-light, #ff9933); }



/* ── Информационный баннер ─────────────────────────────────── */
.info-banner {
  background: rgba(255, 152, 0, 0.1);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--text);
}
.info-banner strong {
  color: var(--orange);
  display: block;
  margin-bottom: 4px;
}

/* ── Прилипающие кнопки действий в форме записи ──────────────── */
.booking-step > div[style*="display:flex"][style*="gap:8px"]:last-child {
  position: sticky;
  bottom: -32px;                /* компенсируем padding модалки */
  background: var(--bg-card);
  padding: 12px 0 0;
  margin: 0 -4px;
  z-index: 2;
}

/* Сетка времени — компактнее на ПК чтобы помещалось больше */
.time-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 280px;            /* ограничиваем высоту, прокрутка если много */
  overflow-y: auto;
  padding: 2px;
}
@media (max-width: 480px) {
  .time-grid { grid-template-columns: repeat(3, 1fr); }
}