/* ============================================================
   Тема: тёмная по умолчанию, светлая — по переключателю.
   ============================================================ */

:root {
  --bg: #0f1211;
  --bg-soft: #161b19;
  --card: #191f1d;
  --card-2: #1f2624;
  --line: #2b3431;
  --text: #e9efec;
  --muted: #93a29c;
  --accent: #c9a227;
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-text: #1a1a12;
  --green: #4caf82;
  --red: #e5646d;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --maxw: 1120px;
}

html[data-theme='light'] {
  --bg: #faf7f2;
  --bg-soft: #f2ede4;
  --card: #ffffff;
  --card-2: #f6f2ea;
  --line: #e4dcce;
  --text: #23211d;
  --muted: #7b756a;
  --accent: #a37c22;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-text: #ffffff;
  --green: #2f8f62;
  --red: #c8434c;
  --shadow: 0 14px 34px rgba(60, 50, 30, 0.12);
}

/* --- Цветовые схемы (акцент). Меняются в админке → Настройки --------- */

html[data-accent='purple'] {
  --accent: #b39dff;
  --accent-text: #1b1230;
}
html[data-theme='light'][data-accent='purple'] {
  --accent: #6d28d9;
  --accent-text: #ffffff;
}

html[data-accent='orange'] {
  --accent: #ff9f57;
  --accent-text: #2a1505;
}
html[data-theme='light'][data-accent='orange'] {
  --accent: #c2610a;
  --accent-text: #ffffff;
}

html[data-accent='blue'] {
  --accent: #6fc7f0;
  --accent-text: #04212e;
}
html[data-theme='light'][data-accent='blue'] {
  --accent: #0b76ad;
  --accent-text: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

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

/* --- Фоновая фотография сайта (включается в админке) ------------------ */

body.has-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--bg-photo);
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
  z-index: -2;
}

body.has-bg::after {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg);
  opacity: var(--bg-dim, 0.72);
  z-index: -1;
}

body.has-bg .booking {
  background: color-mix(in srgb, var(--bg-soft) 72%, transparent);
}

body.has-bg .card,
body.has-bg .panel,
body.has-bg header.top {
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(6px);
}

body.has-bg footer {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

a {
  color: inherit;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

/* --------------------------------------------------------- шапка ------ */

header.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 66px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.2px;
  text-decoration: none;
}

/* Знак кабинета — лотос. Цвет наследуется от акцента, поэтому знак
   меняется вместе с выбранной в админке цветовой схемой. */
.logo .mark {
  width: 32px;
  height: 32px;
  flex: none;
  color: var(--accent);
  transition: transform 0.25s ease;
}

.logo:hover .mark {
  transform: scale(1.06);
}

/* старый кружок оставлен на случай, если где-то ещё используется */
.logo .dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, var(--bg)));
  flex: none;
}

nav.links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 15px;
}

nav.links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

nav.links a:hover {
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 18px;
}

.icon-btn {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: border-color 0.15s, background 0.15s;
}

.icon-btn:hover {
  border-color: var(--accent);
}

.lang-switch {
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.lang-switch button {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-transform: uppercase;
}

.lang-switch button.on {
  background: var(--accent);
  color: var(--accent-text);
}

.burger {
  display: none;
}

/* ---------------------------------------------------------- герой ----- */

.hero {
  padding: 78px 0 54px;
  background: radial-gradient(1100px 420px at 78% -12%, var(--accent-soft), transparent 65%);
}

.hero h1 {
  font-size: clamp(30px, 5.2vw, 52px);
  line-height: 1.1;
  margin: 0 0 14px;
  font-weight: 600;
}

.hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 620px;
  margin: 0 0 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
  padding: 13px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn.ghost:hover {
  border-color: var(--accent);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* --------------------------------------------------------- секции ----- */

section {
  padding: 56px 0;
}

.section-title {
  font-size: clamp(24px, 3.4vw, 32px);
  margin: 0 0 8px;
  font-weight: 600;
}

.section-sub {
  color: var(--muted);
  margin: 0 0 30px;
}

/* ------------------------------------------------------- карточки ----- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  /* Каждая карточка по своей высоте. Иначе сетка тянет соседние карточки
     под самую высокую, и при раскрытии описания рядом появляются пустые рамки. */
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: var(--shadow);
}

.card-img {
  height: 150px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, var(--card)), var(--card-2));
  background-size: cover;
  background-position: center;
  flex: none;
}

.card-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

/* В карточке видны первые две строки описания, остальное — по кнопке.
   Ограничение сделано высотой, а не line-clamp: только высоту можно
   плавно анимировать. Каждая карточка разворачивается сама по себе. */
.card .desc {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0;
  position: relative;
  overflow: hidden;
  max-height: 3em; /* ровно две строки */
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Текст у нижнего края мягко растворяется, пока описание свёрнуто —
   так видно, что он продолжается. */
.card .desc::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1.5em;
  background: linear-gradient(to bottom, transparent, var(--card));
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.card .desc.expanded::after {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .card .desc,
  .card .desc::after {
    transition: none;
  }
}

.card .desc-more {
  align-self: flex-start;
  margin: -4px 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--accent);
  cursor: pointer;
}

.card .desc-more:hover {
  text-decoration: underline;
}

/* ------------------------------------------------ вопросы и ответы ---- */

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-q {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.faq-q:hover {
  color: var(--accent);
}

.faq-q i {
  margin-left: auto;
  flex: none;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.25s ease;
}

.faq-item.open .faq-q i {
  transform: rotate(45deg);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-a p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre-line;
}

@media (prefers-reduced-motion: reduce) {
  .faq-a {
    transition: none;
  }
}

/* ------------------------------------------------------------ карта ---- */

.map-block {
  margin-top: 6px;
}

/* Пока карту не открыли — просто рамка с кнопкой. Так страница не тянет
   ничего со стороннего сервера, пока человек сам этого не захотел. */
.map-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 18px;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.map-frame.loaded {
  display: block;
  padding: 0;
  min-height: 0;
}

.map-frame iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
}

.map-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 14.5px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
  /* прижимаем цену к низу карточки независимо от длины описания */
  margin-top: auto;
}

.price {
  color: var(--accent);
  font-weight: 700;
  font-size: 17px;
  margin-left: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 13px;
}

/* ------------------------------------------------------- запись ------- */

.booking {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.book-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.step-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.step-label i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.14s;
  font-family: inherit;
}

.chip:hover {
  border-color: var(--accent);
}

.chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.chip small {
  opacity: 0.7;
  margin-left: 6px;
}

/* ------------------------------- сетка времени дня («как в кино») ----- */

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px;
}

.tl-cell {
  padding: 9px 2px;
  text-align: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  font-size: 13.5px;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.tl-cell.off {
  opacity: 0.32;
  border-style: dashed;
}

.tl-cell.busy {
  color: var(--muted);
  text-decoration: line-through;
  background: repeating-linear-gradient(
    45deg,
    var(--card-2),
    var(--card-2) 5px,
    color-mix(in srgb, var(--line) 70%, transparent) 5px,
    color-mix(in srgb, var(--line) 70%, transparent) 10px
  );
}

.tl-cell.open {
  color: var(--text);
  cursor: pointer;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.tl-cell.open:hover {
  border-color: var(--accent);
}

.tl-cell.buf {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--text);
}

.tl-cell.sel {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}

.tl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.tl-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tl-legend i {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--card-2);
  display: inline-block;
  flex: none;
}

.tl-legend i.l-open {
  border-color: var(--accent);
}
.tl-legend i.l-sel {
  background: var(--accent);
  border-color: var(--accent);
}
.tl-legend i.l-buf {
  background: var(--accent-soft);
}
.tl-legend i.l-busy {
  background: repeating-linear-gradient(
    45deg,
    var(--card-2),
    var(--card-2) 3px,
    color-mix(in srgb, var(--line) 80%, transparent) 3px,
    color-mix(in srgb, var(--line) 80%, transparent) 6px
  );
}

.chosen-line {
  margin: 14px 0 0;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  font-size: 14.5px;
}

.variant-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  margin: 0;
}

.variant-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed var(--line);
  padding: 3px 0;
}

.variant-list div span:last-child {
  color: var(--accent);
  font-weight: 700;
}

/* --------------------------------------------------- календарь -------- */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-title {
  font-weight: 600;
  font-size: 17px;
}

.cal-title::first-letter {
  text-transform: uppercase;
}

.cal-nav {
  display: flex;
  gap: 6px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-dow {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 4px;
}

.cal-day {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--card-2);
  color: var(--muted);
  font-size: 14px;
  display: grid;
  place-items: center;
  position: relative;
  cursor: not-allowed;
  font-family: inherit;
  padding: 0;
}

.cal-day.empty {
  background: none;
}

.cal-day.free {
  color: var(--text);
  cursor: pointer;
  border-color: var(--line);
}

.cal-day.free:hover {
  border-color: var(--accent);
}

.cal-day.free::after {
  content: '';
  position: absolute;
  bottom: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.cal-day.on {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  font-weight: 700;
}

.cal-day.on::after {
  background: var(--accent-text);
}

.cal-day.today {
  outline: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 1px;
}

.cal-legend {
  display: flex;
  gap: 16px;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 12px;
}

.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cal-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.cal-legend i.busy {
  background: var(--line);
}

/* ------------------------------------------------------- формы -------- */

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
textarea,
select {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
  min-height: 74px;
}

.form-error {
  color: var(--red);
  font-size: 13.5px;
  margin-top: 10px;
}

.notice {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  margin: 4px 0 16px;
  display: flex;
  gap: 10px;
}

/* ------------------------------------------------------- успех -------- */

.success {
  text-align: center;
  padding: 30px 16px;
}

.success .tick {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 30px;
  margin: 0 auto 16px;
}

.success h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.summary {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 18px auto;
  max-width: 380px;
  text-align: left;
  font-size: 14.5px;
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.summary div span:first-child {
  color: var(--muted);
}

/* ------------------------------------------------------ подвал -------- */

footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  color: var(--muted);
  font-size: 14px;
}

.foot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: space-between;
}

.foot-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.foot-links a {
  color: var(--muted);
  text-decoration: none;
}

.foot-links a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------ адаптив ------- */

@media (max-width: 900px) {
  .book-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------- телефоны ------ */

@media (max-width: 760px) {
  /* Шапка в две строки: сверху название и кнопки, снизу пункты меню.
     Раньше меню на телефоне пропадало совсем и попасть в разделы было нечем. */
  .top-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 10px;
    padding-bottom: 8px;
    gap: 10px;
  }

  .top-actions {
    margin-left: auto;
  }

  nav.links {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 18px;
    /* если названия разделов не помещаются — лента прокручивается пальцем */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  nav.links::-webkit-scrollbar {
    display: none;
  }

  nav.links a {
    white-space: nowrap;
    padding: 6px 0;
  }

  /* Поля ввода: 16 пикселей обязательны. При меньшем размере Safari на
     айфоне сам увеличивает страницу, как только палец касается поля, и
     сайт «уезжает» — это и выглядит как кривая вёрстка. */
  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* Пальцем нужно попадать: цель не меньше 44 пикселей.
     У дней календаря высоту не задаём — они квадратные, и жёсткая высота
     сделала бы их шире ячейки и распёрла бы панель. Вместо этого убираем
     промежутки, и клетки сами становятся крупнее. */
  .cal-grid {
    gap: 4px;
  }

  .cal-grid button {
    font-size: 15px;
  }

  .timeline button {
    min-height: 44px;
  }

  .chips button {
    min-height: 44px;
    font-size: 15px;
  }

  .lang-switch button {
    min-width: 40px;
    padding: 11px 8px;
    font-size: 13px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  /* Фотографии услуг на телефоне были узкой полоской */
  .card-img {
    height: 200px;
  }

  .hero {
    padding: 44px 0 34px;
  }

  section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 26px;
  }

  /* Кнопки под заголовком — во всю ширину, чтобы не жались друг к другу */
  .hero .btn {
    flex: 1 1 100%;
    text-align: center;
  }

  .panel {
    padding: 16px 14px;
  }

  .foot-grid {
    gap: 14px;
  }
}

/* --- совсем узкие экраны (айфон SE и подобные) --- */
@media (max-width: 380px) {
  .wrap {
    padding: 0 14px;
  }

  .logo {
    font-size: 16px;
  }

  .logo .mark {
    width: 28px;
    height: 28px;
  }

  .lang-switch button {
    min-width: 34px;
    padding: 11px 5px;
    font-size: 12px;
  }

  .cal-grid button {
    font-size: 14px;
  }
}
