/* =====================================================
   Сторінки послуг (/farbuvannia …) — Pages/ServicePage.cshtml.
   Підключається лише там; усі класи з префіксом sp-, щоб не зачепити головну.
   Кольори, шрифти й кнопки — як на головній: Chutz для заголовків, Montserrat для тексту.
   Макет: docs/coloring-mockups/g-combined.html
   ===================================================== */

:root {
  --sp-ink: #1f1b19;
  --sp-paper: #fff;
  --sp-sand: #eee6dc;
  --sp-beige: #ddcdb3;
  --sp-rose: #ad776b;
  --sp-rose-dark: #8f5f55;
  --sp-smoke: #5a5a5a;
  --sp-line: #e3dccf;
  --sp-gutter: 16px;
  --sp-max: 1160px;
}

@media (min-width: 900px) {
  :root { --sp-gutter: 40px; }
}

.sp-topbar,
.sp-page,
.sp-contact-bar {
  font: 400 16px/1.55 'Montserrat', sans-serif;
  color: var(--sp-ink);
  -webkit-font-smoothing: antialiased;
}

.sp-page picture,
.sp-page img {
  display: block;
  max-width: 100%;
}

.sp-topbar :focus-visible,
.sp-page :focus-visible,
.sp-contact-bar :focus-visible {
  outline: 2px solid var(--sp-rose);
  outline-offset: 3px;
}

.sp-wrap {
  max-width: var(--sp-max);
  margin: 0 auto;
  padding: 0 var(--sp-gutter);
}

/* ---------- Типографіка ---------- */
.sp-display {
  font-family: 'Chutz', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.02;
}

/* Заголовки розділів — як на головній (site.css, «Єдиний ритм заголовків розділів»):
   по центру, капс, 40px (планшет 36, телефон 30); до контенту 40px (телефон 24) */
.sp-title {
  font-family: 'Chutz', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-align: center;
  text-wrap: balance;
  margin-bottom: 40px;
}

@media (max-width: 1199px) and (min-width: 768px) {
  .sp-title { font-size: 36px; }
}

@media (max-width: 767px) {
  .sp-title { font-size: 30px; line-height: 1.2; margin-bottom: 24px; }
}

.sp-lead {
  font-size: 18px;
  line-height: 1.5;
  max-width: 46ch;
}

/* ---------- Кнопки ---------- */
.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 500 17px/1.2 'Montserrat', sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.sp-icon { width: 20px; height: 20px; flex: none; }

.sp-btn-main { background: var(--sp-rose-dark); color: #fff; }
.sp-btn-main:hover { background: #7a4f47; }
.sp-btn-line { border-color: currentColor; color: inherit; }
.sp-btn-line:hover { background: rgba(0, 0, 0, 0.04); }
.sp-btn-sm { min-height: 42px; padding: 9px 16px; font-size: 14px; }
.sp-btn-icon { width: 54px; padding: 0; border-color: var(--sp-ink); color: var(--sp-ink); }

.sp-btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Шапка ---------- */
.sp-topbar { background: var(--sp-ink); color: #fff; }

.sp-topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.sp-logo {
  display: flex;
  flex-direction: column;
  font-family: 'Chutz', sans-serif;
  font-size: 20px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--sp-beige);
}

.sp-logo-sub {
  font-family: 'Roboto Mono', monospace;
  font-weight: 300;
  font-size: 18px;
}

.sp-topnav { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.sp-topnav-link { color: #fff; opacity: 0.85; }
.sp-topnav-link:hover { opacity: 1; }

.sp-lang { display: flex; gap: 4px; }
.sp-lang .lang-btn { width: 40px; height: 36px; font-size: 13px; }

.sp-topphone,
.sp-topcta { display: none; }
.sp-topphone { color: #fff; font-weight: 500; white-space: nowrap; }

@media (min-width: 900px) {
  .sp-topnav { gap: 20px; font-size: 14px; }
  .sp-topphone,
  .sp-topcta { display: inline-flex; }
}

/* ---------- Перший екран ---------- */
/* знизу — такий самий відступ, як над заголовками: далі «Роботи» на фото-фоні */
.sp-hero { padding: 20px 0 56px; }
.sp-hero-in { display: grid; }

.sp-arch {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 5;
  /* верх — півколо: горизонтальний радіус = 50% ширини, вертикальний = 40% висоти (4:5) */
  border-radius: 50% 50% 0 0 / 40% 40% 0 0;
  overflow: hidden;
  background: var(--sp-sand);
}

.sp-arch picture,
.sp-arch img { width: 100%; height: 100%; }
.sp-arch img { object-fit: cover; object-position: 50% 20%; }

.sp-hero-text { padding-top: 24px; }
.sp-hero h1 { font-size: 46px; margin-bottom: 18px; }
.sp-hero .sp-lead { margin-bottom: 24px; }
.sp-hero .sp-btn-row { margin-bottom: 20px; }
.sp-hero .sp-btn-main { flex: 1 1 260px; }

.sp-facts { display: grid; gap: 2px; font-size: 15px; color: var(--sp-smoke); }

/* «5.0 ★★★★★ 174 відгуки у Google Maps» (_RatingBadge) — на головній світлий текст на фото, тут темний на білому */
.sp-facts .hero-trust-rating { margin-bottom: 6px; color: var(--sp-smoke); }
.sp-facts .hero-trust-rating b { color: var(--sp-ink); }

@media (min-width: 900px) {
  .sp-hero { padding: 48px 0 80px; }
  .sp-hero-in { grid-template-columns: 1.1fr 1fr; align-items: end; gap: 56px; }
  .sp-hero-text { order: -1; padding: 0 0 40px; }
  .sp-hero h1 { font-size: 92px; }
  .sp-arch { max-height: 680px; }
  .sp-hero .sp-btn-main { flex: 0 0 auto; }
}

/* ---------- Секції ---------- */
/* Ритм як на головній: 80px над заголовком і знизу розділу (телефон 56) */
.sp-block { padding: 80px 0; }
@media (max-width: 767px) { .sp-block { padding: 56px 0; } }
.sp-block-sand { background: var(--sp-sand); }

/* два білі розділи поспіль (напр. «Як це працює» і «Майстри») — відступ між ними один, а не подвійний */
.sp-block:not(.sp-block-sand) + .sp-block:not(.sp-block-sand),
.sp-block:not(.sp-block-sand) + .reviews,
.reviews + .sp-block:not(.sp-block-sand) { padding-top: 0; }

/* ---------- Роботи: як «Галерея робіт» на головній ---------- */
/* Заголовок-плашка (.gallery-title) і кнопка Instagram (.gallery-link) — з site.css; тут фон і сітка */
.sp-works {
  padding-bottom: 80px;
  background: linear-gradient(rgba(20, 17, 16, 0.55), rgba(20, 17, 16, 0.55)), url('../img/gallery-bg-interior.webp') center / cover no-repeat;
}

@media (max-width: 767px) {
  .sp-works { padding-bottom: 56px; }
}

.sp-works-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 900px) {
  .sp-works-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
}

/* 3 фото — 3 колонки всюди, 6 — 3 колонки на десктопі: без дірок у сітці (класи ставить ServicePage.cshtml) */
.sp-works-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (min-width: 900px) {
  .sp-works-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* кожне фото — кнопка: відкриває роботи у форматі сторіз (js/service-stories.js) */
.sp-work {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  background: none;
  cursor: pointer;
}

.sp-works-grid img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 0.4s ease;
}

/* лише з мишкою: на телефоні :hover «залипає» після тапу — фото лишалось збільшеним після закриття сторіз */
@media (hover: hover) {
  .sp-work:hover img { transform: scale(1.04); }
}

.sp-works .gallery-link { margin-top: 32px; }

/* ---------- Ціни на шкалі ---------- */
.sp-scale-box {
  max-width: 820px;
  margin: 0 auto;
  background: var(--sp-paper);
  border-radius: 10px;
  padding: 20px 16px 4px;
}

@media (min-width: 900px) {
  .sp-scale-box { padding: 28px 32px 8px; }
}

.sp-scale { list-style: none; }
.sp-scale li { padding: 12px 0; }

/* Підписи осі стоять точно на своїх значеннях (крок — у PriceScale: 0 / 5 000 / 10 000 з 13 000) */
.sp-scale .sp-scale-axis {
  position: relative;
  height: 26px;
  padding: 0;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--sp-smoke);
  border-bottom: 1px solid var(--sp-line);
}

/* > — лише самі підписи: усередині останнього ще span «грн» (перекладається на UAH) */
.sp-scale-axis > span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.sp-scale-axis > span:first-child { transform: none; }
/* підпис біля самого кінця шкали (2 000 з 2 100) — праворуч від позначки не вміщається: вирівнюємо по правому краю */
.sp-scale-axis > .sp-scale-tick-end { transform: translateX(-100%); }

/* Підзаголовок групи прайсу («Стрижки ножицями», «Догляд К18») */
.sp-scale .sp-scale-group {
  padding: 18px 0 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sp-rose-dark);
}

.sp-scale .sp-scale-axis + .sp-scale-group { padding-top: 6px; }

.sp-scale-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 15px;
}

.sp-scale-head b { font-weight: 600; white-space: nowrap; }

.sp-scale-track {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: rgba(31, 27, 25, 0.08);
}

.sp-scale-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 10px;
  border-radius: 5px;
  background: var(--sp-rose-dark);
}

.sp-price-note { margin: 8px 0 16px; max-width: 60ch; font-size: 14px; color: var(--sp-smoke); }

/* ---------- Як це працює ---------- */
.sp-steps { list-style: none; display: grid; gap: 28px; }

.sp-steps li { display: grid; grid-template-columns: 48px 1fr; gap: 4px 16px; }

.sp-step-n {
  grid-row: span 2;
  font-family: 'Chutz', sans-serif;
  font-size: 44px;
  line-height: 0.9;
  color: var(--sp-rose);
}

.sp-steps h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.sp-steps p { color: var(--sp-smoke); max-width: 40ch; }

@media (min-width: 900px) {
  .sp-steps { grid-template-columns: repeat(3, 1fr); gap: 40px; }
}

/* ---------- Майстри ---------- */
.sp-masters { display: grid; gap: 24px; }

@media (min-width: 640px) {
  .sp-masters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.sp-master-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 14px;
}

.sp-master h3 { font-size: 18px; font-weight: 600; }
.sp-master p { font-size: 15px; color: var(--sp-smoke); }

/* ---------- Питання ---------- */
.sp-faq { max-width: 760px; margin: 0 auto; }
.sp-faq details { border-bottom: 1px solid var(--sp-line); }

.sp-faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  list-style: none;
}

.sp-faq summary::-webkit-details-marker { display: none; }

.sp-faq summary::after {
  content: '+';
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.sp-faq details[open] summary::after { transform: rotate(45deg); }
.sp-faq details p { padding: 0 0 20px; max-width: 60ch; color: var(--sp-smoke); }

/* ---------- Інші послуги ---------- */
/* Телефон: стрічка вбік зі снапом; десктоп: до п'яти в ряд */
.sp-others {
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 42%);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}

.sp-others li { scroll-snap-align: start; }

.sp-other {
  display: grid;
  gap: 10px;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.sp-other img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
}

.sp-other:hover span,
.sp-other:focus-visible span { text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 900px) {
  .sp-others {
    grid-auto-flow: row;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
  }
}

/* ---------- Фінал і контакти ---------- */
/* по центру, як і заголовок: заклик з кнопками, під ним адреса */
.sp-final { display: grid; gap: 40px; justify-items: center; text-align: center; }

.sp-final .sp-title { margin-bottom: 16px; }
.sp-final .sp-lead { margin: 0 auto 24px; }
.sp-final .sp-btn-row { justify-content: center; }

.sp-where { font-style: normal; display: grid; justify-items: center; gap: 6px; font-size: 16px; }
.sp-where a { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Нижня панель на телефоні ---------- */
.sp-contact-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  gap: 8px;
  padding: 10px var(--sp-gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--sp-line);
}

.sp-contact-bar .sp-btn-main { flex: 1; }

/* body.has-contact-bar ставить _Layout (ViewData["OwnContactBar"]): місце під панеллю,
   кругла «Зв'язатися» на телефоні не потрібна — дзвінок і Telegram уже в панелі */
@media (max-width: 899px) {
  .has-contact-bar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .has-contact-bar .contact-fab { display: none; }
}

@media (min-width: 900px) {
  .sp-contact-bar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sp-faq summary::after,
  .sp-works-grid img { transition: none; }
}
