/* =========================================================
   Буріння свердловин — стилі (mobile-first)
   Кольори та розміри змінюються в :root
   ========================================================= */
:root {
  --navy-900: #061a33;
  --navy: #0a2f5c;
  --blue: #1560b8;
  --aqua: #1fb8cd;
  --aqua-soft: #d9f3f7;
  --tint: #f0f6fb;
  --accent: #ff9b2f;
  --accent-hover: #ffad52;
  --viber: #7360f2;
  --viber-hover: #8270f5;
  --telegram: #26a5e4;
  --telegram-hover: #45b3ea;
  --facebook: #0866ff;
  --text: #13253d;
  --muted: #4c5d73;
  --line: #d9e3ee;
  --white: #fff;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(10, 47, 92, .10);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--navy-900); }
p { margin: 0 0 1em; }
svg { width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.container--narrow { max-width: 820px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 12px 22px;
  border: 2px solid transparent; border-radius: 12px;
  font: 700 16px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background .2s, transform .15s, border-color .2s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn--lg { min-height: 56px; font-size: 17px; padding: 14px 26px; }
.btn--block { width: 100%; }
.btn--accent { background: var(--accent); color: var(--navy-900); }
.btn--accent:hover { background: var(--accent-hover); }
.btn--viber { background: var(--viber); color: var(--white); }
.btn--viber:hover { background: var(--viber-hover); }
.btn--telegram { background: var(--telegram); color: var(--navy-900); }
.btn--telegram:hover { background: var(--telegram-hover); }
.btn--outline { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: var(--white); }
.btn--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.55); }
.btn--ghost:hover { border-color: var(--white); background: rgba(255,255,255,.08); }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 3px; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--navy); font-weight: 800; line-height: 1.05; font-size: 16px; }
.logo small { font-weight: 600; color: var(--aqua); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.logo__icon { width: 30px; height: 30px; color: var(--aqua); }
.nav { display: none; }
.topbar__phone {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; color: var(--navy); text-decoration: none; white-space: nowrap;
  min-height: 44px;
}
.topbar__phone svg { color: var(--accent); width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  color: var(--white);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(31,184,205,.35), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%);
  padding: 48px 0 110px;
}
.hero__waves {
  position: absolute; inset: auto 0 0 0; height: 90px; opacity: .18;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 90' preserveAspectRatio='none'%3E%3Cpath d='M0 40c150 30 300 30 450 0s300-30 450 0 300 30 300 0v50H0z' fill='%23ffffff'/%3E%3Cpath d='M0 60c200-25 400-25 600 0s400 25 600 0v30H0z' fill='%23ffffff' opacity='.6'/%3E%3C/svg%3E") bottom/100% 100% no-repeat;
}
.hero__inner { position: relative; }
.hero__badge {
  display: inline-block; margin-bottom: 18px; padding: 6px 14px;
  border-radius: 999px; background: rgba(31,184,205,.18); color: #bff2f9;
  font-size: 14px; font-weight: 700;
}
.hero h1 { color: var(--white); font-size: clamp(30px, 8vw, 56px); font-weight: 800; max-width: 16ch; letter-spacing: -.01em; }
.hero__sub { font-size: clamp(18px, 4.6vw, 22px); color: #d6e4f5; margin-bottom: 28px; }
.hero__sub strong { color: var(--accent); }
.hero__actions { display: grid; gap: 12px; }
.hero__facts {
  list-style: none; padding: 0; margin: 32px 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255,255,255,.15); padding-top: 22px;
  color: #b9cbe2; font-size: 14px; text-align: center;
}
.hero__facts li { padding: 0 4px; }
.hero__facts li + li { border-left: 1px solid rgba(255,255,255,.15); }
.hero__facts strong { display: block; color: var(--white); font-size: 24px; line-height: 1.1; white-space: nowrap; }

/* ---------- Секції ---------- */
.section { padding: 56px 0; }
.section--tint { background: var(--tint); }
.section--dark { background: var(--navy); color: #d6e4f5; }
.section--dark h2, .section--dark h3 { color: var(--white); }
.section__title { font-size: clamp(26px, 6.5vw, 40px); font-weight: 800; text-align: center; margin-bottom: 28px; }
.section__title--left { text-align: left; }
.section__lead { text-align: center; color: var(--muted); max-width: 640px; margin: -12px auto 28px; }

.grid { display: grid; gap: 16px; }

/* Чому ми */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card__icon {
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 14px;
  display: grid; place-items: center; background: var(--aqua-soft); color: var(--blue);
}
.card__icon svg { width: 28px; height: 28px; }
.card h3 { font-size: 20px; }
.card p { color: var(--muted); margin: 0; }

/* Послуги: 2×2 + широка картка-підсумок */
.services { display: grid; gap: 16px; }
.service {
  position: relative; background: var(--white); border-radius: var(--radius);
  padding: 22px 22px 22px 26px; border-left: 4px solid var(--aqua);
  box-shadow: var(--shadow);
}
.service h3 { font-size: 20px; }
.service p { color: var(--muted); margin: 0; }
.service--wide { background: var(--navy); border-left-color: var(--accent); }
.service--wide h3 { color: var(--white); }
.service--wide p { color: #d6e4f5; }

/* Ціна */
.price { text-align: center; }
.price .checklist { text-align: left; max-width: 560px; margin: 0 auto; }
.price__cta { margin-top: 28px; }
.price__big { font-size: 20px; color: var(--muted); margin-bottom: 24px; }
.price__big strong { font-size: clamp(40px, 11vw, 56px); color: var(--blue); font-weight: 800; line-height: 1; }
.price__big span { display: block; }
.price__subtitle { font-size: 20px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { position: relative; padding-left: 34px; color: var(--muted); }
.checklist li strong { color: var(--text); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--aqua-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z' fill='%231560b8'/%3E%3C/svg%3E") center/16px no-repeat;
}

/* Кроки */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: s; }
.step {
  position: relative; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 22px 22px 22px 84px; min-height: 96px;
}
.step__num {
  position: absolute; left: 20px; top: 22px; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--navy-900);
  font-weight: 800; font-size: 20px;
}
.step h3 { font-size: 19px; margin-bottom: .3em; }
.step p { margin: 0; }

/* Галерея */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 10px; }
.gallery__fig { margin: 0; }
.gallery:not(.is-expanded) .gallery__fig[data-more] { display: none; }
.gallery__more { text-align: center; margin-top: 28px; }
.gallery__more[hidden] { display: none; }
.gallery__fig figcaption { margin-top: 10px; font-size: 15px; line-height: 1.4; color: var(--text); font-weight: 600; }
.gallery__item {
  position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 12px;
  background: linear-gradient(135deg, var(--aqua-soft), #c3dbef);
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.gallery__item:hover img { transform: scale(1.05); }
/* заглушка, поки немає фото */
.gallery__item.is-empty::after {
  content: "Фото роботи"; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--navy); font-weight: 700; font-size: 15px;
}
.gallery__item.is-empty img { display: none; }

/* Відгуки */
.review {
  margin: 0; background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.review__stars { color: var(--accent); letter-spacing: 2px; font-size: 18px; margin-bottom: 10px; }
.review blockquote { margin: 0 0 16px; flex: 1; }
.review figcaption strong { display: block; color: var(--navy-900); }
.review figcaption span { color: var(--muted); font-size: 15px; }
.review[hidden] { display: none; }
.reviews:empty { display: none; }
.reviews__empty { text-align: center; font-size: 20px; font-weight: 700; color: var(--navy); margin: 0; }
.reviews__empty[hidden] { display: none; }
.reviews__cta { text-align: center; margin-top: 28px; }

/* Модальне вікно відгуку */
.modal {
  width: min(520px, calc(100% - 24px)); max-height: calc(100% - 24px);
  padding: 0; border: 0; border-radius: 20px; background: transparent;
}
.modal::backdrop { background: rgba(4,14,28,.7); }
.form--modal { position: relative; box-shadow: none; }
.modal__title { font-size: 24px; margin-bottom: 18px; padding-right: 40px; }
.modal__close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--tint); color: var(--navy); font-size: 28px; line-height: 1; cursor: pointer;
}
.field input[type="file"] { padding: 12px; min-height: 0; font-size: 15px; }
.rating { border: 0; padding: 0; }
.rating legend { font-weight: 700; margin-bottom: 4px; font-size: 15px; padding: 0; }
.rating__stars { display: inline-flex; flex-direction: row-reverse; }
.rating__stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating .rating__stars label { font-size: 36px; line-height: 1; padding: 2px 4px; margin: 0; color: #c9d4e0; cursor: pointer; }
.rating .rating__stars input:checked ~ label,
.rating .rating__stars label:hover, .rating .rating__stars label:hover ~ label { color: var(--accent); }
.rating__stars input:focus-visible + label { outline: 3px solid var(--aqua); border-radius: 6px; }

/* Де працюємо */
.places { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.places li {
  padding: 8px 16px; border-radius: 999px; background: var(--tint); border: 1px solid var(--line);
  font-weight: 600; color: var(--navy); font-size: 15px;
}

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq__item { background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.faq__item summary {
  list-style: none; cursor: pointer; padding: 18px 56px 18px 20px; position: relative;
  font-weight: 700; color: var(--navy-900); min-height: 56px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2.5px solid var(--blue); border-bottom: 2.5px solid var(--blue);
  transform: rotate(45deg); transition: transform .2s;
}
.faq__item[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq__item p { padding: 0 20px 20px; margin: 0; color: var(--muted); }

/* Форма */
.contact { display: grid; gap: 28px; }
.contact__phones { display: grid; gap: 6px; }
.contact__phones a { color: var(--white); font-weight: 800; font-size: 22px; text-decoration: none; }
.form { background: var(--white); color: var(--text); border-radius: 20px; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 15px; }
.field__opt { font-weight: 500; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; min-height: 52px;
  border: 1.5px solid #b9c8d8; border-radius: 12px; background: #fbfdff;
  font: 500 17px/1.4 var(--font); color: var(--text);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(21,96,184,.18); }
.field__error { display: none; margin: 6px 0 0; color: #c62828; font-size: 14px; }
.field.is-invalid input { border-color: #c62828; }
.field.is-invalid .field__error { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form__status { margin: 14px 0 0; font-weight: 700; text-align: center; }
.form__status.is-ok { color: #1b7f3b; }
.form__status.is-err { color: #c62828; }
.form.is-sent .field, .form.is-sent button[type="submit"] { display: none; }
.form.is-sent .form__status { font-size: 20px; padding: 24px 0; margin: 0; }

/* Футер */
.footer { background: var(--navy-900); color: #b9cbe2; padding: 40px 0 24px; font-size: 15px; }
.footer__inner { display: grid; gap: 24px; }
.footer p { margin: 0 0 6px; }
.footer a { color: var(--white); text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }
.footer__icon-link { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
.footer__icon-link svg { width: 20px; height: 20px; }
.ic-viber { color: var(--viber); }
.ic-telegram { color: var(--telegram); }
.ic-facebook { color: var(--facebook); }
.footer__brand { color: var(--white); font-weight: 800; font-size: 18px; }
.footer__head { color: var(--aqua); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.footer__copy { margin-top: 28px !important; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }

/* Липка нижня панель */
.mobilebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--white); box-shadow: 0 -4px 20px rgba(0,0,0,.12);
}
.mobilebar__btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; border-radius: 12px; font-weight: 800; font-size: 16px; text-decoration: none;
}
.mobilebar__btn svg { width: 20px; height: 20px; }
.mobilebar__btn--call { background: var(--accent); color: var(--navy-900); }
.mobilebar__btn--viber { background: var(--viber); color: var(--white); }

/* Лайтбокс */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(4,14,28,.94);
  display: flex; align-items: center; justify-content: center; padding: 56px 8px;
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-height: 100%; max-width: 100%; border-radius: 8px; object-fit: contain; }
.lightbox button {
  position: absolute; background: rgba(255,255,255,.12); color: var(--white); border: 0; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1;
}
.lightbox__close { top: 12px; right: 12px; }
.lightbox__nav--prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ---------- Планшет ---------- */
@media (min-width: 640px) {
  .hero__actions { grid-template-columns: 1fr 1fr; }
  .grid--4, .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .services { grid-template-columns: repeat(2, 1fr); }
  .service--wide { grid-column: 1 / -1; }
  .gallery { gap: 14px; }
  .footer__inner { grid-template-columns: repeat(2, 1fr); }
}

/* Липка панель — лише на мобільних (до 768 px) */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .mobilebar { display: none; }
}

/* ---------- Десктоп ---------- */
@media (min-width: 960px) {
  .nav { display: flex; gap: 28px; }
  .nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
  .nav a:hover { color: var(--blue); }
  .hero { padding: 96px 0 150px; }
  .hero__actions { display: flex; flex-wrap: wrap; }
  .hero__facts { margin-top: 48px; font-size: 16px; }
  .hero__facts strong { font-size: 34px; }
  .section { padding: 88px 0; }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .service--wide { padding: 28px 32px 28px 36px; }
  .service--wide h3 { font-size: 24px; }
  .footer__inner { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .step { padding: 84px 22px 24px; }
  .step__num { top: 22px; left: 22px; }
  .contact { grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
  .form { padding: 32px; }
}

/* ---------- Згортання: галерея і FAQ ---------- */
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.gallery.is-expanded .gallery__fig[data-more],
.faq.is-expanded .faq__item[data-more] { animation: reveal .4s ease both; }
.faq:not(.is-expanded) .faq__item[data-more] { display: none; }
.faq__more, .places-toggle { text-align: center; margin-top: 20px; }

/* ---------- Карта ---------- */
.map {
  position: relative; z-index: 0; height: 420px; margin: 0 0 4px;
  border-radius: var(--radius); overflow: hidden; background: var(--tint);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
/* глобальне правило svg {1em} — для іконок; шар векторів Leaflet має власні розміри */
.map svg { width: auto; height: auto; fill: none; }
.map__placeholder { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-weight: 600; }
.map__hint {
  position: absolute; left: 50%; bottom: 14px; z-index: 1000; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 999px; background: rgba(6,26,51,.82); color: var(--white);
  font-size: 14px; font-weight: 600; white-space: nowrap; pointer-events: none; transition: opacity .25s;
}
.map.is-active .map__hint { opacity: 0; }
.map .leaflet-popup-content-wrapper { border-radius: 12px; }
.map .leaflet-popup-content { margin: 12px 14px; font-family: var(--font); text-align: center; }
.map-popup__name { display: block; font-weight: 800; color: var(--navy-900); font-size: 16px; margin-bottom: 8px; }
.map-popup__call {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px;
  border-radius: 10px; background: var(--accent); color: var(--navy-900) !important; font-weight: 800; text-decoration: none;
}
.map-dot {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--white); box-shadow: 0 1px 4px rgba(6,26,51,.45);
}
.map-cluster {
  display: grid; place-items: center; border-radius: 50%;
  background: var(--blue); color: var(--white); font: 800 14px/1 var(--font);
  box-shadow: 0 0 0 5px rgba(21,96,184,.25);
}
.places.is-collapsed { display: none; }
.places { margin-top: 20px; }

@media (min-width: 960px) {
  .map { height: 520px; }
}

/* ---------- Телефон (до 768 px): карусель послуг і компактні відступи ---------- */
@media (max-width: 767px) {
  .section { padding: 40px 0; }
  .section__title { font-size: clamp(24px, 6.2vw, 30px); margin-bottom: 20px; }
  .section__lead { margin: -8px auto 20px; font-size: 16px; }
  .hero { padding: 36px 0 100px; }
  .card { padding: 18px; }
  .card__icon { width: 44px; height: 44px; margin-bottom: 10px; }
  .card h3, .step h3 { font-size: 18px; }
  .map { height: 360px; }

  .services {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -16px; padding: 4px 16px 10px; scroll-padding: 0 16px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .services::-webkit-scrollbar { display: none; }
  .service { flex: 0 0 82%; scroll-snap-align: start; padding: 18px 18px 18px 22px; }
  .service--wide { order: -1; }
  .service h3 { font-size: 18px; margin-bottom: 6px; }
  .service p { font-size: 15px; line-height: 1.45; }

  .carousel-dots { display: flex; justify-content: center; gap: 2px; margin-top: 8px; }
  .carousel-dots button {
    width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer;
    display: grid; place-items: center;
  }
  .carousel-dots button::before {
    content: ""; width: 8px; height: 8px; border-radius: 4px; background: #b8c9da; transition: width .2s, background .2s;
  }
  .carousel-dots button.is-active::before { width: 22px; background: var(--blue); }
}
@media (min-width: 768px) {
  .carousel-dots { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .gallery.is-expanded .gallery__fig[data-more],
  .faq.is-expanded .faq__item[data-more] { animation: none; }
}
