/* ---------- Базовые стили ---------- */
*, *::before, *::after { box-sizing: border-box; }

:root{
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1c1f24;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0b6bcb;
  --accent-dark: #084f96;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; line-height: 1.25; }

.container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Шапка ---------- */
.site-header{
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav{
  display: flex;
  gap: 24px;
}
.nav a{
  color: var(--muted);
  font-weight: 500;
  transition: color .15s;
}
.nav a:hover,
.nav a.active{
  color: var(--accent);
}

/* ---------- Hero ---------- */
.hero{
  background: linear-gradient(135deg, #0b6bcb 0%, #084f96 100%);
  color: #fff;
  padding: 48px 0;
  margin-bottom: 32px;
}
.hero h1{
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  max-width: 800px;
  margin: 0;
}

/* ---------- Bento ---------- */
.bento{
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
.bento > div{
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.bento h2{
  font-size: 1.1rem;
  margin-bottom: 16px;
}

/* ---------- Категории ---------- */
.cat-list{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.cat-item{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  transition: all .15s;
}
.cat-item:hover{
  background: #eef2f7;
  border-color: var(--line);
}
.cat-count{
  font-size: .75rem;
  background: rgba(0,0,0,.08);
  padding: 1px 8px;
  border-radius: 10px;
}

/* ---------- О проекте ---------- */
.about p{ margin: 0 0 10px; color: var(--muted); }
.about a{ color: var(--accent); }
.requisites{
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  font-size: .9rem;
}

/* ---------- Каталог ---------- */
.catalog-bar{
  margin-bottom: 20px;
}
.catalog-bar h2{
  font-size: 1.4rem;
}
.catalog-bar em{
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
  font-size: 1rem;
}

/* ---------- Сетка товаров ---------- */
.grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.card{
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .15s, box-shadow .15s;
  color: inherit;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.photo{
  aspect-ratio: 4 / 3;
  background: var(--bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.photo img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sku{
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .03em;
}
.name{
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.7em;
}
.card:hover .name{ color: var(--accent); }
.stock{
  font-size: .78rem;
}
.stock.in{ color: #15803d; }
.stock.out{ color: #b91c1c; }
.row{
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.price{
  font-size: 1.05rem;
  font-weight: 700;
}

/* ---------- Хлебные крошки ---------- */
.breadcrumbs{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0;
  font-size: .85rem;
  color: var(--muted);
}
.breadcrumbs a{ color: var(--accent); }
.breadcrumbs a:hover{ text-decoration: underline; }

/* ---------- Страница товара ---------- */
.product{
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.product-photo{
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-photo img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.product-info h1{
  font-size: 1.6rem;
  margin: 8px 0 16px;
}
.product-info .sku{
  font-size: .85rem;
  margin-bottom: 6px;
}
.price-big{
  font-size: 1.8rem;
  font-weight: 700;
  margin: 12px 0;
}
.product-info .stock{
  font-size: .9rem;
  margin-bottom: 16px;
}
.product-info .desc{
  font-size: 1rem;
  color: var(--muted);
  margin: 16px 0 24px;
}

/* ---------- Кнопка «Заказать» ---------- */
.btn-order{
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-top: 8px;
  transition: background .15s;
}
.btn-order:hover{ background: var(--accent-dark); }

/* ---------- Документные секции ---------- */
.doc{
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}
.doc h2{
  font-size: 1.25rem;
  margin-bottom: 16px;
}
.doc p{ margin: 0 0 12px; }
.doc img{
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 12px 0;
}
.doc table{
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: .9rem;
}
.doc table th,
.doc table td{
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.doc table th{
  background: var(--bg);
  font-weight: 600;
}
.doc ul, .doc ol{
  margin: 8px 0 16px;
  padding-left: 24px;
}

/* ---------- Форма заказа ---------- */
.order{
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 60px;
}
.order h2{
  font-size: 1.25rem;
  margin-bottom: 16px;
}
.order label{
  display: block;
  margin-bottom: 14px;
  font-size: .9rem;
  color: var(--muted);
}
.order input[type=text],
.order input[type=tel],
.order input[type=email],
.order textarea{
  width: 100%;
  max-width: 480px;
  padding: 8px 12px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
}
.order input:focus,
.order textarea:focus{
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.order button{
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.order button:hover{ background: var(--accent-dark); }

/* ---------- Сообщения формы ---------- */
.msg{
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: .9rem;
}
.msg.ok{ background: #dcfce7; color: #166534; }
.msg.err{ background: #fee2e2; color: #991b1b; }

/* ---------- Заглушка "нет фото" ---------- */
.no-photo{
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
}

/* ---------- Подвал ---------- */
.site-footer{
  background: #1c1f24;
  color: #cbd0d8;
  padding: 40px 0 20px;
  margin-top: 40px;
}
.footer-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.site-footer h4{
  color: #fff;
  font-size: .95rem;
  margin-bottom: 12px;
}
.site-footer p{
  margin: 0;
  font-size: .88rem;
  line-height: 1.6;
}
.footer-bottom{
  border-top: 1px solid #2e333b;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: .8rem;
  color: #8b919a;
}

/* ---------- Адаптив ---------- */
@media (max-width: 900px){
  .bento{ grid-template-columns: 1fr; }
  .hero{ padding: 36px 0; margin-bottom: 24px; }
  .grid{ grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .card{ padding: 12px; }
  .product{ grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 520px){
  .nav{ gap: 16px; font-size: .9rem; }
  .cat-list{ grid-template-columns: 1fr; }
}