/* Палитра Nail Space. Барбершопная (чёрный + золото) переехала бы на сайт
   ногтевой студии как чужая: тёмный фон съедает светлые фото маникюра, а
   золото читается как «мужской салон». Здесь молочный фон и rose gold. */
:root {
  --bg: #fbf7f5;
  --bg-tint: #f4e9e6;
  --card: #ffffff;
  --card-2: #fbf4f2;
  --field: #fdf9f8;
  --sel-bg: #fbeef0;
  --text: #2a2226;
  --muted: #8a7a80;
  --accent: #b76e79;
  --accent-2: #c98b94;
  --on-accent: #ffffff;
  --danger: #c0392b;
  --success: #2e7d5b;
  --border: rgba(42,34,38,.12);
  --ring: rgba(183,110,121,.55);
  --ring-soft: rgba(183,110,121,.16);
  --shadow: 0 18px 50px rgba(120,80,90,.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, var(--bg-tint) 0, var(--bg) 45%);
  color: var(--text);
}

.app {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.hero {
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 32px;
  margin-bottom: 18px;
  background:
    linear-gradient(115deg, rgba(251,247,245,.94) 0%, rgba(251,247,245,.72) 45%, rgba(251,247,245,.28) 100%),
    var(--hero-photo, none) center/cover;
  box-shadow: var(--shadow);
}

.hero__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.eyebrow {
  /* Название приезжает из базы в своём регистре — «Дентал Плюс», «Nail Space».
     Разрядка в .22em читается как надстрочник только в верхнем регистре,
     поэтому поднимаем его тут, а не просим базу хранить капс. */
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--accent-2);
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(40px, 7vw, 76px); line-height: .9; margin-bottom: 18px; }
h2 { font-size: 20px; margin-bottom: 0; }
.hero__text { max-width: 480px; color: var(--muted); font-size: 18px; line-height: 1.5; }
.badge {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  color: var(--accent-2);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
}

.booking {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}
.booking__col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.booking__col::after {
  content: "";
  flex: 1 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(120,80,90,.10);
  margin-bottom: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.section-title span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 900;
}

.options, .masters, .categories { display: grid; gap: 12px; }
.option, .master, .date-btn, .time-btn, .category {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  transition: .18s ease;
}
.option:hover, .master:hover, .date-btn:hover, .time-btn:hover, .category:hover { transform: translateY(-1px); border-color: var(--ring); }
.option.active, .master.active, .date-btn.active, .time-btn.active, .category.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--ring-soft) inset;
  background: var(--sel-bg);
}
.option__top, .master__top, .category__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}
.option__meta, .master__meta, .category__meta { color: var(--muted); font-size: 14px; }

/* Категории в ряд (мужская/женская/детская), услуги открытой категории — списком под ними */
.categories { grid-template-columns: repeat(3, 1fr); margin-bottom: 14px; }
.categories .category { text-align: center; }
.categories .category__top { justify-content: center; }

.date-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.date-btn { text-align: center; padding: 12px 8px; }
.date-btn strong { display: block; font-size: 20px; }
.date-btn span { color: var(--muted); font-size: 13px; }

.custom-date { margin-bottom: 14px; }
.custom-date__label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.custom-date__input {
  color-scheme: light; /* тема салона светлая — иначе системный попап календаря приедет тёмным */
  width: 100%;
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
  border-radius: 16px;
  padding: 13px 16px;
  font: inherit;
  outline: none;
}
.custom-date__input:focus { border-color: var(--accent); }

.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time-btn { text-align: center; padding: 13px 10px; font-weight: 800; }

.field { display: grid; gap: 8px; margin-bottom: 14px; color: var(--muted); }
input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
  border-radius: 16px;
  padding: 15px 16px;
  font: inherit;
  outline: none;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); }

.sticky { position: sticky; top: 18px; }
.summary__text {
  color: var(--muted);
  line-height: 1.7;
  margin: 14px 0 18px;
  white-space: pre-line;
}
button[type="submit"], .modal button {
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  padding: 16px;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
}
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 14px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(42,34,38,.55);
  display: none;
  place-items: center;
  padding: 18px;
}
.modal.open { display: grid; }
.modal__content {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 28px;
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow);
}
.success-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 32px;
  font-weight: 900;
}
#successText { color: var(--muted); line-height: 1.6; white-space: pre-line; }
.modal__content .cta-link { width: 100%; display: block; margin-bottom: 12px; }

@media (max-width: 860px) {
  .app { padding: 14px; }
  .hero { border-radius: 24px; padding: 22px; }
  .booking { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .date-row { grid-template-columns: repeat(5, minmax(58px, 1fr)); overflow-x: auto; }
  .time-grid { grid-template-columns: repeat(2, 1fr); }
  .categories { grid-template-columns: 1fr; }
}

/* Honeypot — скрыт от людей визуально, но не через display:none, чтобы боты его все равно "видели" и заполняли */
.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  left: -9999px;
  opacity: 0;
}
.field-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 1px var(--danger);
  border-radius: 18px;
}
.field-valid {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 1px var(--success);
  border-radius: 18px;
}

/* Подсказка под полем (например, под именем) */
.field-hint {
  display: block;
  margin-top: -2px;
  font-size: 13px;
  color: var(--muted);
}

/* Счетчик символов под комментарием */
.comment-hint {
  display: flex;
  justify-content: flex-end;
  font-size: 13px;
  color: var(--muted);
}

/* Неактивная кнопка отправки, пока форма не заполнена корректно */
button[type="submit"]:disabled {
  opacity: .5;
  cursor: not-allowed;
  filter: grayscale(35%);
}

.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* Утилита-переключатель: должна перебивать любые display у элемента.
   Без !important проигрывает по специфичности правилам вида
   ".modal__content .cta-link" (0,2,0) — и скрытие молча не срабатывает. */
.hidden { display: none !important; }

/* Дата, в которую выбранный мастер не работает */
.date-btn--disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}
.date-btn--disabled:hover {
  transform: none;
  border-color: var(--border);
}

.submit-notice {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin: 10px 0 0;
}

/* === Лендинг (index.html) === */

.cta-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  padding: 16px 26px;
  font-weight: 900;
  font-size: 16px;
  text-align: center;
}
.cta-link:hover { filter: brightness(1.05); }
.hero__cta { margin-top: 22px; }

.social-links {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.social-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  color: var(--accent-2);
  transition: .18s ease;
}
.social-icon:hover {
  border-color: var(--accent);
  background: var(--sel-bg);
  transform: translateY(-2px);
}
.social-icon svg {
  width: 20px;
  height: 20px;
}

.teasers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.teaser {
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--card-2);
  border-radius: 22px;
  padding: 20px;
  transition: .18s ease;
}
.teaser:hover { transform: translateY(-2px); border-color: var(--ring); }
.teaser__title { font-weight: 800; font-size: 18px; margin-bottom: 6px; }
.teaser__meta { color: var(--muted); font-size: 14px; }

.location {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
  align-items: stretch;
}
.location__details { display: grid; gap: 14px; align-content: start; }
.location__row { display: flex; gap: 12px; align-items: flex-start; }
.location__icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sel-bg);
  color: var(--accent-2);
  font-size: 17px;
}
.location__label { font-weight: 800; margin-bottom: 2px; }
.location__value { color: var(--muted); font-size: 14px; line-height: 1.5; }

.map-placeholder {
  min-height: 220px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 35% 40%, var(--ring-soft), transparent 55%),
    repeating-linear-gradient(0deg, rgba(42,34,38,.05) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(42,34,38,.05) 0 1px, transparent 1px 28px),
    var(--card-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}
.map-placeholder__pin {
  font-size: 28px;
  margin-bottom: 8px;
}

/* ── Состояние загрузки ──────────────────────────────────────────────────
   До ответа конфига страница не знает ни названия салона, ни языка, ни
   палитры — всё это приезжает из site.theme и site.brand. Раньше в эти
   секунды было видно сырьё: пустую розовую кнопку без надписи, английские
   «Address / Opening hours» на украинском салоне и клетчатую заглушку
   карты. Выглядело как сломанный сайт, а не как загрузка.

   Прячем через visibility, а не display: коробки остаются на месте, и
   когда контент появляется, макет не прыгает.

   .site-failed сюда не попадает намеренно: если конфиг не пришёл совсем,
   пусть будет видно хоть что-то, а не пустота. */
html:not(.site-ready):not(.site-failed) .badge,
html:not(.site-ready):not(.site-failed) .cta-link,
html:not(.site-ready):not(.site-failed) .mobile-cta,
html:not(.site-ready):not(.site-failed) .social-links,
html:not(.site-ready):not(.site-failed) .map-placeholder,
html:not(.site-ready):not(.site-failed) .location__row,
html:not(.site-ready):not(.site-failed) .location__label,
html:not(.site-ready):not(.site-failed) .location__value,
html:not(.site-ready):not(.site-failed) .teasers,
html:not(.site-ready):not(.site-failed) .gallery,
html:not(.site-ready):not(.site-failed) [data-site],
html:not(.site-ready):not(.site-failed) [data-site-hours],
html:not(.site-ready):not(.site-failed) [data-site-faq],
/* На странице записи то же самое: заголовки шагов и кнопка «Записатися»
   зашиты по-английски как умолчание разметки и до конфига мигали бы
   английским на украинском салоне. */
html:not(.site-ready):not(.site-failed) [data-i18n],
/* Плейсхолдеры полей — тоже английские до конфига, но их правит
   data-i18n-ph, а не data-i18n, и в список они не попадали: на украинском
   салоне светились "For example, Alex" и "+1 555 123 4567". */
html:not(.site-ready):not(.site-failed) [data-i18n-ph],
/* Номера шагов и голое поле даты пульсации не имели и висели поверх
   пустых карточек, из-за чего скелет выглядел не загрузкой, а поломкой. */
html:not(.site-ready):not(.site-failed) .section-title span,
html:not(.site-ready):not(.site-failed) .custom-date__input {
  visibility: hidden;
}

/* Палитра в :root — это палитра одного конкретного салона, розовая. Любой
   другой салон заливался ею на весь экран и перекрашивался только после
   конфига. Пока конфига нет, держим нейтральный серый: он читается как
   загрузка, а не как чужой бренд. После конфига applyTheme пишет свои
   значения инлайном в documentElement.style и бьёт это правило. */
html:not(.site-ready):not(.site-failed) {
  --accent: #d9d4d6;
  --accent-2: #e3dee0;
  --bg: #f6f4f4;
  --bg-tint: #efecec;
  --card-2: #f4f1f1;
  --field: #f8f6f6;
  --sel-bg: #f1eeee;
}

/* Пустые карточки без пульсации читаются как «ничего не грузится» */
html:not(.site-ready):not(.site-failed) .card,
html:not(.site-ready):not(.site-failed) .hero {
  animation: skeleton 1.4s ease-in-out infinite;
}
@keyframes skeleton {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}
@media (prefers-reduced-motion: reduce) {
  html:not(.site-ready):not(.site-failed) .card,
  html:not(.site-ready):not(.site-failed) .hero { animation: none; }
}

/* Карта — настоящая ссылка «открыть в картах», а не мёртвая плашка */
.map-placeholder__link {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: 18px;
  text-align: center;
  color: inherit;
  text-decoration: none;
  border-radius: inherit;
  transition: .18s ease;
}
.map-placeholder__link:hover { background: var(--sel-bg); }
.map-placeholder__go {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-weight: 600;
}
.map-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

@media (max-width: 860px) {
  .teasers { grid-template-columns: 1fr; }
  .location { grid-template-columns: 1fr; }

  /* В одну колонку карточки шли 1 → 3 → 2 → 4: нумерация свёрстана под
     две колонки, а ниже 860px колонка одна. display:contents вынимает
     карточки из обёрток, и order выстраивает их по порядку шагов. */
  .booking__col { display: contents; }
  .booking__col::after { display: none; }
  #serviceSection { order: 1; }
  #masterSection  { order: 2; }
  #dateSection    { order: 3; }
  #detailsSection { order: 4; }
  .booking .summary { order: 5; }
}

/* Галерея работ */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  display: block;
}
@media (max-width: 560px) {
  /* Одна колонка только на телефоне: на 800px картинка во всю ширину
     занимает целый экран и галерея превращается в вертикальную ленту. */
  .gallery { grid-template-columns: 1fr; }
}

/* FAQ-аккордеон */
.faq { display: grid; gap: 10px; }
.faq__item {
  border: 1px solid var(--border);
  background: var(--card-2);
  border-radius: 16px;
  padding: 14px 16px;
}
.faq__item summary {
  cursor: pointer;
  font-weight: 800;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  color: var(--accent-2);
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
  transition: transform .18s ease;
}
.faq__item[open] summary::after { content: "–"; }
.faq__item p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 10px 0 0;
}

/* Липкая кнопка "Записаться" на мобильном — на десктопе скрыта */
.mobile-cta { display: none; }
@media (max-width: 860px) {
  .app { padding-bottom: 88px; }
  .mobile-cta {
    display: block;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 50;
    text-decoration: none;
    text-align: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--on-accent);
    padding: 15px;
    font-weight: 900;
    box-shadow: var(--shadow);
  }
}

/* Превью фото-примера работы выбранного мастера по выбранной услуге */
.master-preview {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card-2);
}
.master-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.master-preview__caption {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

/* === booking.html === */
.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 14px;
}
.back-link:hover { color: var(--accent-2); }

.hero--compact {
  min-height: auto;
  padding: 22px 28px;
  background: linear-gradient(120deg, var(--bg-tint), var(--bg));
}
.h1--small { font-size: clamp(28px, 5vw, 40px); margin-bottom: 8px; }
.hero--compact .hero__text { font-size: 15px; max-width: none; }

/* Вторичная кнопка в модалке (календарь) — приглушённая, чтобы не спорить с телеграмом */
.cta-link--ghost {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.cta-link--ghost:hover { filter: none; border-color: var(--ring); }

/* Пояснение под телеграм-кнопкой в модалке */
.modal__hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 12px;
}

/* Telegram-CTA: фирменный синий. В модалке своя цветовая логика —
   она перекрывает страницу затемнением, поэтому палитра салона тут не спорит.
   Задача кнопки одна: чтобы её нажали. */
:root { --tg-blue: #229ED9; --tg-blue-dark: #1c8ac0; }

/* .modal__content .cta-link (выше в файле) задаёт display: block и по специфичности
   (два класса против одного) бьёт .cta-link--telegram. Поэтому селектор здесь тоже
   двойной — иначе flex не применяется и иконка встаёт над текстом. */
.modal__content .cta-link--telegram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--tg-blue);
  color: #fff;
  border: 0;
}
.modal__content .cta-link--telegram:hover {
  filter: none;
  background: var(--tg-blue-dark);
}
.cta-link__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #fff;
  /* SVG по умолчанию inline — под ним остаётся паразитный отступ от line-height
     родителя, из-за чего иконка визуально уезжает вверх от текста. block снимает это. */
  display: block;
}

/* "Вернуться" — наименее важное действие в модалке, но селектор .modal button
   красил её тем же золотым градиентом, что и главный CTA. Из-за этого иерархия
   читалась вверх ногами. Делаем её тихой: синяя (главное) -> серая -> эта. */
#closeModal {
  background: none;
  color: var(--muted);
  font-weight: 700;
  padding: 12px;
  margin-top: 4px;
}
#closeModal:hover { color: var(--text); }


/* Плашка демо-режима: показывается, только когда бэкенд не ответил и
   витрина отрисована из снимка. Молчаливое демо, притворяющееся боевым,
   хуже честного демо. */
[data-demo-banner] {
  position: sticky; top: 0; z-index: 999;
  padding: 8px 16px; text-align: center;
  font-size: 13px; line-height: 1.3; letter-spacing: .01em;
  color: #4a3b2f; background: #ffe9c7;
  border-bottom: 1px solid #e8cfa3;
}
