/* Дизайн: «Теплий майстер», структура «Ціни-перший» (docs/03-design.md) */
:root {
  --bg: #fdf6ea;
  --tint: #faeeda;
  --card: #fffaf2;
  --line: #f0d6a8;
  --ph: #fac775;
  --ph-text: #633806;
  --accent: #854f0b;
  --accent-hover: #633806;
  --on-accent: #ffffff;
  --line-btn: #633806;
  --strong: #633806;
  --text: #412402;
  --muted: #7a5523;
  --head-bg: #633806;
  --head-text: #faeeda;
  --head-line: transparent;
  --mark-bg: #fac775;
  --mark-text: #633806;
  --foot-bg: #633806;
  --foot-text: #faeeda;
  --input-bg: #ffffff;
  --ok: #3b6d11;
  --bad: #a32d2d;
  --radius: 14px;
}


* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: 76px;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 6vw, 46px); font-weight: 800; max-width: 20ch; }
h2 { font-size: clamp(24px, 4.5vw, 32px); font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.draft { background: #e24b4a; color: #fff; text-align: center; font-size: 14px; padding: 6px 16px; }

.top { background: var(--head-bg); color: var(--head-text); border-bottom: 1px solid var(--head-line); position: sticky; top: 0; z-index: 10; }
.top__in { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; font-size: 17px; line-height: 1.1; }
.logo > span { white-space: nowrap; }
.logo small { display: block; font-weight: 500; font-size: 13px; opacity: .8; }
.logo__mark { display: none; width: 36px; height: 36px; border-radius: 10px; background: var(--mark-bg); color: var(--mark-text); place-items: center; }
/* Бургер: на телефоні стоїть на місці значка логотипа і відкриває бокове меню; на комп'ютері схований */
.burger { flex: none; width: 36px; height: 36px; margin-right: -2px; padding: 0; border: 0; border-radius: 10px; background: var(--mark-bg); color: var(--mark-text); display: grid; place-items: center; cursor: pointer; }
.burger svg { width: 24px; height: 24px; stroke-width: 2.4; }
.burger:focus-visible { outline: 2px solid var(--head-text); outline-offset: 2px; }
.menu { display: none; gap: 24px; font-weight: 500; font-size: 15px; }
.menu a { color: inherit; text-decoration: none; }
.menu a:hover { text-decoration: underline; }
/* Телефон у шапці. На телефоні: іконка зліва, номер та ім'я майстра у два рядки; на комп'ютері — в один рядок. */
.top__phone { flex: none; display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: center; color: inherit; font-weight: 700; font-size: 15px; line-height: 1.15; text-decoration: none; white-space: nowrap; }
.top__phone svg { grid-row: 1 / 3; width: 18px; height: 18px; }
.top__name { grid-column: 2; font-weight: 500; font-size: 13px; opacity: .85; }

.hero { background: var(--tint); padding: 40px 0 48px; }
.hero__row { display: flex; flex-wrap: wrap; gap: 22px 48px; align-items: flex-end; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 15px; margin-bottom: .6em; }
.lead { flex: 1 1 320px; font-size: 18px; color: var(--muted); margin: 0; max-width: 56ch; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
/* Фото «Майстер за роботою» (варіант A, 2026-10-12): на телефоні під кнопками, на комп'ютері праворуч від тексту у дві колонки */
.hero__photo { margin: 26px 0 0; max-width: 100%; aspect-ratio: 16 / 10; }
.hero__photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.ph {
  background: var(--ph); border-radius: var(--radius); color: var(--ph-text);
  display: grid; place-items: center; text-align: center; padding: 16px; font-weight: 500;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: var(--radius); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; border: 2px solid var(--accent);
}
.btn--main { background: var(--accent); color: var(--on-accent); }
.btn--main:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--line { background: transparent; color: var(--line-btn); }
.btn--line:hover { background: var(--card); }

.sec { padding: 56px 0; scroll-margin-top: 60px; }
.sec--tint { background: var(--tint); }
.sec__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 32px; }
.sec__head h2, .sec__head .sub { margin: 0; }
.sub { color: var(--muted); max-width: 640px; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card p { color: var(--muted); margin: 0; font-size: 16px; }
.card__ico { width: 44px; height: 44px; border-radius: 12px; background: var(--ph); color: var(--accent); display: grid; place-items: center; margin-bottom: 12px; }

/* Прайс: усі групи розгорнуті, у сітці карток */
.price { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 24px; align-items: start; }
.price__group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 10px; }
.price__group h3 { margin-bottom: 6px; }
.price ul { list-style: none; margin: 0; padding: 0; }
.price li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px dashed var(--line); font-size: 16px; }
.price li span { min-width: 0; }
/* Ціна не переноситься, поки є місце; на вузьких екранах довга ціна («50 – 100 грн / петля») переноситься, а не вилазить за картку */
.price b { flex: none; max-width: 58%; color: var(--strong); text-align: right; }

.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-top: 24px; }
.gallery .ph { aspect-ratio: 1; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); display: block; }
.shot { margin: 0; }
.shot figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }


.form-wrap { display: grid; gap: 28px; }
.contacts { display: grid; gap: 8px; font-weight: 700; font-size: 18px; }
.form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: 15px; }
.form input, .form textarea {
  font: inherit; color: var(--text); background: var(--input-bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; width: 100%;
}
.form input::placeholder, .form textarea::placeholder { color: var(--muted); opacity: .8; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form .btn { width: 100%; }
.hp { position: absolute; left: -9999px; }
.form .bad { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.err { display: none; color: var(--bad); font-size: 14px; }
.err.show { display: block; }
.note { font-size: 13px; color: var(--muted); margin: 0; }
.status { margin: 0; font-weight: 700; }
.status.ok { color: var(--ok); }
.status.fail { color: var(--bad); }

.foot { background: var(--foot-bg); color: var(--foot-text); padding: 28px 0; font-size: 15px; }
.foot p { margin: 0 0 4px; }
.foot a { color: inherit; }
.foot__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.foot__admin { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; opacity: .55; transition: opacity .15s, background .15s; }
.foot__admin:hover, .foot__admin:focus-visible { opacity: 1; background: rgba(255,255,255,.1); }

/* Бокове меню (телефон). Виїжджає зліва, під ним затемнення; закривається хрестиком, тапом по затемненню, посиланням або Esc */
.drawer { position: fixed; inset: 0; z-index: 30; visibility: hidden; transition: visibility 0s .25s; }
.drawer.open { visibility: visible; transition-delay: 0s; }
.drawer__bg { position: absolute; inset: 0; background: rgba(65, 36, 2, .55); opacity: 0; transition: opacity .25s; }
.drawer.open .drawer__bg { opacity: 1; }
.drawer__panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(84vw, 320px);
  background: var(--card); color: var(--text); display: flex; flex-direction: column;
  padding: 0 0 calc(20px + env(safe-area-inset-bottom)); box-shadow: 4px 0 24px rgba(65, 36, 2, .25);
  transform: translateX(-100%); transition: transform .25s ease;
}
.drawer.open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 0 12px 0 20px; background: var(--head-bg); color: var(--head-text); }
.drawer__title { font-weight: 800; font-size: 17px; }
.drawer__close { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; }
.drawer__close:hover, .drawer__close:focus-visible { background: rgba(255,255,255,.12); }
.drawer__link { display: block; padding: 16px 20px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.drawer__link:hover, .drawer__link:focus-visible { background: var(--tint); }
.drawer__contacts { margin-top: auto; padding: 20px; display: grid; gap: 12px; font-weight: 700; }
.drawer__contacts a { color: var(--accent); }
body.no-scroll { overflow: hidden; }

/* Галерея: фото — кнопка, яка відкриває перегляд на повний екран */
.shot__btn { display: block; width: 100%; padding: 0; border: 0; border-radius: var(--radius); background: none; cursor: zoom-in; }
.shot__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Повноекранний перегляд фото: саме фото, підпис і лічильник, стрілки; гортання свайпом і стрілками клавіатури */
.lightbox {
  position: fixed; inset: 0; z-index: 40; background: rgba(30, 17, 2, .96); color: var(--head-text);
  display: flex; flex-direction: column; padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
}
.lightbox[hidden] { display: none; }
.lightbox__stage { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; }
.lightbox__img { max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100svh - 150px); object-fit: contain; border-radius: 8px; }
.lightbox__close { position: absolute; top: 12px; right: 12px; z-index: 1; }
.lightbox__close, .lightbox__nav {
  flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.12); color: inherit; display: grid; place-items: center; cursor: pointer;
}
.lightbox__close:hover, .lightbox__nav:hover, .lightbox__close:focus-visible, .lightbox__nav:focus-visible { background: rgba(255,255,255,.25); }
.lightbox__nav:disabled { opacity: .3; cursor: default; }
.lightbox__nav[hidden] { display: none; }
.lightbox__bar { flex: none; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 60px; padding-top: 12px; }
.lightbox__cap { margin: 0; font-size: 15px; text-align: center; flex: 1 1 auto; min-width: 0; }
.lightbox__count { display: block; font-size: 13px; opacity: .7; }
.lightbox__count:empty { display: none; }
/* Під час анімації велике фото сховане: його місце займає «привид», що летить від мініатюри */
.lightbox.is-anim .lightbox__img { visibility: hidden; }
.lightbox__ghost { position: fixed; z-index: 41; margin: 0; object-fit: cover; pointer-events: none; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line);
}
.bar .btn { padding: 12px; }

/* Дуже вузькі телефони (до 360px): у шапці назва переноситься на два рядки, підзаголовок і ім'я майстра сховані, щоб нічого не вилазило за екран */
@media (max-width: 359px) {
  .logo { min-width: 0; font-size: 16px; }
  .logo > span { white-space: normal; }
  .logo small, .top__name { display: none; }
}

@media (min-width: 800px) {
  body { padding-bottom: 0; }
  .bar { display: none; }
  .burger, .drawer { display: none; }
  .logo__mark { display: grid; }
  .menu { display: flex; }
  .top__phone { display: flex; font-size: inherit; }
  .top__name { font-size: inherit; }
  .top__name::before { content: "· "; }
  .hero { padding: 72px 0; }
  .hero--photo .hero__in { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
  .hero--photo .hero__photo { margin-top: 0; aspect-ratio: 4 / 3; box-shadow: 0 16px 40px rgba(65, 36, 2, .16); }
  .form-wrap { grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
}
