/* ===== Stamplex ===== */
:root {
  --primary: #2252f6;
  --primary-dark: #1a3fcc;
  --primary-soft: #eaf0ff;
  --text: #1b1f2e;
  --muted: #5d6479;
  --border: #e2e6f0;
  --bg: #ffffff;
  --bg-tint: #f5f7fc;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(22, 40, 110, .08);
  --header-h: 76px;

  --telegram: #229ed9;
  --whatsapp: #25d366;
  --viber: #7360f2;
  --instagram: #e1306c;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.15; margin: 0; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.icon, .social svg, .messenger svg, .hero__insta svg { width: 1em; height: 1em; flex-shrink: 0; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 50px; padding: 12px 28px;
  border: 2px solid transparent; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 15px; letter-spacing: .02em;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: none; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(34, 82, 246, .35); }
.btn--primary:hover { background: var(--primary-dark); }
.btn--light { background: #fff; color: var(--primary); }
.btn--light:hover { background: var(--primary-soft); }
.btn--outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--outline:hover { background: var(--primary); color: #fff; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(34, 82, 246, .45); outline-offset: 2px;
}

/* ===== Шапка ===== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s;
}
.header.is-scrolled { box-shadow: 0 4px 20px rgba(0, 0, 0, .06); }
.header__inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo__mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 3px double var(--primary); color: var(--primary);
  font-weight: 800; font-size: 20px;
}
.logo__text { display: flex; flex-direction: column; }
.logo__name { font-weight: 800; font-size: 20px; letter-spacing: .01em; }
.logo__tagline { font-size: 12px; color: var(--muted); }

.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; transition: color .2s; }
.nav a:hover { color: var(--primary); }

.header__contacts { display: flex; align-items: center; gap: 18px; }
.header__phone {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.header__phone .icon { color: var(--primary); font-size: 18px; }
.header__phone:hover { color: var(--primary); }

/* ===== Соцмережі ===== */
.socials { display: flex; gap: 8px; }
.social {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  color: #fff; font-size: 18px; transition: transform .2s, opacity .2s;
}
.social:hover { transform: translateY(-2px); opacity: .9; }
.socials--lg .social { width: 48px; height: 48px; font-size: 24px; }
.social--telegram { background: var(--telegram); }
.social--whatsapp { background: var(--whatsapp); }
.social--viber { background: var(--viber); }
.social--instagram { background: linear-gradient(45deg, #f9ce34, #ee2a7b 50%, #6228d7); }

/* ===== Головний блок ===== */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    linear-gradient(115deg, rgba(20, 44, 150, .94) 0%, rgba(34, 82, 246, .82) 55%, rgba(34, 82, 246, .45) 100%),
    url("../images/hero.jpg") center / cover no-repeat;
}
.hero__inner { padding: 96px 20px 104px; max-width: 1200px; }
.hero__title {
  font-size: clamp(32px, 5.4vw, 64px); font-weight: 800; text-transform: uppercase;
  letter-spacing: -.01em; max-width: 15ch;
}
.hero__subtitle { margin: 18px 0 0; font-size: clamp(20px, 2.4vw, 28px); font-weight: 600; max-width: 26ch; }
.hero__text { margin: 20px 0 0; font-size: 18px; max-width: 520px; opacity: .92; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero__actions .btn--primary { background: #fff; color: var(--primary); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
.hero__actions .btn--primary:hover { background: var(--primary-soft); }
.hero__actions .btn--light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .8); }
.hero__actions .btn--light:hover { background: rgba(255, 255, 255, .12); }

.hero__messengers { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.messenger {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  color: #fff; text-decoration: none; font-weight: 600; font-size: 14px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28);
  transition: background-color .2s;
}
.messenger svg { font-size: 18px; }
.messenger--telegram:hover { background: var(--telegram); }
.messenger--whatsapp:hover { background: var(--whatsapp); }
.messenger--viber:hover { background: var(--viber); }

.hero__insta { margin: 28px 0 0; font-size: 15px; opacity: .92; }
.hero__insta a { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; }
.hero__insta svg { font-size: 18px; }

/* ===== Секції ===== */
.section { padding: 88px 0; }
.section--tinted { background: var(--bg-tint); }
.section__title { font-size: clamp(30px, 4vw, 42px); font-weight: 800; }
.section__title::after {
  content: ""; display: block; width: 56px; height: 4px; margin-top: 14px;
  border-radius: 2px; background: var(--primary);
}
.section__lead { margin: 18px 0 0; max-width: 640px; color: var(--muted); font-size: 17px; }

/* ===== Картки ===== */
.cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 44px;
}
.card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
/* Квадратна рамка; картинка позиціонується абсолютно, щоб Safari не розтягував блок під її висоту */
.card__img { --pad: 16px; position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg-tint); }
.card__img img {
  position: absolute; top: var(--pad); left: var(--pad);
  width: calc(100% - 2 * var(--pad)); height: calc(100% - 2 * var(--pad));
  object-fit: contain; transition: transform .3s;
}
a.card__img { cursor: zoom-in; }
a.card__img::after {
  content: ""; position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 20px no-repeat;
  box-shadow: 0 4px 12px rgba(34, 82, 246, .35);
  opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s;
}
a.card__img:hover img { transform: scale(1.04); }
a.card__img:hover::after, a.card__img:focus-visible::after { opacity: 1; transform: none; }
@media (hover: none) { a.card__img::after { opacity: .9; transform: none; width: 30px; height: 30px; background-size: 16px; right: 8px; bottom: 8px; } }

/* ===== Перегляд макетів ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center;
  padding: 56px 72px; background: rgba(10, 14, 30, .92); animation: fade .2s ease-out;
}
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; max-height: 100%; }
.lightbox__img {
  max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain;
  background: #fff; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  touch-action: pan-y pinch-zoom;
}
.lightbox__caption { color: #fff; font-weight: 600; text-align: center; }
.lightbox__btn {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff;
  font: 400 34px/1 system-ui, sans-serif; cursor: pointer; transition: background-color .2s;
}
.lightbox__btn:hover { background: var(--primary); }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 600px) {
  .lightbox { padding: 64px 10px 80px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 14px; transform: none; }
  .lightbox__prev { left: calc(50% - 60px); }
  .lightbox__next { right: calc(50% - 60px); }
}
.card__body { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.card__title { font-size: 20px; font-weight: 700; }
.card__desc { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.card__price { margin: 12px 0 18px; color: var(--muted); font-size: 15px; }
.card__price b { color: var(--primary); font-size: 22px; font-weight: 800; }
.card__btn { margin-top: auto; min-height: 44px; padding: 8px 20px; width: 100%; }

/* ===== Форма ===== */
.order { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.order__alt { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; color: var(--muted); font-weight: 600; }

.form {
  display: grid; gap: 14px; padding: 32px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
}
.form__field { display: block; }
.form__label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.form input[type="text"], .form input[type="tel"], .form textarea {
  width: 100%; padding: 14px 16px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg-tint); border: 1.5px solid var(--border); border-radius: 12px;
  transition: border-color .2s, background-color .2s;
}
.form textarea { resize: vertical; min-height: 110px; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.form .is-invalid { border-color: #e5484d !important; background: #fff5f5 !important; }

.form__file { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; }
.form__file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.form__file-btn {
  padding: 10px 18px; border: 1.5px dashed var(--primary); border-radius: 12px;
  color: var(--primary); font-weight: 600; font-size: 14px; transition: background-color .2s;
}
.form__file:hover .form__file-btn, .form__file input:focus-visible + .form__file-btn { background: var(--primary-soft); }
.form__file-name { font-size: 14px; color: var(--muted); word-break: break-all; }
.form__hp { position: absolute; left: -9999px; }
.form__submit { width: 100%; margin-top: 6px; }
.form__submit[disabled] { opacity: .6; cursor: wait; transform: none; }
.form__error { margin: 0; color: #d93036; font-size: 14px; font-weight: 600; }

/* ===== Контакти ===== */
.contacts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 44px; }
.contact { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.contact__title { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: 12px; }
.contact p { margin: 0 0 8px; }
.contact small { color: var(--muted); }
.contact__link { color: var(--text); font-weight: 700; text-decoration: none; word-break: break-word; }
.contact__link:hover { color: var(--primary); }
.schedule { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.schedule dt { font-weight: 700; }
.schedule dd { margin: 0; }

/* ===== Підвал ===== */
.footer { background: #0f1733; color: rgba(255, 255, 255, .75); font-size: 14px; }
.footer .footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 28px; }
.footer p { margin: 0; }

/* ===== Модальне вікно ===== */
.modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(15, 23, 51, .55);
}
.modal[hidden] { display: none; }
.modal__box {
  width: 100%; max-width: 400px; padding: 36px 28px; text-align: center;
  background: #fff; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  animation: pop .25s ease-out;
}
.modal__box h3 { font-size: 24px; color: var(--primary); }
.modal__box p { margin: 12px 0 24px; color: var(--muted); }
.modal__box .btn { min-width: 140px; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }

/* ===== Адаптив ===== */
@media (max-width: 1080px) {
  .nav { display: none; }
  .header__contacts { margin-left: auto; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .contacts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .cards { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .order { grid-template-columns: 1fr; gap: 32px; }
  .section { padding: 64px 0; }
  .hero__inner { padding: 72px 20px 80px; }
}

@media (max-width: 600px) {
  :root { --header-h: 64px; }
  .container { padding: 0 16px; }
  .logo__tagline { display: none; }
  .logo__mark { width: 36px; height: 36px; font-size: 17px; }
  .logo__name { font-size: 18px; }
  .header__inner { gap: 12px; }
  .header__contacts { gap: 10px; }
  .header__phone span { display: none; }
  .header__phone {
    width: 36px; height: 36px; justify-content: center; border-radius: 50%;
    background: var(--primary);
  }
  .header__phone .icon { color: #fff; font-size: 17px; }
  .header .socials { gap: 6px; }
  .header .social { width: 34px; height: 34px; font-size: 17px; }

  .hero__inner { padding: 56px 16px 64px; }
  .hero__text { font-size: 16px; }
  .hero__actions .btn { flex: 1 1 100%; }

  .cards { grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; }
  .card__img { --pad: 10px; }
  .card__body { padding: 14px; }
  .card__title { font-size: 16px; }
  .card__desc { font-size: 13px; }
  .card__price { font-size: 13px; margin: 8px 0 14px; }
  .card__price b { font-size: 18px; }
  .card__btn { font-size: 13px; padding: 6px 10px; min-height: 40px; }

  .form { padding: 22px 18px; }
  .contacts { grid-template-columns: 1fr; gap: 14px; margin-top: 32px; }
  .footer__inner { flex-direction: column; text-align: center; }
}

@media (max-width: 380px) {
  .header .social--instagram { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
