/* ===== Токены ===== */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --wood: #efe4d4;
  --text: #2b211a;
  --muted: #6e6259;
  --line: #e6dccf;
  --accent: #b5652b;
  --accent-dark: #8e4b1c;
  --accent-soft: #f6e6d7;
  --ok: #2f7a4a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(43, 33, 26, .06), 0 8px 24px rgba(43, 33, 26, .06);
  --wrap: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  overflow-wrap: break-word;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 5vw, 48px); }
h2 { font-size: clamp(26px, 3.6vw, 36px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.section--wood { background: var(--wood); }
.section__lead { color: var(--muted); max-width: 680px; margin-bottom: 36px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 10px; border: 2px solid transparent;
  font: 600 16px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { border-color: var(--accent); color: var(--accent-dark); background: transparent; }
.btn--ghost:hover { background: var(--accent-soft); }
.btn svg { width: 20px; height: 20px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ===== Шапка ===== */
.header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 247, 242, .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header__row { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo__mark {
  width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: #fff;
  display: grid; place-items: center;
}
.logo__mark svg { width: 22px; height: 22px; }
.logo__text { line-height: 1.15; }
.logo__text b { display: block; font-size: 16px; }
.logo__text span { font-size: 13px; color: var(--muted); }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--accent-dark); }
.header__phone { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.header__cta { padding: 10px 16px; font-size: 15px; }
.burger { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--text); }
.burger svg { width: 26px; height: 26px; }

@media (max-width: 960px) {
  .nav, .header__cta { display: none; }
  .burger { display: block; }
  .header__phone { margin-left: auto; font-size: 15px; }
  .burger { margin-left: 0; }
  .nav.is-open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; left: 0; right: 0; top: 68px;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav.is-open a { padding: 14px 20px; border-top: 1px solid var(--line); }
}
@media (max-width: 420px) {
  .logo__text span { display: none; }
}

/* ===== Хлебные крошки ===== */
.crumbs { font-size: 14px; color: var(--muted); padding-top: 20px; }
.crumbs a { color: var(--muted); }

/* ===== Первый экран ===== */
.hero { padding: 56px 0 72px; }
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero__lead { font-size: 19px; color: var(--muted); max-width: 560px; }
.hero__list { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 8px; }
.hero__list li { display: flex; gap: 10px; align-items: flex-start; }
.hero__list svg { flex: none; width: 22px; height: 22px; color: var(--ok); margin-top: 2px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__media { position: relative; }
.hero__media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }

.profi-badge {
  position: absolute; left: -20px; bottom: -24px;
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow);
  padding: 14px 18px; display: flex; gap: 14px; align-items: center;
  text-decoration: none; color: var(--text);
}
.profi-badge__score { font-size: 28px; font-weight: 800; line-height: 1; }
.profi-badge__stars { color: #e0a100; letter-spacing: 2px; font-size: 15px; }
.profi-badge__meta { font-size: 13px; color: var(--muted); }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .profi-badge { left: 12px; bottom: -20px; }
}

/* ===== Услуги ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column;
}
.card__icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-dark);
  display: grid; place-items: center; margin-bottom: 16px;
}
.card__icon svg { width: 26px; height: 26px; }
.card p { color: var(--muted); font-size: 15px; }
.card__price { font-weight: 700; margin-top: auto; }
.card__link { margin-top: 12px; font-weight: 600; font-size: 15px; }
a.card { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }

/* ===== Шаги ===== */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding-top: 52px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center;
}
.steps p { color: var(--muted); font-size: 15px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ===== Цены ===== */
.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.price-table {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; width: 100%;
}
.price-table h3 { margin-bottom: 8px; }
.price-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.price-table td { padding: 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
.price-table td:last-child { text-align: right; white-space: nowrap; font-weight: 700; padding-left: 12px; }
.note { font-size: 14px; color: var(--muted); margin-top: 20px; }

/* ===== Работы ===== */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery figure { margin: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.gallery a { display: block; }
.gallery img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; transition: opacity .15s; }
.gallery a:hover img { opacity: .9; }
.gallery figcaption { padding: 12px 16px; font-size: 14px; color: var(--muted); }
.gallery figcaption b { color: var(--text); display: block; font-size: 15px; }
@media (max-width: 960px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .gallery { grid-template-columns: 1fr 1fr; } }

/* ===== Отзывы ===== */
.reviews-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.rating-box { display: flex; align-items: center; gap: 16px; }
.rating-box__score { font-size: 44px; font-weight: 800; line-height: 1; }
.rating-box__stars { color: #e0a100; letter-spacing: 2px; }
.rating-box__meta { font-size: 14px; color: var(--muted); }
.reviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.review {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 0; position: relative;
}
.review__stars { color: #e0a100; letter-spacing: 2px; font-size: 14px; }
.review blockquote { margin: 10px 0 14px; font-size: 15px; }
.review figcaption { font-size: 14px; color: var(--muted); }
.review figcaption b { color: var(--text); }
.review--link { display: block; text-decoration: none; color: inherit; transition: border-color .15s; }
.review--link:hover { border-color: var(--accent); }
.review--link b { color: var(--accent-dark); }

/* ===== FAQ ===== */
.faq { max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 52px 18px 20px; font-weight: 600; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 24px; color: var(--accent); font-weight: 400;
}
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 20px 18px; color: var(--muted); }

/* ===== Контакты ===== */
.contacts-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 14px; }
.contacts-list a { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; color: var(--text); font-size: 18px; }
.contacts-list svg { width: 22px; height: 22px; color: var(--accent); }

/* ===== Текстовые страницы ===== */
.prose { max-width: 760px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.two-col { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: start; }
.two-col > *, .hero__grid > * { min-width: 0; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* ===== Подвал ===== */
.footer { background: #2b211a; color: #d9cbbb; padding: 48px 0 100px; font-size: 15px; }
.footer a { color: #f6e6d7; }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; }
.footer h3 { color: #fff; font-size: 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer__legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; color: #a8998a; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; } }
@media (min-width: 861px) { .footer { padding-bottom: 48px; } }

/* ===== Нижняя панель на телефоне ===== */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: none; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
.mobile-bar .btn { flex: 1; padding: 12px; font-size: 15px; }
@media (max-width: 860px) { .mobile-bar { display: flex; } }

/* ===== Cookie ===== */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; max-width: 560px;
  background: var(--text); color: #f6e6d7; border-radius: 12px; padding: 16px 18px;
  display: none; gap: 14px; align-items: center; font-size: 14px; box-shadow: var(--shadow);
}
.cookie a { color: #fff; }
.cookie.is-shown { display: flex; }
.cookie .btn { padding: 10px 16px; font-size: 14px; flex: none; }
@media (max-width: 860px) { .cookie { bottom: 84px; } }
.contacts-list__hours { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
@media (max-width: 520px) {
  .header__phone { display: none; }  /* на телефоне звонок — в нижней панели */
  .burger { margin-left: auto; }
}
.price-table .muted { font-size: 13px; color: var(--muted); }

/* ===== Просмотр фото ===== */
.lightbox {
  border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100vw; height: 100dvh;
  background: #16110d; color: #fff;
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox::backdrop { background: transparent; }
.lightbox__img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 120px); width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.lightbox__cap { margin-top: 14px; font-size: 15px; text-align: center; padding: 0 60px; }
.lightbox__btn {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%;
  width: 48px; height: 48px; font-size: 26px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.lightbox__btn:hover { background: rgba(255,255,255,.24); }
.lightbox__btn:focus-visible { outline: 2px solid #fff; }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
  .lightbox__prev, .lightbox__next { top: auto; bottom: 16px; transform: none; }
  .lightbox__img { max-height: calc(100dvh - 170px); }
  .lightbox__cap { padding: 0 16px; margin-bottom: 60px; }
}
.gallery a { cursor: zoom-in; }

/* ===== Очень узкие экраны (320–400 px) ===== */
.mobile-bar .btn { min-width: 0; }
@media (max-width: 400px) {
  .wrap { padding: 0 16px; }
  .price-table { padding: 16px; }
  .price-table td:last-child { white-space: normal; text-align: right; min-width: 88px; }
  .price-table td { overflow-wrap: anywhere; }
  .mobile-bar .btn { padding: 12px 8px; }
}
