:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --accent: #1d3557;
  --dark: #14213d;
  --gray: #f4f6f8;
  --text: #1f2933;
  --muted: #6b7280;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(20, 33, 61, 0.12);
  --radius: 14px;
  --maxw: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", "PT Sans", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 70px 0; }
.section--gray { background: var(--gray); }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--dark);
  color: #cbd5e1;
  font-size: 14px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
}
.topbar a { color: #fff; font-weight: 600; }
.topbar .topbar__links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.topbar .topbar__links a:hover { color: var(--primary); }
.btn-call {
  background: var(--primary);
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  transition: background .2s;
}
.btn-call:hover { background: var(--primary-dark); }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0,0,0,.06);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 20px;
}
.logo { display: flex; align-items: center; }
.logo img { height: 46px; width: auto; display: block; }

.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--accent);
  transition: background .2s, color .2s;
}
.nav a:hover, .nav a.active { background: var(--accent); color: #fff; }

.burger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.burger span { width: 26px; height: 3px; background: var(--accent); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(90deg, rgba(20,33,61,.96) 0%, rgba(20,33,61,.90) 48%, rgba(20,33,61,.62) 100%),
              url("../images/b8428edd-4b72-4656-9eb9-a2f4aa14be3e.jpg") right center/cover no-repeat;
  color: #fff;
  padding: 120px 0;
}
.hero h1 { font-size: clamp(28px, 4vw, 46px); line-height: 1.15; margin-bottom: 18px; }
.hero p { font-size: clamp(16px, 2vw, 20px); max-width: 640px; color: #e2e8f0; margin-bottom: 28px; }
.hero .btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform .15s, background .2s, box-shadow .2s;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn--outline { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn--outline:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.hero .btn--outline { color: #fff; border-color: #fff; }
.hero .btn--outline:hover { background: #fff; color: var(--accent); }

/* ---------- Section heading ---------- */
.section h2 {
  font-size: clamp(24px, 3vw, 34px);
  color: var(--accent);
  margin-bottom: 12px;
  text-align: center;
}
.section .lead { text-align: center; color: var(--muted); max-width: 720px; margin: 0 auto 40px; }

/* ---------- Categories ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(20,33,61,.18); }
.card img { height: 200px; object-fit: cover; width: 100%; }
.card__body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card__body h3 { color: var(--accent); margin-bottom: 8px; font-size: 20px; }
.card__body p { color: var(--muted); font-size: 15px; flex: 1; }
.card__body .price { font-weight: 700; color: var(--primary); margin-top: 12px; }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.feature { text-align: center; padding: 26px 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.feature__icon { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--primary); }
.feature h3 { color: var(--accent); font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 14px; }

/* ---------- Gallery ---------- */
.gallery { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; }
.gallery a { flex: 0 0 auto; width: 320px; overflow: hidden; border-radius: 12px; display: block; aspect-ratio: 4/3; background: #e5e7eb; scroll-snap-align: start; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; cursor: zoom-in; }
.gallery a:hover img { transform: scale(1.07); }

/* ---------- Video ---------- */
.videos { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; }
.videos video { flex: 0 0 auto; width: 400px; border-radius: var(--radius); box-shadow: var(--shadow); background: #000; scroll-snap-align: start; }

/* ---------- Reviews ---------- */
.reviews-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 34px; }
.reviews-list > .reviews-empty { grid-column: 1 / -1; }
.review-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.review-head strong { color: var(--accent); }
.review-date { color: var(--muted); font-size: 13px; margin-left: auto; }
.stars .star { color: #d1d5db; font-size: 17px; }
.stars .star.on { color: #f59e0b; }
.review-card p { color: #374151; }
.reviews-empty { color: var(--muted); text-align: center; }
.review-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; max-width: 640px; margin-left: auto; margin-right: auto; }
.review-box h3 { margin-bottom: 14px; color: var(--accent); }
.review-box .form-row textarea { resize: vertical; }

/* ---------- Content text ---------- */
.content p { margin-bottom: 16px; color: #374151; }
.content h3 { color: var(--accent); margin: 26px 0 12px; font-size: 22px; }
.content ul.check { padding-left: 0; }
.content ul.check li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.content ul.check li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e63946' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center/contain; }

.spec-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.spec-table th, .spec-table td { border: 1px solid #e5e7eb; padding: 12px 14px; text-align: left; }
.spec-table th { background: var(--accent); color: #fff; }
.spec-table tr:nth-child(even) td { background: var(--gray); }

/* ---------- Contact form ---------- */
.form-wrap { max-width: 560px; margin: 0 auto; background: #fff; padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow); }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--accent); }
.form-row input, .form-row textarea, .form-row select {
  width: 100%; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 10px; font: inherit; transition: border .2s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--primary); outline: none; }
.form-row textarea { resize: vertical; min-height: 110px; }
.form-note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 14px; }
.form-status { text-align: center; font-weight: 700; color: green; margin-top: 12px; min-height: 20px; }

/* ---------- Contacts block ---------- */
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.contact-card { background: #fff; padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-card h3 { color: var(--accent); margin-bottom: 8px; }
.contact-card a { color: var(--primary); font-weight: 600; }

/* ---------- Footer ---------- */
.footer { background: var(--dark); color: #cbd5e1; padding: 50px 0 24px; }
.footer .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; }
.footer h4 { color: #fff; margin-bottom: 14px; font-size: 16px; }
.footer a:hover { color: var(--primary); }
.footer .footer__bottom { display: block; border-top: 1px solid rgba(255,255,255,.1); margin-top: 30px; padding-top: 18px; font-size: 13px; text-align: center; color: #94a3b8; }
.footer-legal { display: inline-block; margin-top: 8px; }
.footer-legal a { color: #cbd5e1; text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); text-underline-offset: 2px; }
.footer-legal a:hover { color: #fff; }
.footer-legal .sep { margin: 0 8px; color: #64748b; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(10,15,30,.92); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92%; max-height: 88%; border-radius: 10px; }
.lightbox .close { position: absolute; top: 20px; right: 30px; font-size: 40px; color: #fff; cursor: pointer; background: none; border: none; }

/* ---------- Calculator ---------- */
.calc-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; align-items: start; }
.calc-col .form-row { margin-bottom: 16px; }
.calc-col .form-row:last-child { margin-bottom: 0; }
.calc-result { background: var(--gray); border-radius: var(--radius); padding: 24px; text-align: center; }
.calc-total-label { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.calc-total-price { font-size: 36px; font-weight: 800; color: var(--accent); margin-bottom: 16px; }
.calc-details { text-align: left; font-size: 14px; color: var(--text); list-style: disc; padding-left: 18px; }
.calc-details li { margin-bottom: 6px; }
#calculator .lead { text-align: center; margin-bottom: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .section { padding: 46px 0; }
  .container { padding: 0 16px; }
  .topbar { font-size: 13px; }
  .topbar .container { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 16px; }
  .topbar .topbar__links { gap: 10px 14px; }
  .header .container { padding: 12px 16px; }
  .logo img { height: 38px; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px 16px; box-shadow: 0 12px 24px rgba(0,0,0,.1); }
  .nav.open { display: flex; }
  .nav a { padding: 10px 12px; }
  .burger { display: flex; }
  .hero { padding: 70px 0; }
  .btn { padding: 12px 20px; font-size: 15px; }
  .cards { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .gallery { gap: 10px; }
  .form-wrap { padding: 22px 18px; }
  .contacts-grid { grid-template-columns: 1fr; }
  .footer .container { grid-template-columns: 1fr; gap: 22px; }

  .calc-card { padding: 18px; }
  .calc-grid { grid-template-columns: 1fr; gap: 18px; }
  .calc-result { padding: 20px; }
  .calc-total-price { font-size: 28px; }
  .calc-details { padding-left: 16px; }
  .form-row input, .form-row textarea, .form-row select { padding: 14px; font-size: 16px; }
  .gallery a { width: 260px; }
  .videos video { width: 320px; }
}

@media (max-width: 480px) {
  .hero { padding: 54px 0; }
  .hero .btn-row { flex-direction: column; }
  .hero .btn { width: 100%; text-align: center; }
  .section h2 { font-size: 22px; }
  .section .lead { font-size: 15px; margin-bottom: 26px; }
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; text-align: center; }
  .card img { height: 160px; }
  .spec-table { display: block; overflow-x: auto; white-space: nowrap; }
  .calc-total-price { font-size: 24px; }
  .calc-card { padding: 14px; }
  .gallery a { width: 220px; }
  .videos video { width: 280px; }
}
