:root {
  --ink: #17232d;
  --muted: #687681;
  --line: #dbe3e8;
  --page: #edf2f4;
  --surface: #ffffff;
  --soft: #f5f7f8;
  --accent: #e9a51a;
  --accent-dark: #9b650a;
  --green: #147b58;
  --navy: #17232d;
  --radius-sm: 7px;
  --radius: 12px;
  --shadow-sm: 0 8px 24px rgba(20, 35, 47, 0.06);
  --shadow: 0 20px 54px rgba(20, 35, 47, 0.11);
  --container: 1240px;
  --gutter: clamp(16px, 3vw, 32px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--page); font-size: 15px; line-height: 1.5; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(40px, 6vw, 76px); line-height: 0.98; letter-spacing: -0.05em; }
h2 { margin-bottom: 14px; font-size: clamp(30px, 4vw, 48px); line-height: 1.04; letter-spacing: -0.04em; }
h3 { margin-bottom: 10px; font-size: 18px; line-height: 1.3; }

.container { width: min(var(--container), calc(100% - (var(--gutter) * 2))); margin-inline: auto; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 10px; color: var(--accent-dark); font-size: 11px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.section { padding-block: clamp(56px, 7vw, 92px); }
.section.light { background: var(--surface); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.section-heading > p { max-width: 460px; margin: 0; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  color: #17232d;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 850;
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}
.btn:hover { filter: brightness(0.97); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(233, 165, 26, 0.2); }
.btn.secondary { color: var(--ink); background: transparent; border-color: var(--line); box-shadow: none; }
.btn.dark { color: #fff; background: var(--ink); }
.btn.green { color: #fff; background: var(--green); }

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 11px max(var(--gutter), calc((100vw - var(--container)) / 2));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 900; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; color: var(--ink); background: var(--accent); border-radius: 9px; font-weight: 950; }
.nav { display: flex; justify-content: center; gap: clamp(16px, 2vw, 30px); color: var(--muted); font-size: 13px; font-weight: 800; }
.nav a { padding-block: 8px; }
.nav a:hover, .nav a.active { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.phone { color: var(--muted); font-size: 13px; font-weight: 800; }
.menu-btn { display: none; width: 42px; height: 42px; padding: 0; background: transparent; border: 0; border-radius: 8px; font-size: 24px; }

/* Home */
.hero { position: relative; display: flex; align-items: center; min-height: min(700px, 80vh); padding: 112px 0 82px; overflow: hidden; color: #fff; background: var(--navy); isolation: isolate; }
.hero::before, .hero::after { position: absolute; inset: 0; content: ""; }
.hero::before { z-index: -2; background: url("assets/hero-engineering-catalog.png") center / cover no-repeat; }
.hero::after { z-index: -1; background: linear-gradient(90deg, rgba(9, 18, 27, 0.95), rgba(9, 18, 27, 0.6) 58%, rgba(9, 18, 27, 0.12)); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 760px) auto; align-items: end; justify-content: space-between; gap: 48px; }
.hero .eyebrow, .quote-band .eyebrow { color: #ffd15a; }
.hero-copy { max-width: 660px; margin-bottom: 0; color: rgba(255, 255, 255, 0.8); font-size: 18px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 30px; }
.hero .btn.secondary { color: #fff; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.34); }
.hero-note { display: grid; grid-template-columns: repeat(2, auto); gap: 24px; padding: 20px; background: rgba(17, 29, 39, 0.58); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: var(--radius); backdrop-filter: blur(12px); }
.hero-note strong { display: block; font-size: 27px; line-height: 1; }
.hero-note span { color: rgba(255, 255, 255, 0.68); font-size: 12px; }
.stats { color: #fff; background: var(--navy); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { padding: 26px clamp(18px, 4vw, 54px); border-right: 1px solid rgba(255, 255, 255, 0.14); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; margin-bottom: 5px; font-size: 26px; line-height: 1; }
.stat span { color: rgba(255, 255, 255, 0.66); font-size: 12px; }

/* Categories */
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.category-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; }
.category-card:hover { border-color: rgba(233, 165, 26, 0.72); box-shadow: var(--shadow); transform: translateY(-3px); }
.category-media { aspect-ratio: 1; overflow: hidden; background: #eef1f2; }
.category-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 52%; transition: transform 0.25s ease; }
.category-card:hover .category-media img { transform: scale(1.025); }
.category-body { padding: 18px; }
.category-card strong { display: block; margin-bottom: 9px; font-size: 20px; }
.category-card span { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.category-count { display: none; }

/* Product cards */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (min-width: 961px) {
  #featuredProducts, #catalogProducts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.product-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px; box-shadow: var(--shadow-sm); }
.product-media { position: relative; aspect-ratio: 4 / 3; background: #f3f4f3; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.favorite { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 32px; height: 32px; color: var(--muted); background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line); border-radius: 50%; font-size: 17px; }
.favorite.saved { color: #b43d35; }
.product-body { display: flex; flex: 1; flex-direction: column; padding: 17px; }
.product-kicker { min-height: 12px; margin-bottom: 7px; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: 0.05em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.product-card h3 { min-height: 44px; margin-bottom: 13px; font-size: 17px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.specs div { display: flex; justify-content: space-between; gap: 8px; min-width: 0; color: var(--muted); font-size: 12px; }
.specs div:nth-child(n + 3) { grid-column: 1 / -1; }
.specs b { min-width: 0; overflow-wrap: anywhere; color: var(--ink); text-align: right; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; }
.price-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.3; }
.price-note strong { display: block; color: var(--ink); font-size: 15px; }
.product-foot .btn { min-height: 38px; padding-inline: 12px; font-size: 12px; }

/* Catalog */
.breadcrumbs { padding-top: 6px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--accent-dark); font-weight: 800; }
.catalog-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin: 28px 0 22px; }
.catalog-toolbar h1 { margin-bottom: 6px; font-size: clamp(36px, 4.5vw, 56px); }
.catalog-toolbar p { margin: 0; color: var(--muted); font-size: 13px; }
.search { display: flex; gap: 8px; width: min(430px, 100%); }
.search input { flex: 1; min-width: 0; min-height: 44px; padding: 0 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.catalog-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 0.28fr); gap: 14px; align-items: end; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.filters-heading { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.filters h2 { margin: 0; font-size: 20px; }
.filters .field { margin-bottom: 0; }
.category-filter { grid-column: 1 / -1; }
.dynamic-filters { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.dynamic-filters[hidden] { display: none; }
.clear-filters { grid-column: 2; justify-self: end; }
.clear-filters[hidden] { display: none; }
.field { display: grid; gap: 6px; margin-bottom: 13px; }
.field label { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; padding: 0 11px; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 6px; }
.field textarea { min-height: 104px; padding-top: 10px; resize: vertical; }
.filters .btn { width: 100%; }
.filter-note { max-width: 560px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: right; }
.empty { grid-column: 1 / -1; padding: 44px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Forms and footer */
.quote-band { color: #fff; background: var(--navy); }
.quote-grid { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 52px; align-items: center; }
.quote-band .hero-copy { font-size: 16px; }
.contact-cta { padding: 24px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-cta .eyebrow, .quote-band .contact-cta .eyebrow { margin-bottom: 8px; color: var(--accent-dark); }
.contact-cta h3 { margin-bottom: 10px; font-size: 22px; }
.contact-cta > p:not(.eyebrow) { margin-bottom: 18px; color: var(--muted); line-height: 1.55; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-actions .btn { flex: 1; min-width: 180px; }
.contact-more { display: inline-block; margin-top: 15px; color: var(--muted); font-size: 12px; font-weight: 800; }
.contact-more:hover { color: var(--accent-dark); }
.form-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; text-align: center; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.success { padding: 22px; color: var(--green); background: #edf9f3; border: 1px solid #b8e3cf; border-radius: 8px; }
.site-footer { padding: 40px 0; color: var(--muted); background: #f7f9fa; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 34px; }
.footer-brand { color: var(--ink); font-size: 18px; font-weight: 900; }
.footer-grid h3 { margin-bottom: 10px; color: var(--ink); font-size: 13px; }
.footer-grid a { display: block; margin: 7px 0; font-size: 13px; }
.footer-grid a:hover { color: var(--accent-dark); }
.footer-note { margin: 28px 0 0; padding-top: 17px; border-top: 1px solid var(--line); font-size: 12px; }
.mobile-request { display: none; }

/* Product detail */
.detail { padding: 0 0 84px; }
.product-detail { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(46px, 6vw, 84px); align-items: start; margin-top: 26px; }
.detail-image { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.detail-image img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.detail-content { min-width: 0; padding-top: 18px; }
.detail-content h1 { max-width: 650px; margin-bottom: 22px; font-size: clamp(40px, 5vw, 62px); }
.detail-lead { max-width: 650px; margin-bottom: 30px; color: var(--muted); font-size: 16px; }
.spec-table { margin: 0 0 30px; padding: 0 19px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.spec-row { display: grid; grid-template-columns: minmax(160px, 0.9fr) minmax(0, 1.1fr); gap: 24px; align-items: start; padding: 15px 0; border-bottom: 1px solid var(--line); }
.spec-row:last-child { border-bottom: 0; }
.spec-row span { color: var(--muted); }
.spec-value { display: grid; justify-items: end; min-width: 0; text-align: right; }
.spec-value b { max-width: 100%; overflow-wrap: anywhere; }
.spec-note { display: block; max-width: 430px; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.4; }
.detail-content .contact-cta { box-shadow: var(--shadow-sm); }
.related-products { margin-top: 58px; padding-top: 42px; border-top: 1px solid var(--line); }
.related-products .section-heading { margin-bottom: 24px; }
.related-products h2 { font-size: clamp(30px, 3vw, 40px); }
.related-products .section-heading,
.related-products .product-grid { width: 100%; margin-right: auto; margin-left: auto; }
.related-products .product-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 280px)); justify-content: start; gap: 18px; }
.related-products .product-grid--single { grid-template-columns: minmax(240px, 280px); justify-content: start; }
.related-products .product-media { aspect-ratio: 4 / 3; }
.related-products .product-card h3 { min-height: 0; font-size: 16px; }
.related-products .product-body { padding: 15px; }
.product-card--compact .specs,
.product-card--compact .price-note { display: none; }
.product-card--compact .product-foot { margin-top: 15px; padding-top: 0; border-top: 0; }
.product-card--compact .product-foot .btn { width: 100%; }
.related-action { align-self: center; }

/* Informational pages */
.info-hero { padding: 82px 0 58px; color: #fff; background: var(--navy); }
.info-hero .hero-copy { color: rgba(255, 255, 255, 0.76); }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.info-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.info-card strong { display: block; margin-bottom: 10px; font-size: 20px; }
.info-card p { margin: 0; color: var(--muted); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 1fr); gap: 26px; align-items: start; }
.contact-list { padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.contact-list p { margin: 0 0 17px; }
.contact-list p:last-child { margin-bottom: 0; }
.contact-list strong { display: block; margin-bottom: 3px; }

/* Tablet */
@media (max-width: 1080px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .nav, .phone { display: none; }
  .menu-btn { display: grid; place-items: center; }
  .nav.is-open { position: absolute; top: 68px; right: var(--gutter); left: var(--gutter); display: grid; gap: 0; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
  .nav.is-open a { padding: 12px; border-radius: 6px; }
  .nav.is-open a:hover { background: var(--soft); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-note { justify-self: start; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-shell { grid-template-columns: 1fr; }
  .dynamic-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quote-grid { grid-template-columns: 1fr; }
  .contact-cta { max-width: 680px; }
  .product-detail { grid-template-columns: 1fr; gap: 34px; }
  .detail-image { width: min(700px, 100%); }
  .detail-content { width: min(760px, 100%); padding-top: 0; }
  .related-products .product-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 280px)); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 700px) {
  :root { --gutter: 14px; }
  body { font-size: 14px; }
  h1 { font-size: clamp(38px, 12vw, 54px); }
  h2 { font-size: clamp(28px, 9vw, 40px); }
  .section { padding-block: 48px; }
  .section-heading, .catalog-toolbar { display: block; }
  .section-heading > p { margin-top: 12px; }
  .topbar { min-height: 64px; padding-block: 10px; }
  .brand span:last-child { max-width: 166px; overflow: hidden; text-overflow: ellipsis; }
  .top-actions .secondary { display: none; }
  .hero { min-height: 640px; padding: 94px 0 52px; }
  .hero-copy { font-size: 16px; }
  .hero-note { grid-template-columns: 1fr 1fr; margin-top: 26px; padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { padding: 18px 16px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
  .stat:last-child { border-bottom: 0; }
  .category-grid, .product-grid, .info-grid { grid-template-columns: 1fr; }
  .category-media { aspect-ratio: 1; }
  #homeCategories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #homeCategories .category-media { aspect-ratio: 1; }
  #homeCategories .category-body { display: flex; align-items: center; min-height: 58px; padding: 11px 12px; }
  #homeCategories .category-card strong { margin: 0; font-size: 16px; line-height: 1.2; }
  #homeCategories .category-card span { display: none; }
  .catalog-toolbar { margin-top: 22px; }
  .search { margin-top: 16px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 15px; }
  .filters-heading, .category-filter, .dynamic-filters, .filters .btn { grid-column: 1 / -1; }
  .dynamic-filters { grid-template-columns: 1fr 1fr; }
  .filters-heading { display: grid; gap: 4px; }
  .filter-note { text-align: left; }
  #catalogProducts, #featuredProducts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  :is(#catalogProducts, #featuredProducts) .product-media { aspect-ratio: 1; }
  :is(#catalogProducts, #featuredProducts) .favorite { top: 7px; right: 7px; width: 28px; height: 28px; font-size: 15px; }
  :is(#catalogProducts, #featuredProducts) .product-body { padding: 11px; }
  :is(#catalogProducts, #featuredProducts) .product-kicker { margin-bottom: 5px; font-size: 8px; }
  :is(#catalogProducts, #featuredProducts) .product-card h3 { display: -webkit-box; min-height: 53px; margin-bottom: 9px; overflow: hidden; font-size: 14px; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  :is(#catalogProducts, #featuredProducts) .specs { grid-template-columns: 1fr; gap: 4px; padding: 8px 0; }
  :is(#catalogProducts, #featuredProducts) .specs div { font-size: 10px; }
  :is(#catalogProducts, #featuredProducts) .specs div:nth-child(n + 3) { display: none; }
  :is(#catalogProducts, #featuredProducts) .price-note { display: none; }
  :is(#catalogProducts, #featuredProducts) .product-foot { align-items: stretch; flex-direction: column; padding-top: 10px; }
  :is(#catalogProducts, #featuredProducts) .product-foot .btn { width: 100%; min-height: 36px; }
  .product-media { aspect-ratio: 16 / 11; }
  .product-card h3 { min-height: 0; }
  .form-row, .contact-grid { grid-template-columns: 1fr; }
  .contact-cta { padding: 18px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .site-footer { padding-bottom: 92px; }
  .mobile-request { position: fixed; z-index: 25; right: 12px; bottom: 12px; left: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 9px 9px 13px; color: #fff; background: rgba(23, 35, 45, 0.96); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24); }
  .mobile-request span { display: grid; min-width: 0; }
  .mobile-request strong { font-size: 12px; }
  .mobile-request small { overflow: hidden; color: rgba(255, 255, 255, 0.65); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-request .btn { min-height: 38px; padding: 0 11px; font-size: 11px; }
  .detail { padding-bottom: 72px; }
  .product-detail { margin-top: 18px; }
  .detail-image { padding: 14px; }
  .detail-content h1 { margin-bottom: 17px; }
  .detail-lead { margin-bottom: 22px; }
  .spec-table { padding-inline: 14px; }
  .spec-row { grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr); gap: 12px; padding: 13px 0; }
  .related-products { margin-top: 42px; padding-top: 32px; }
  .related-products .section-heading { display: flex; align-items: center; }
  .related-products .product-grid { grid-template-columns: 1fr; }
  .info-hero { padding: 64px 0 46px; }
}

@media (max-width: 440px) {
  .brand span:last-child { max-width: 138px; }
  .footer-grid { grid-template-columns: 1fr; }
  .filters, .dynamic-filters { grid-template-columns: 1fr; }
  .filters h2, .filters .btn, .filters .filter-note { grid-column: auto; }
  .specs { grid-template-columns: 1fr; }
  .product-foot { align-items: stretch; flex-direction: column; }
  .product-foot .btn { width: 100%; }
  .related-products .section-heading { display: block; }
  .related-action { margin-top: 12px; }
}
