:root {
  --primary: #155799;
  --primary-dark: #0f4270;
  --secondary: #f7c945;
  --accent: #23d783;
  --bg-dark: #242424;
  --bg-light: #f5f5f5;
  --bg-section: #f0f1f5;
  --text: #212121;
  --text-muted: #616161;
  --white: #ffffff;
  --shadow: 0 4px 24px rgba(21, 87, 153, 0.12);
  --radius: 12px;
  --max-width: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: var(--white);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
}

.logo img { height: 48px; width: auto; }

.brand-logo-inline {
  display: inline;
  height: 1.05em;
  width: auto;
  vertical-align: -0.12em;
}

.brand-logo-sm {
  display: inline;
  height: 0.95em;
  width: auto;
  vertical-align: -0.08em;
}

.footer-brand-logo {
  height: 32px;
  width: auto;
}

.hero h1 .brand-logo-inline { height: 1.15em; }

.main-nav { display: flex; gap: 8px; flex-wrap: wrap; }

.main-nav a {
  padding: 8px 14px;
  color: var(--text);
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--bg-light);
  color: var(--primary);
  text-decoration: none;
}

.nav-dropdown { position: relative; }
.nav-dropdown:hover .dropdown-menu { display: block; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 8px;
  z-index: 200;
}

.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
}

.header-cta {
  background: var(--primary);
  color: var(--white) !important;
  padding: 10px 20px !important;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.header-cta:hover {
  background: var(--primary-dark);
  text-decoration: none !important;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #0f4270 0%, var(--primary) 50%, #1a6bb5 100%);
  color: var(--white);
  padding: 80px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.1rem;
  opacity: .92;
  margin-bottom: 28px;
}

.hero-img {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  border: 3px solid var(--accent);
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform .15s, box-shadow .15s;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-primary { background: var(--secondary); color: var(--text); }
.btn-primary:hover { background: #e5b83a; }

.btn-outline {
  background: transparent;
  border: 2px solid var(--white);
  color: var(--white);
}

.btn-outline:hover { background: rgba(255,255,255,.1); }

/* Sections */
section { padding: 72px 0; }

.section-label {
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .85rem;
  margin-bottom: 8px;
}

.hero .section-label {
  color: var(--secondary);
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 16px;
  color: var(--text);
}

.section-desc {
  color: var(--text-muted);
  max-width: 720px;
  margin-bottom: 40px;
}

.bg-light { background: var(--bg-light); }
.bg-section { background: var(--bg-section); }

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s;
}

.card:hover { transform: translateY(-4px); }

.card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: cover;
}

.card-body { padding: 24px; }

.card-body h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--primary);
}

.card-body p { color: var(--text-muted); font-size: .95rem; margin-bottom: 16px; }

.card-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item h3 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-item p { color: var(--text-muted); font-size: .9rem; }

/* Problems */
.problems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.problem-card {
  background: var(--white);
  border-left: 4px solid var(--accent);
  padding: 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow);
}

.problem-card .num {
  color: var(--primary);
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: 8px;
}

.problem-card h3 { margin-bottom: 10px; font-size: 1.1rem; }
.problem-card p { color: var(--text-muted); font-size: .95rem; margin-bottom: 12px; }

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.step-card {
  background: var(--white);
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.step-num {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Spec table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.spec-table th,
.spec-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.spec-table th {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.spec-table tr:last-child td { border-bottom: none; }
.spec-table tr:nth-child(even) td { background: var(--bg-light); }

/* Product page */
.product-hero { padding: 60px 0; }
.product-features { list-style: none; margin: 20px 0; }
.product-features li {
  padding: 8px 0 8px 28px;
  position: relative;
}
.product-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.advantage-item h3 { color: var(--primary); margin-bottom: 10px; }

/* Bitrix24 form */
.bitrix-form-wrap {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bitrix-form-wrap h3 {
  margin-bottom: 16px;
}

.bitrix-form-wrap iframe {
  display: block;
  width: 100%;
  height: 680px;
  min-height: 680px;
  border: 0;
  background: var(--white);
  overflow: hidden;
}

@media (max-width: 768px) {
  .bitrix-form-wrap iframe {
    height: 720px;
    min-height: 720px;
  }
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-form {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 640px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group textarea { min-height: 120px; resize: vertical; }

.form-note { font-size: .85rem; color: var(--text-muted); margin-top: 12px; }

/* FAQ */
.faq-item {
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 20px 24px;
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.faq-answer {
  padding: 0 24px 20px;
  color: var(--text-muted);
  display: none;
}

.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-question { color: var(--primary); }

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: #ccc;
  padding: 60px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-grid h4 {
  color: var(--white);
  margin-bottom: 16px;
  font-size: 1rem;
}

.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: #aaa; text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid #444;
  padding-top: 24px;
  text-align: center;
  font-size: .9rem;
  color: #888;
}

.footer-bottom p {
  margin: 0;
}

.contact-info p { margin-bottom: 8px; }
.contact-info strong { color: var(--white); }

/* CTA banner */
.cta-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}

.cta-banner h2 { margin-bottom: 16px; }
.cta-banner p { opacity: .9; margin-bottom: 24px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* Video grid */
.video-section {
  padding: 72px 0;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  max-width: 960px;
  margin: 0 auto;
}

.video-grid--wide {
  max-width: var(--max-width);
  grid-template-columns: repeat(2, 1fr);
}

.video-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(21, 87, 153, 0.08);
}

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #0f4270;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-card-body {
  padding: 18px 22px 22px;
}

.video-card-body h3 {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 6px;
}

.video-card-body p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .video-grid,
  .video-grid--wide {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
}

/* Photo gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Problem cards with image */
.problem-card-img {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: start;
}

.problem-card-img img {
  width: 120px;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}

.advantage-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.advantage-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: cover;
}

.advantage-card-body {
  padding: 20px;
}

.advantage-card-body h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.1rem;
}

/* Production gallery on product pages */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.photo-grid .photo-item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.photo-grid .photo-item img {
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}

.two-col-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 768px) {
  .problem-card-img { grid-template-columns: 1fr; }
  .problem-card-img img { width: 100%; max-height: none; }
  .two-col-media { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .advantages-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px;
    box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .nav-dropdown .dropdown-menu {
    position: static;
    box-shadow: none;
    padding-left: 16px;
  }
  .header-cta { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
