/* ============================================================
   KTB Uzbekistan — industrial computing distributor
   Design language: technical datasheet / engineering drawing.
   Not a SaaS site. Reads like spec documentation with commerce
   grafted on, because the buyer is an engineer comparing specs.
   ============================================================ */

:root {
  /* base palette */
  --graphite: #14181c;
  --steel: #4b5a66;
  --steel-light: #7c8892;
  --paper: #eceef0;
  --panel: #ffffff;
  --line: #ccd1d5;
  --line-strong: #a9b0b6;
  --signal: #c97a1a;      /* indicator-light amber, desaturated */
  --signal-dark: #9c5f12;
  --signal-bg: #f5e6d3;

  /* type */
  --f-head: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  --f-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--f-head);
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
}

h1 { font-size: 40px; line-height: 1.15; }
h2 { font-size: 26px; line-height: 1.25; }
h3 { font-size: 18px; }

p { max-width: 62ch; }

a { color: var(--graphite); }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- header ---------------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img { height: 30px; width: auto; display: block; }

.nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
}

.nav a { text-decoration: none; color: var(--steel); }
.nav a:hover { color: var(--graphite); }

.btn-cta {
  font-family: var(--f-mono);
  font-size: 13px;
  background: var(--graphite);
  color: var(--panel);
  border: 1px solid var(--graphite);
  padding: 9px 16px;
  text-decoration: none;
  display: inline-block;
}

.btn-cta:hover { background: var(--signal-dark); border-color: var(--signal-dark); }

.btn-outline {
  font-family: var(--f-mono);
  font-size: 13px;
  background: transparent;
  color: var(--graphite);
  border: 1px solid var(--line-strong);
  padding: 9px 16px;
  text-decoration: none;
  display: inline-block;
}

.btn-outline:hover { border-color: var(--graphite); }

/* ---------------- hero: datasheet header block ---------------- */

.hero {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  padding: 56px 0 0;
  min-width: 0;
}

.hero-tag {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--signal-dark);
  background: var(--signal-bg);
  display: inline-block;
  padding: 3px 8px;
  margin-bottom: 18px;
}

.hero h1 { max-width: 14ch; margin-bottom: 16px; }

.hero p { color: var(--steel); font-size: 16px; margin-bottom: 24px; }

.hero-actions { display: flex; gap: 10px; margin-bottom: 48px; }

/* spec strip — datasheet style, not icon cards */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.spec-strip div {
  padding: 16px 0;
  border-right: 1px solid var(--line);
}

.spec-strip div:last-child { border-right: none; }

.spec-strip .num {
  font-family: var(--f-mono);
  font-size: 22px;
  color: var(--graphite);
}

.spec-strip .label {
  font-size: 12px;
  color: var(--steel);
  margin-top: 2px;
}

.hero-visual {
  border-left: 1px solid var(--line);
  padding: 56px 0 0 40px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--steel-light);
  min-width: 0;
}

.hero-visual .frame {
  border: 1px solid var(--line);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--line-strong);
  margin-bottom: 10px;
  overflow: hidden;
}

/* ---------------- sections ---------------- */

section { padding: 56px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.section-head h2 { }
.section-head a { font-family: var(--f-mono); font-size: 13px; color: var(--steel); text-decoration: none; }

/* category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.cat-card {
  background: var(--panel);
  padding: 24px 20px;
  text-decoration: none;
  color: var(--graphite);
  min-width: 0;
}

.cat-card .cat-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  margin: -24px -20px 16px;
  border-bottom: 1px solid var(--line);
}

.cat-card .cat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cat-card .code {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--steel);
}

.cat-card h3 { margin: 10px 0 6px; font-size: 16px; }
.cat-card p { font-size: 13px; color: var(--steel); margin: 0; }

/* product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.product-card {
  background: var(--panel);
  padding: 20px;
  text-decoration: none;
  color: var(--graphite);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-card .thumb {
  aspect-ratio: 4/3;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--line-strong);
  font-family: var(--f-mono);
  font-size: 11px;
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--panel);
}

.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; }

.product-card .model {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--signal-dark);
}

.product-card h3 { margin: 6px 0 8px; font-size: 15px; }

.product-card .specs {
  font-size: 13px;
  color: var(--steel);
  margin: 0 0 16px;
  flex: 1;
}

.tag-row { display: flex; gap: 6px; margin-bottom: 14px; }

.tag {
  font-family: var(--f-mono);
  font-size: 11px;
  border: 1px solid var(--line-strong);
  padding: 2px 6px;
  color: var(--steel);
}

/* trust / cert strip */
.trust-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 20px 0;
}

.trust-strip .wrap {
  display: flex;
  gap: 40px;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--steel);
  align-items: center;
}

/* RFQ form */
.rfq {
  background: var(--graphite);
  color: var(--paper);
}

.rfq .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.rfq h2 { color: var(--panel); }
.rfq p { color: #9aa4ac; }

.rfq form { display: flex; flex-direction: column; gap: 10px; }

.rfq input, .rfq textarea, .rfq select {
  background: #1e2429;
  border: 1px solid #333c42;
  color: var(--panel);
  padding: 12px;
  font-family: var(--f-body);
  font-size: 14px;
}

.rfq label { font-size: 12px; color: #9aa4ac; font-family: var(--f-mono); }

.rfq .submit {
  font-family: var(--f-mono);
  background: var(--signal);
  color: var(--graphite);
  border: none;
  padding: 13px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 4px;
}

.rfq .submit:hover { background: #dd9433; }

.rfq .alt-contact {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.rfq .alt-contact a {
  color: var(--panel);
  font-family: var(--f-mono);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid #333c42;
  padding: 9px 14px;
}

/* footer */
.site-footer {
  padding: 32px 0;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--steel);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
}

/* ---------------- product detail page ---------------- */

.pd-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 40px 0;
}

.pd-inner > div { min-width: 0; }

.pd-frame {
  border: 1px solid var(--line);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--line-strong);
  font-family: var(--f-mono);
  font-size: 12px;
  overflow: hidden;
  background: var(--panel);
}

.pd-frame img { width: 100%; height: 100%; object-fit: contain; }

.thumb-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--line-strong);
  font-family: var(--f-mono);
  font-size: 11px;
}

.breadcrumb {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--steel);
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.breadcrumb a { color: var(--steel); text-decoration: none; }
.breadcrumb a:hover { color: var(--graphite); }

.pd-model { font-family: var(--f-mono); color: var(--signal-dark); font-size: 13px; margin-bottom: 8px; }

.pd-actions { display: flex; gap: 10px; margin: 24px 0; }

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
}

.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table td { padding: 10px 0; }
.spec-table td:first-child { color: var(--steel); width: 40%; font-family: var(--f-mono); font-size: 12px; }

/* ---------------- responsive ---------------- */

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { border-left: none; border-top: 1px solid var(--line); padding: 24px 0 0; margin-top: 24px; }
  .rfq .wrap { grid-template-columns: 1fr; }
  .pd-inner { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }

  /* nav becomes a horizontal scroll strip instead of disappearing —
     на мобильном раньше пункты меню были просто недоступны */
  .site-header .wrap { flex-wrap: wrap; row-gap: 10px; height: auto; padding: 12px 16px; }
  .nav {
    display: flex;
    order: 3;
    width: 100%;
    overflow-x: auto;
    gap: 18px;
    padding-bottom: 2px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .nav a { flex: 0 0 auto; }

  .trust-strip .wrap {
    flex-wrap: wrap;
    gap: 10px 20px;
    row-gap: 8px;
  }
  .trust-strip .wrap span:nth-child(1) { width: 100%; }
  .trust-strip .wrap span:last-child { margin-left: 0 !important; }
}

/* узкие телефоны: карточки в одну колонку, иначе текст сжимается
   и наезжает сам на себя */
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .cat-grid, .product-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions a { text-align: center; }
  .spec-strip { grid-template-columns: 1fr; }
  .spec-strip div { border-right: none; border-bottom: 1px solid var(--line); }
  .spec-strip div:last-child { border-bottom: none; }
  .pd-actions { flex-direction: column; }
  .pd-actions a { text-align: center; }
}
