:root {
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-text: #1f2933;
  --color-muted: #5f6b7a;
  --color-primary: #0f4c81;
  --color-primary-dark: #0a3558;
  --color-border: #d9e2ec;
  --shadow: 0 10px 30px rgba(15, 76, 129, 0.08);
  --radius: 12px;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  z-index: 20;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.logo__title {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.logo__subtitle {
  display: block;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.header__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 0.925rem;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: transparent;
}

.site-nav {
  border-top: 1px solid var(--color-border);
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
}

.menu__item {
  position: relative;
}

.menu__item > a {
  display: block;
  padding: 14px 0;
  font-weight: 500;
}

.menu__item.has-sub > a::after {
  content: "▾";
  margin-left: 6px;
  font-size: 0.8em;
  opacity: 0.6;
}

.menu__sub {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
}

.menu__item:hover > .menu__sub,
.menu__item:focus-within > .menu__sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu__sub a {
  display: block;
  padding: 8px 18px;
  white-space: nowrap;
}

.menu__sub a:hover {
  background: var(--color-bg);
}

.hero-slider {
  position: relative;
  overflow: hidden;
  background: #0f4c81;
  height: clamp(380px, 42vw, 520px);
  color: #fff;
}

.hero-slider__track {
  position: absolute;
  inset: 0;
}

.hero-slider__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
  display: flex;
  align-items: center;
}

.hero-slider__slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.hero-slider__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: transform 8s ease;
}

.hero-slider__slide.is-active .hero-slider__bg {
  transform: scale(1.08);
}

.hero-slider__bg--fallback {
  background: linear-gradient(135deg, #0f4c81 0%, #1b6ca8 50%, #0a3d66 100%);
}

.hero-slider__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(8, 30, 58, 0.88) 0%, rgba(8, 30, 58, 0.55) 55%, rgba(8, 30, 58, 0.25) 100%);
}

.hero-slider__content {
  position: relative;
  z-index: 2;
  padding: 48px 0 88px;
  max-width: 720px;
}

.hero-slider__title {
  margin: 0 0 16px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.15;
  font-weight: 700;
}

.hero-slider__lead {
  margin: 0 0 28px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.55;
  opacity: 0.95;
  max-width: 560px;
}

.hero-slider__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-slider__nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
}

.hero-slider__dots {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.hero-slider__dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-slider__dot.is-active {
  background: #fff;
  transform: scale(1.15);
}

.hero-slider__arrow {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 0;
  position: relative;
  transition: background 0.2s ease;
}

.hero-slider__arrow:hover {
  background: rgba(255, 255, 255, 0.22);
}

.hero-slider__arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
  transform: translate(-50%, -50%) rotate(-135deg);
}

.hero-slider__arrow--next::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

/* legacy hero (fallback) */
.hero {
  background: linear-gradient(135deg, #0f4c81, #1b6ca8);
  color: #fff;
  padding: 56px 0;
}

.hero__inner { max-width: 760px; }
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
}
.hero__lead {
  margin: 0 0 24px;
  font-size: 1.05rem;
  opacity: 0.95;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.btn--primary {
  background: #fff;
  color: var(--color-primary);
}
.btn--ghost {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

/* Кнопки на светлом фоне (форма, контент) */
.content-block .btn--primary,
.cform .btn--primary {
  background: var(--color-primary);
  color: #fff;
  border: 2px solid var(--color-primary);
  box-shadow: 0 2px 8px rgba(15, 76, 129, 0.18);
}
.content-block .btn--primary:hover,
.cform .btn--primary:hover {
  background: #fff;
  color: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 4px 14px rgba(15, 76, 129, 0.22);
}
.content-block .btn--primary:active,
.cform .btn--primary:active {
  background: var(--color-primary-dark);
  color: #fff;
  border-color: var(--color-primary-dark);
}
.cform__submit {
  min-width: 160px;
  margin-top: 4px;
}

.site-main { padding: 32px 0 48px; }

.page-header h1,
.product__header h1 {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.breadcrumbs {
  margin-bottom: 20px;
  font-size: 0.875rem;
  color: var(--color-muted);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.breadcrumbs__item:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: #94a3b8;
}

.content-block,
.category-description,
.product__body {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.content-block table,
.product__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.content-block th,
.content-block td,
.product__body th,
.product__body td {
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  text-align: left;
}
.content-block th,
.product__body th {
  background: #eef4fa;
}

.category-card,
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.category-card {
  display: block;
  padding: 20px;
  margin: 0 0 16px;
  color: inherit;
}
.category-card:hover { border-color: var(--color-primary); }
.category-card__title { margin: 0 0 8px; font-size: 1.1rem; }
.category-card__text { margin: 0; color: var(--color-muted); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.product-card__link {
  display: block;
  color: inherit;
  padding: 16px;
}
.product-card__image {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f6;
  margin-bottom: 12px;
}
.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card__title {
  margin: 0;
  font-size: 1rem;
}
.product-card__brand {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.product__layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  margin-top: 20px;
}
/* Без фото описание не должно сжиматься в колонку 320px */
.product__layout:not(:has(.product__gallery)) {
  grid-template-columns: 1fr;
}
.product__layout > .product__body:only-child {
  grid-column: 1 / -1;
}
.product__gallery img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: #fff;
}
.product__intro { margin-bottom: 16px; }
.product__cta {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius);
  background: #eef4fa;
  border: 1px solid #c8d9ea;
}
.product__phones a { font-weight: 600; }

.site-footer {
  background: #102a43;
  color: #d9e2ec;
  padding: 32px 0;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.site-footer a { color: #fff; }

@media (max-width: 900px) {
  .header__contacts { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav { display: none; }
  .site-nav.is-open { display: block; }
  .menu { flex-direction: column; gap: 0; }
  .menu__item.has-sub > a::after { display: none; }
  .menu__sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    min-width: 0;
    max-height: none;
    padding: 0 0 8px 12px;
  }
  .menu__sub a { white-space: normal; padding: 6px 0; }
  .product__layout { grid-template-columns: 1fr; }
  .cform__grid { grid-template-columns: 1fr; }
}

/* Contact form */
.cform {
  margin: 24px 0 0;
  max-width: 720px;
}
.cform__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.cform__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.cform__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--color-text);
}
.cform__field span { font-weight: 500; }
.cform__field-error {
  font-size: 0.8rem;
  color: #a23;
}
.cform__field input,
.cform__field textarea {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
  color: inherit;
  background: var(--color-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cform__field input:focus,
.cform__field textarea:focus {
  outline: none;
  border-color: #1b6ca8;
  box-shadow: 0 0 0 3px rgba(27, 108, 168, 0.15);
}
.cform__field textarea { resize: vertical; min-height: 120px; }
.cform__note { font-size: 0.8rem; color: var(--color-muted, #667); margin: 0 0 16px; }
.cform__errors {
  background: #fff0f0;
  border: 1px solid #f3c2c2;
  color: #a23;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.cform__errors ul { margin: 0; padding-left: 18px; }
.cform__done {
  background: #eef9f0;
  border: 1px solid #bfe3c6;
  color: #1c6b32;
  border-radius: 10px;
  padding: 20px 24px;
  font-size: 1.05rem;
  margin-top: 24px;
}
