/* ===== Переменные: меняйте здесь, чтобы перекрасить сайт ===== */
:root {
  --bg: #1b1d21;
  --bg-alt: #22252a;
  --surface: #2a2e34;
  --surface-2: #32373e;
  --border: #3d434b;
  --text: #eceef0;
  --text-muted: #aab0b8;
  --accent: #ff7a1a;
  --accent-hover: #ff9144;
  --on-accent: #1b1d21;
  --free: #4fbf7a;
  --free-bg: rgba(79, 191, 122, .14);
  --busy: #6b727b;
  --busy-bg: rgba(255, 255, 255, .04);
  --warn-bg: rgba(255, 122, 26, .14);
  --danger: #ff6b6b;
  --radius: 10px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6;
  background: var(--bg); color: var(--text);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 800; }
h1 { font-size: clamp(1.9rem, 6.5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); font-family: "Oswald", var(--font); font-weight: 600; letter-spacing: .01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Одна ширина для всех разделов — как у шапки и первого экрана */
.container { width: 100%; max-width: 1760px; margin: 0 auto; padding: 0 clamp(16px, 4.5vw, 88px); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip-link:focus { left: 8px; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 10px 22px; border-radius: var(--radius);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { min-height: 42px; min-width: 46px; padding: 6px 14px; background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-small:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-messenger { background: var(--surface); border-color: var(--accent); color: var(--text); flex: 1 1 120px; }
.btn-messenger:hover { background: var(--accent); color: var(--on-accent); }

/* ===== Шапка ===== */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(27, 29, 33, .96); border-bottom: 1px solid var(--border); backdrop-filter: blur(6px); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.logo { display: inline-flex; flex-direction: column; text-decoration: none; line-height: 1.1; color: var(--text); }
.logo-mark { font-family: "Exo 2", var(--font); font-style: italic; font-weight: 900; font-size: 1.6rem; letter-spacing: .04em; color: var(--accent); }
.logo-sub { font-family: "Exo 2", var(--font); font-style: italic; font-weight: 800; font-size: .74rem; color: var(--text-muted); letter-spacing: .03em; }
.header-brands { display: flex; align-items: center; gap: 14px; padding-left: 16px; border-left: 2px solid var(--accent); }
.header-brands img { display: block; width: auto; opacity: .9; }
.header-brands .hb-shtenli { height: 15px; }
.header-brands .hb-profi { height: 19px; }
@media (max-width: 1360px) { .header-brands { display: none; } }
.nav a, .logo-sub { white-space: nowrap; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 4px; }
.nav a { display: block; padding: 8px 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; border-radius: 6px; }
.nav a:hover { color: var(--accent); background: var(--surface); }
.header-phone { font-weight: 800; color: var(--text); text-decoration: none; white-space: nowrap; }
.header-phone:hover { color: var(--accent); }
.burger { display: none; width: 46px; height: 46px; background: none; border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 0; }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; isolation: isolate; padding: 48px 0 48px; border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse at 75% 40%, #2b2f36 0%, var(--bg) 65%); }
.hero-inner { position: relative; z-index: 1; }
/* Широкий контейнер для шапки и первого экрана: текст ближе к левому краю */
.container-wide { max-width: 1760px; padding: 0 clamp(16px, 4.5vw, 88px); }
/* Композиция из техники: правая часть экрана, все позиции в % от этой области */
.hero-bg { position: absolute; top: 0; bottom: 0; right: 0; left: max(46%, 790px); z-index: 0; pointer-events: none; container-type: size;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%); mask-image: linear-gradient(90deg, transparent 0, #000 6%); }
/* Полотно с постоянными пропорциями 1.4:1 — раскладка не «плывёт» на разных экранах */
.hero-art { position: absolute; right: 1%; top: 50%; transform: translateY(-50%); width: min(98cqw, 136cqh); aspect-ratio: 1.4; }
.hero-art img { position: absolute; height: auto; object-fit: contain; filter: grayscale(.25) brightness(.68) contrast(1.05); opacity: .6; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 0%, transparent 14%); }
/* Сетка 3 / 2 / 3: верхний и нижний ряды по три предмета, средний — два, со сдвигом между колонками */
.hero-art .t-chainsaw   { left: 7%;  top: 8%;     width: 26%; transform: rotate(6deg); }
.hero-art .t-engine     { left: 40%;  top: 3%;     width: 17%; }
.hero-art .t-trimmer    { right: 2%;  top: 2%;     width: 30%; transform: rotate(-10deg); }
.hero-art .t-cultivator { left: 2%;   top: 26%;    width: 16%; }
.hero-art .t-ebike      { left: 34%;  top: 28%;    width: 23%; }
.hero-art .t-drill      { left: 77%;  top: 38%;    width: 11%; }
.hero-art .t-motoblok   { left: 7%;  bottom: 3%;  width: 22%; }
.hero-art .t-grinder    { left: 38%;  bottom: 8%;  width: 20%; transform: rotate(-6deg); }
.hero-art .t-scooter    { right: 3%;  bottom: 3%;  width: 25%; }
/* Средние экраны: области справа мало — техника уходит под текст с затемнением */
@media (max-width: 1180px) {
  .hero-art img { opacity: .5; }
  .hero-bg { left: 30%; -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,.35) 30%, #000 70%); mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,.35) 30%, #000 70%); }
}
.hero .lead { max-width: 600px; }
.hero-facts { max-width: 820px; }
.brand-lockup { display: flex; align-items: center; gap: 22px; margin-bottom: 26px; flex-wrap: wrap; }
.brand-lockup img { display: block; width: auto; }
.brand-shtenli { height: 40px; }
.brand-profi { height: 46px; }
.brand-sep { width: 2px; height: 42px; background: var(--accent); }
.hero h1 { font-family: "Oswald", var(--font); font-weight: 600; text-transform: uppercase; letter-spacing: .01em; line-height: 1.12;
  font-size: clamp(1.8rem, 4.6vw, 3.2rem); max-width: 720px; }
.hero h1 .accent { color: var(--accent); }
@media (max-width: 720px) {
  .hero-bg { left: 0; -webkit-mask-image: none; mask-image: none; }
  .hero-bg img { opacity: .3; }
  .hero-bg::after { background: linear-gradient(0deg, var(--bg) 0%, rgba(27,29,33,.85) 50%, rgba(27,29,33,.7) 100%); }
  .brand-lockup { gap: 10px; flex-wrap: nowrap; }
  .brand-shtenli { height: 20px; }
  .brand-profi { height: 24px; }
  .brand-sep { height: 24px; flex: none; }
}
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; margin-bottom: 14px; }
.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 680px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.hero-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.hero-facts li { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; color: var(--text-muted); font-size: .95rem; }
.hero-facts strong { display: block; color: var(--text); }

/* ===== Секции ===== */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-lead { color: var(--text-muted); max-width: 720px; margin-bottom: 28px; }
.section-lead strong { color: var(--text); }

.cards { display: grid; gap: 14px; }
/* 9 карточек «Что ремонтируем» — ровная сетка 3×3 на широких экранах */
.cards-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cards-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards-3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 18px; }
.card p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.chips li { padding: 8px 16px; border: 1px solid var(--accent); border-radius: 999px; font-weight: 600; font-size: .92rem; }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.panel-accent { border-color: var(--accent); }
.panel p:last-child { margin-bottom: 0; }
.panel p { color: var(--text-muted); }

.photo-cta { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); padding: 28px; }
.photo-cta p { color: var(--text-muted); margin: 0; }
.messengers { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-cta .messenger-hint { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .9rem; color: var(--text-muted); }
.messenger-hint[hidden] { display: none; }
.messenger-hint strong { color: var(--text); white-space: nowrap; }

/* ===== Запись ===== */
.banner { background: var(--warn-bg); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; font-weight: 700; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cal-title { margin: 0; font-size: 1.05rem; text-align: center; flex: 1; }
.cal-note { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; color: var(--text-muted); }
.cal-wrap { overflow-x: auto; }
.calendar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cal-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 8px; min-width: 0; }
.cal-day.is-today { border-color: var(--accent); }
.cal-day-head { text-align: center; margin-bottom: 8px; font-weight: 800; }
.cal-day-head small { display: block; font-weight: 500; color: var(--text-muted); }
.slot {
  display: block; width: 100%; margin-bottom: 6px; padding: 8px 4px; min-height: 40px;
  font: inherit; font-size: .9rem; font-weight: 700; text-align: center;
  border-radius: 8px; border: 1px solid transparent;
}
.slot-free { background: var(--free-bg); border-color: var(--free); color: var(--text); cursor: pointer; }
.slot-free:hover { background: var(--free); color: var(--on-accent); }
.slot-free[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.slot-busy { background: var(--busy-bg); color: var(--busy); border-color: var(--border); cursor: not-allowed; text-decoration: line-through; }
.legend { display: flex; gap: 18px; margin-top: 12px; color: var(--text-muted); font-size: .9rem; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.dot-free { background: var(--free); }
.dot-busy { background: var(--busy); }
.hint { color: var(--text-muted); font-size: .9rem; margin-top: 6px; }

.form { margin-top: 24px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); padding: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; }
.span-2 { grid-column: span 2; }
input[type="text"], input[type="tel"], select, textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; min-height: 46px; width: 100%;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.radios { border: 0; padding: 0; margin: 0; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.radios legend { font-weight: 600; font-size: .92rem; padding: 0; margin-bottom: 6px; float: left; margin-right: 16px; }
.form label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.inline input { width: 20px; height: 20px; accent-color: var(--accent); }
.form-error { color: var(--danger); font-weight: 600; margin: 12px 0 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.success { margin-top: 24px; background: var(--free-bg); border: 1px solid var(--free); border-radius: var(--radius); padding: 16px 20px; }
.success strong { display: block; font-size: 1.1rem; }
.success span { color: var(--text-muted); }

/* ===== Как найти ===== */
.find-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 20px; align-items: start; }
.ph { margin: 0; position: relative; }
.ph-box {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px;
  background: repeating-linear-gradient(45deg, var(--surface) 0 14px, var(--surface-2) 14px 28px);
  border: 2px dashed var(--border); border-radius: var(--radius); color: var(--text-muted); font-weight: 600;
}
.ph-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Когда внутри настоящее фото — убираем штриховку и рамку плейсхолдера */
.ph-box:has(img) { position: relative; padding: 0; border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.ph figcaption { margin-top: 8px; font-size: .9rem; color: var(--text-muted); }
/* Фото здания 4:3 без обрезки — так стрелка точно попадает на калитку */
.ph-building .ph-box { aspect-ratio: 4 / 3; }
/* Фото калитки: при колонках 1.6fr / 1fr высота совпадает с фото здания (ширина 1, высота 1.2) */
.find-grid .ph:not(.ph-building) .ph-box { aspect-ratio: 5 / 6; }
.find-grid .ph:not(.ph-building) .ph-box img { object-position: 50% 50%; }
@media (max-width: 900px) { .find-grid .ph:not(.ph-building) .ph-box { aspect-ratio: 4 / 3; } }
/* Стрелка на калитку сервиса: центр калитки на фото — 26.4% по ширине, верх калитки — 40% по высоте */
.ph-arrow { position: absolute; left: 26.4%; bottom: 61%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.ph-arrow-label { background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: .85rem; padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.ph-arrow-icon { color: var(--accent); font-size: 3rem; line-height: 1; font-weight: 800; text-shadow: 0 2px 6px rgba(0,0,0,.7); animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }
.find-note { max-width: 720px; color: var(--text-muted); }
.map { margin-top: 20px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.map iframe { display: block; width: 100%; height: 420px; border: 0; }
.map-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.map-links .btn-small { text-decoration: none; }
.map-placeholder { height: 320px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; background: var(--surface); color: var(--text-muted); font-weight: 600; }

/* ===== Новости ===== */
.news-card { padding: 0; overflow: hidden; }
.news-card p { padding: 14px 16px 16px; }
.news-img { aspect-ratio: 4 / 3; background: repeating-linear-gradient(45deg, var(--surface-2) 0 14px, var(--surface) 14px 28px); }
.news-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== Контакты / футер ===== */
.contacts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: center; }
.big-phone { font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 800; text-decoration: none; }
.site-footer { background: #141619; border-top: 1px solid var(--border); padding: 32px 0 90px; color: var(--text-muted); font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.requisites p { margin: 0 0 4px; }
.requisites a { color: var(--text); }
.counter { margin-top: 8px !important; }

/* Липкая кнопка звонка (только мобильные) */
.call-fab { display: none; }

/* ===== Адаптив ===== */
@media (max-width: 900px) {
  .header-phone { margin-left: auto; }
  .nav { margin-left: 0; }
  .burger { display: inline-flex; }
  .nav { position: absolute; left: 0; right: 0; top: var(--header-h); background: var(--bg); border-bottom: 1px solid var(--border); display: none; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .nav a { padding: 12px 8px; font-size: 1rem; }
  .photo-cta { grid-template-columns: 1fr; }
  .find-grid { grid-template-columns: 1fr 1fr; }
  .ph-building { grid-column: span 2; }
}
@media (max-width: 720px) {
  .calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .call-fab {
    display: flex; align-items: center; justify-content: center; position: fixed; z-index: 60;
    left: 16px; right: 16px; bottom: 14px; min-height: 52px; border-radius: 999px;
    background: var(--accent); color: var(--on-accent); font-weight: 800; text-decoration: none;
    box-shadow: 0 6px 20px rgba(0,0,0,.5);
  }
  .call-fab:hover { color: var(--on-accent); background: var(--accent-hover); }
}
@media (max-width: 480px) {
  .header-phone { font-size: .85rem; }
  .logo-mark { font-size: 1.25rem; }
  .section { padding: 40px 0; }
  .find-grid { grid-template-columns: 1fr; }
  .ph-building { grid-column: auto; }
  .photo-cta { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ph-arrow-icon { animation: none; }
}
