:root {
  --brand: #0d3a6e;
  --brand-2: #144a8a;
  --brand-3: #e8eff7;
  --ink: #1a2233;
  --muted: #5b6775;
  --line: #dfe5ec;
  --bg: #ffffff;
  --bg-soft: #f5f8fb;
  --radius: 8px;
  --shadow: 0 4px 20px rgba(13, 58, 110, 0.08);
}

* { box-sizing: border-box; }

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

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }

/* Brand utilities */
.btn-brand {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  transition: background .2s, transform .15s;
}
.btn-brand:hover {
  background: var(--brand-2);
  color: #fff;
  transform: translateY(-1px);
}
.btn-outline-brand {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
  font-weight: 600;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius);
}
.btn-outline-brand:hover {
  background: var(--brand-3);
  color: var(--brand);
}
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color: #fff; }
.bg-brand-soft { background: var(--brand-3) !important; }
.bg-soft { background: var(--bg-soft); }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.site-header .navbar-brand img,
.site-header .navbar-brand svg {
  height: 42px;
  width: auto;
}
.nav-link.active {
  color: var(--brand) !important;
  font-weight: 600;
}

/* Audience switcher */
.audience-bar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0;
  overflow-x: auto;
  white-space: nowrap;
}
.pill-switch {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  margin-right: 0.4rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  background: #fff;
  transition: all .2s;
  white-space: nowrap;
}
.pill-switch:hover {
  background: var(--brand-3);
  border-color: var(--brand-2);
  color: var(--brand);
}
.pill-switch.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Hero */
.hero {
  padding: 3.5rem 0 2.5rem;
  background: linear-gradient(180deg, var(--bg-soft) 0%, #fff 100%);
}
.hero-badge {
  display: inline-block;
  background: var(--brand-3);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.hero h1 {
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}
.hero-lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 520px;
}
.hero-specs {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 1rem;
}
.hero-specs li { margin-bottom: 0.25rem; }

/* Cards */
.mod-card {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  height: 100%;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
}
.mod-card:hover {
  border-color: var(--brand-2);
  box-shadow: var(--shadow);
}
.mod-card.selected {
  border-color: var(--brand);
  background: var(--brand-3);
}
.mod-card .price {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand);
}
.mod-card .icon {
  width: 48px;
  height: 48px;
  background: var(--brand-3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--brand);
}

/* Feature tiles */
.feature-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  height: 100%;
  text-align: center;
}
.feature-tile .icon {
  font-size: 1.8rem;
  color: var(--brand);
  margin-bottom: 0.6rem;
}

/* Specs table */
.specs-table {
  width: 100%;
  border-collapse: collapse;
}
.specs-table th,
.specs-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.specs-table th {
  width: 45%;
  color: var(--muted);
  font-weight: 500;
}
.specs-table tr:last-child td,
.specs-table tr:last-child th { border-bottom: none; }

/* CTA banner */
.cta-banner {
  background: var(--brand);
  color: #fff;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
}
.cta-banner .btn {
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  border: none;
}
.cta-banner .btn:hover {
  background: var(--brand-3);
}

/* Calculator */
.calc-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  position: sticky;
  top: 90px;
}
.calc-total {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brand);
}
.machine-schema {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 1.5rem;
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: #a0aec0;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}
.site-footer a { color: #cbd5e0; }
.site-footer a:hover { color: #fff; }
.site-footer .brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
}

/* Breadcrumb */
.breadcrumb {
  background: transparent;
  padding: 0.75rem 0;
  font-size: 0.9rem;
}

/* Form */
.form-control:focus,
.form-select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 0.2rem rgba(13, 58, 110, 0.15);
}

  .audience-bar { -webkit-overflow-scrolling: touch; }
  .pill-switch { font-size: 0.82rem; padding: 0.4rem 0.9rem; }
}

/* Контент из редактора WP */
.content-editable {
  max-width: 900px;
}
.content-editable h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--ink);
}
.content-editable h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  color: var(--brand);
}
.content-editable p,
.content-editable ul,
.content-editable ol {
  margin-bottom: 1rem;
  color: var(--ink);
}
.content-editable table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: #fff;
}
.content-editable table th,
.content-editable table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.content-editable table th {
  color: var(--muted);
  font-weight: 500;
  width: 45%;
}
.content-editable img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.custom-logo {
  height: 42px;
  width: auto;
}


/* ========== Navbar mobile ========== */
.navbar-toggler {
  border: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 0.15rem rgba(13, 58, 110, 0.25);
}
.navbar-toggler-icon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  vertical-align: middle;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%230d3a6e' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

/* ========== Responsive: tablet ========== */
@media (max-width: 991.98px) {
  .site-header .navbar-brand img,
  .site-header .navbar-brand svg,
  .custom-logo {
    height: 36px;
  }
  .calc-panel {
    position: static !important;
    top: auto;
    margin-top: 0.5rem;
  }
  .hero h1 {
    font-size: 1.75rem;
  }
  .display-4 {
    font-size: 2rem;
  }
  .display-5 {
    font-size: 1.75rem;
  }
  .cta-banner {
    padding: 1.75rem 1.25rem;
  }
  .cta-banner .btn {
    display: inline-block;
    margin: 0.25rem;
  }
}

/* ========== Responsive: mobile ========== */
@media (max-width: 767.98px) {
  .hero {
    padding: 1.75rem 0 1.25rem;
  }
  .hero h1 {
    font-size: 1.5rem;
    line-height: 1.3;
  }
  .hero-lead {
    font-size: 1rem;
  }
  .hero-badge {
    font-size: 0.75rem;
  }
  .hero-specs {
    font-size: 0.85rem;
    text-align: left !important;
  }
  .product-image,
  .product-image-slot img {
    max-height: 240px !important;
  }

  .audience-bar {
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .audience-bar::-webkit-scrollbar {
    display: none;
  }
  .audience-bar .container {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .pill-switch {
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem;
    flex-shrink: 0;
  }

  .mod-card {
    padding: 1.15rem;
  }
  .mod-card .price {
    font-size: 1.2rem;
  }

  .feature-tile {
    padding: 1rem;
  }

  .cta-banner {
    border-radius: 12px;
    padding: 1.5rem 1rem;
  }
  .cta-banner .h3,
  .cta-banner .h4 {
    font-size: 1.2rem;
  }

  .site-footer {
    padding: 2rem 0 1.25rem;
    margin-top: 2.5rem;
  }
  .site-footer .col-md-4 {
    margin-bottom: 0.5rem;
  }

  .breadcrumb {
    font-size: 0.8rem;
    flex-wrap: wrap;
  }

  /* Tables from editor — horizontal scroll */
  .content-editable table,
  .specs-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .content-editable table th,
  .specs-table th {
    min-width: 120px;
  }

  .content-editable {
    max-width: 100%;
  }
  .content-editable h2 {
    font-size: 1.25rem;
  }

  /* Calculator form */
  .form-check.border.rounded {
    padding: 0.85rem !important;
  }
  .form-check.border.rounded .float-end {
    float: none !important;
    display: block;
    margin-top: 0.35rem;
  }
  .calc-total {
    font-size: 1.35rem;
  }
  .machine-schema {
    max-width: 100%;
  }

  /* Order form */
  .btn-lg {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  /* Nav collapse */
  #mainNav {
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
  }
  #mainNav .navbar-nav {
    margin-bottom: 0.75rem !important;
  }
  #mainNav .btn-brand {
    width: 100%;
    text-align: center;
  }
  #mainNav .text-brand {
    display: block !important;
    margin-bottom: 0.5rem;
    text-align: center;
  }
}

/* ========== Small phones ========== */
@media (max-width: 375.98px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  .hero h1 {
    font-size: 1.35rem;
  }
  .pill-switch {
    font-size: 0.72rem;
    padding: 0.35rem 0.7rem;
  }
  .display-4 {
    font-size: 1.65rem;
  }
}

/* Prevent horizontal overflow */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}
img, svg, video, iframe {
  max-width: 100%;
  height: auto;
}
