/* =========================================================
   Метизы 57 - современная адаптивная верстка
   Существующие URL и изображения сохранены.
   ========================================================= */

:root {
  --blue: #1557a6;
  --blue-dark: #0d3f7d;
  --blue-light: #eaf3ff;
  --accent: #f59e0b;
  --text: #202a36;
  --muted: #667085;
  --border: #dce4ee;
  --bg: #f4f7fb;
  --white: #fff;
  --shadow: 0 8px 28px rgba(15, 50, 90, .08);
  --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-align: left;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

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

.site {
  width: min(1440px, calc(100% - 32px));
  margin: 20px auto;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: 14px;
  overflow: hidden;
}

/* ---------- Шапка ---------- */

.header {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: #fff;
}

.header-inner {
  min-height: 125px;
  padding: 25px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand { min-width: 0; }

.logo {
  display: inline-block;
  color: #fff;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.8px;
}

.logo:hover { text-decoration: none; }

.tagline {
  margin: 10px 0 0;
  color: #dbeafe;
  font-size: 16px;
}

.header-contact {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  flex-wrap: wrap;
}

.phone {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
}

.email {
  color: #dbeafe;
  white-space: nowrap;
}

.order-button,
.hero-button,
.bottom-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 19px;
  border-radius: 8px;
  background: var(--accent);
  color: #1d2a3a;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.order-button:hover,
.hero-button:hover,
.bottom-cta a:hover {
  text-decoration: none;
  filter: brightness(.96);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 25px;
  background: rgba(0,0,0,.16);
}

.main-nav a {
  color: #fff;
  padding: 11px 17px;
  border-radius: 7px;
  font-weight: 700;
}

.main-nav a:hover,
.main-nav a.active {
  background: #fff;
  color: var(--blue-dark);
  text-decoration: none;
}

/* ---------- Основная область ---------- */

.layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 28px;
  padding: 28px;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.sidebar-title {
  padding: 15px 17px;
  background: var(--blue);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}

.catalog > a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  border-bottom: 1px solid #edf1f5;
  font-weight: 600;
}

.catalog > a:hover {
  background: var(--blue-light);
  color: var(--blue-dark);
  text-decoration: none;
}

.contact-card {
  margin: 15px;
  padding: 15px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid var(--border);
}

.contact-card strong,
.contact-card span,
.contact-card a {
  display: block;
}

.contact-card strong {
  margin-bottom: 5px;
}

.contact-card span {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.contact-card a:first-of-type {
  font-weight: 800;
  color: var(--text);
}

/* ---------- Контент ---------- */

.content {
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 30px;
  padding: clamp(25px, 4vw, 50px);
  margin-bottom: 25px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #edf5ff, #f8fbff);
  border: 1px solid #d9e7f8;
}

.eyebrow {
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 13px;
  font-weight: 800;
}

.hero h1 {
  margin: 8px 0 12px;
  color: #102f55;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
}

.hero p {
  max-width: 680px;
  margin: 0 0 23px;
  color: var(--muted);
  font-size: 18px;
}

.hero img {
  width: 100%;
  max-height: 330px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 25px;
}

.category-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  box-shadow: 0 3px 12px rgba(20,50,90,.05);
  transition: transform .18s ease, box-shadow .18s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.category-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1.45;
  object-fit: cover;
  background: #f1f4f7;
}

.category-card span,
.category-card small {
  display: block;
  padding-left: 12px;
  padding-right: 12px;
}

.category-card span {
  padding-top: 10px;
  font-size: 17px;
  font-weight: 800;
}

.category-card small {
  padding-top: 2px;
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.featurebox {
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.featurebox p {
  margin: 0 0 18px;
}

.featurebox h2 {
  margin: 38px 0 15px;
  padding-bottom: 9px;
  color: #123e70;
  font-size: clamp(24px, 3vw, 31px);
  line-height: 1.2;
  border-bottom: 2px solid #e7eef6;
}

.featurebox ul {
  padding-left: 24px;
}

.featurebox li {
  margin: 7px 0;
}

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

.benefits > div {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.benefits strong,
.benefits span {
  display: block;
}

.benefits strong {
  color: var(--blue-dark);
  margin-bottom: 5px;
}

.benefits span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.wide-image {
  display: block;
  width: 100%;
  max-width: 900px;
  margin: 25px auto 5px;
  border-radius: 10px;
}

.bottom-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 25px;
  padding: 23px 25px;
  border-radius: var(--radius);
  background: var(--blue-dark);
  color: #fff;
}

.bottom-cta strong,
.bottom-cta span {
  display: block;
}

.bottom-cta strong {
  font-size: 21px;
}

.bottom-cta span {
  color: #dbeafe;
  margin-top: 3px;
}

/* ---------- Подвал ---------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 30px;
  background: #0b315f;
  color: #cfe0f5;
  font-size: 14px;
}

.footer a {
  color: #fff;
}

/* ---------- Таблицы на старых страницах каталога ---------- */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  max-width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 14px;
}

th, td {
  border: 1px solid #ccd6e2;
  padding: 8px;
}

th {
  background: #edf3f9;
  font-weight: 700;
}

/* ---------- Адаптивность ---------- */

@media (max-width: 1150px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .header-inner {
    align-items: flex-start;
  }

  .header-contact {
    flex-direction: column;
    align-items: flex-end;
  }
}

@media (max-width: 850px) {
  .site {
    width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .header-inner {
    padding: 22px 20px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .header-contact {
    align-items: center;
  }

  .main-nav {
    overflow-x: auto;
    justify-content: flex-start;
    white-space: nowrap;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .sidebar {
    position: static;
  }

  .catalog {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar-title,
  .contact-card {
    grid-column: 1 / -1;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .header-inner {
    min-height: auto;
  }

  .logo {
    font-size: 36px;
  }

  .tagline {
    font-size: 14px;
  }

  .phone {
    font-size: 20px;
  }

  .email {
    font-size: 14px;
  }

  .main-nav a {
    padding: 10px 12px;
    font-size: 14px;
  }

  .layout {
    padding: 12px;
  }

  .catalog {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    padding: 22px 18px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero p {
    font-size: 16px;
  }

  .category-grid,
  .benefits {
    grid-template-columns: 1fr;
  }

  .featurebox {
    padding: 18px;
  }

  .bottom-cta {
    align-items: stretch;
    flex-direction: column;
  }

  .bottom-cta a {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    padding: 18px;
  }
}