:root {
  --orange: #ff9a00;
  --orange-hover: #ffa929;
  --text: #161616;
  --muted: #555;
  --line: #00000014;
  --bg-soft: #f9f9f9;
  --footer: #1c1c1c;
  --footer-bottom: #161616;
  --font: "Raleway", Arial, sans-serif;
  --head: "PT Sans", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.6 var(--font); color: var(--text); background: #fff; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--orange); }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.2; }
.container { max-width: 1440px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 960px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.header-top { position: relative; display: flex; justify-content: center; padding-top: 14px; }
.logo img { display: block; width: 200px; }
.header-icons { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: flex; gap: 18px; }
.header-icons a { display: flex; }
.main-nav ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; margin: 0 auto; padding-top: 18px; padding-bottom: 20px; }
.main-nav a { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }

main { padding: 40px 0 20px; min-height: 50vh; }

/* homepage */
.tiles { max-width: 870px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.tiles a { display: block; border-radius: 3px; overflow: hidden; transition: filter .2s; }
.tiles a:hover { filter: brightness(1.06); }
.tiles img { display: block; width: 100%; }
.benefits { display: flex; justify-content: center; gap: 24px 120px; flex-wrap: wrap; margin: 70px auto 60px; text-align: center; }
.benefits div { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 160px; }
.benefits img { width: 72px; height: 72px; border-radius: 50%; }
.benefits strong { font-size: 15px; font-weight: 600; }
.welcome { max-width: 610px; margin: 0 auto; text-align: center; font-size: 12.5px; }
.welcome h1 { font-size: 34px; margin: 0 0 18px; }
.welcome-logo { width: 220px; display: block; margin: 0 auto 10px; }
.diagram { display: block; margin: 70px auto 40px; width: 500px; }

/* layout with sidebar */
.with-sidebar { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }
.sidebar .box { background: var(--bg-soft); border: 1px solid #e8e8e8; border-radius: 3px; padding: 20px; }
.sidebar h4 { margin: 0 0 10px; font-size: 16px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar ul ul { padding-left: 14px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; font-size: 14px; border-radius: 3px; }
.sidebar .pm { color: var(--orange); font-weight: 700; width: 10px; text-align: center; }
.sidebar li.active > a { background: #ececec; color: var(--orange); font-weight: 600; }

.breadcrumbs { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs span { margin: 0 4px; }
.cat-title { font-size: 28px; text-align: center; margin: 0 0 20px; }
.perex { max-width: 800px; margin: 0 auto 24px; text-align: center; }

.subcats { list-style: none; padding: 0 0 28px; margin: 0 0 30px; border-bottom: 1px solid #ddd; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.subcats a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 1px solid #e5e5e5; border-radius: 3px; text-align: center; font-size: 12px; height: 100%; }
.subcats a:hover { border-color: var(--orange); }
.subcats img { width: 120px; height: 86px; object-fit: contain; }

/* product grid */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 50px 30px; }
.product { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20px 10px; border-radius: 3px; transition: box-shadow .2s; }
.product:hover { color: inherit; box-shadow: 0 2px 16px #0000001a; }
.product .img { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1.3; }
.product .img img { max-height: 100%; width: auto; object-fit: contain; }
.product .name { font-weight: 700; font-size: 15px; margin: 18px 0 10px; }
.product .perex { font-size: 12px; color: var(--muted); }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 50px 0 10px; }
.pager a, .pager span { min-width: 34px; padding: 5px 10px; border: 1px solid #e5e5e5; border-radius: 3px; text-align: center; font-size: 12px; }
.pager .cur, .pager a:hover { border-color: var(--orange); color: var(--orange); }
.count { text-align: center; font-size: 12px; color: var(--muted); }
.empty { text-align: center; padding: 40px 0; }
.empty a { color: var(--orange); text-decoration: underline; }

/* product detail */
.detail { display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px; align-items: start; }
.gallery { display: flex; flex-direction: column; align-items: center; position: sticky; top: 20px; }
.gallery #main-img { max-height: 420px; width: auto; object-fit: contain; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.thumbs button { padding: 4px; border: 1px solid #e5e5e5; background: #fff; border-radius: 3px; cursor: pointer; }
.thumbs img { width: 60px; height: 60px; object-fit: contain; display: block; }
.info h1 { font-size: 28px; margin: 0 0 6px; }
.params { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 10px 0 20px; padding: 12px 16px; background: var(--bg-soft); border-radius: 3px; font-size: 13px; }
.params dt { color: var(--muted); }
.params dd { margin: 0; font-weight: 600; }
.params a:hover { color: var(--orange); }
.description { font-size: 14px; }
.description table { border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.description th, .description td { padding: 3px 10px 3px 0; text-align: left; vertical-align: top; }
.description a { color: var(--orange); }
.actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 200px; padding: 12px 20px; background: var(--orange); color: #fff; border: 2px solid var(--orange); border-radius: 5px; font-weight: 600; }
.btn:hover { background: var(--orange-hover); border-color: var(--orange-hover); color: #fff; }
.btn-outline { background: #fff; color: var(--orange); }
.btn-outline:hover { color: #fff; }

/* search, contact */
.search input { display: block; width: 100%; max-width: 600px; margin: 0 auto 10px; padding: 12px 16px; font: inherit; font-size: 16px; border: 1px solid #ccc; border-radius: 5px; }
.search input:focus { outline: 2px solid var(--orange); border-color: var(--orange); }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contact a { color: var(--orange); }

/* footer */
.site-footer { background: var(--footer); color: #fff; margin-top: 40px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; max-width: 1200px; padding-top: 50px; padding-bottom: 40px; }
.site-footer h4 { color: var(--orange); font-size: 15px; margin: 0 0 22px; position: relative; }
.site-footer h4::after { content: ""; position: absolute; left: 0; bottom: -10px; width: 28px; height: 2px; background: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; font-size: 13px; }
.copyright { background: var(--footer-bottom); font-size: 11px; padding: 12px 0; }

@media (max-width: 991px) {
  .with-sidebar { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .products { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .detail { grid-template-columns: 1fr; }
  .gallery { position: static; }
}
@media (max-width: 600px) {
  .header-top { justify-content: flex-start; }
  .logo img { width: 140px; }
  .main-nav ul { gap: 4px 16px; justify-content: flex-start; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .benefits { gap: 24px; }
  .products { grid-template-columns: 1fr 1fr; }
  .product .perex { display: none; }
  .footer-cols, .contact { grid-template-columns: 1fr; }
  .cat-title, .info h1 { font-size: 24px; }
}
