:root {
  --ink: #202421;
  --muted: #65736c;
  --line: #dbe3dd;
  --paper: #fbfcfa;
  --panel: #ffffff;
  --accent: #216c5a;
  --accent-dark: #164c41;
  --accent-soft: #eef6f1;
  --copper: #b46a2e;
  --warm: #fff5ea;
  --shadow: 0 10px 28px rgba(33, 45, 39, .08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 252, 250, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 12px;
  display: grid;
  grid-template-columns: minmax(230px, auto) minmax(160px, 1fr) minmax(340px, auto);
  gap: 18px;
  align-items: center;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 110px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.brand span {
  font-size: 24px;
  line-height: 1.05;
  font-weight: 780;
}

.catalog-meta {
  display: grid;
  gap: 4px;
  justify-items: start;
  color: var(--muted);
  font-size: 13px;
}

.catalog-meta strong {
  color: var(--accent);
  font-size: 15px;
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: end;
}

.search-box {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.search-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.search-box input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.search-box input {
  width: min(370px, 38vw);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(33, 108, 90, .14);
}

.download-menu summary,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.download-menu {
  position: relative;
}

.download-menu summary {
  background: var(--accent);
  color: #fff;
  list-style: none;
}

.download-menu summary::-webkit-details-marker {
  display: none;
}

.download-menu summary::after {
  content: "8 files";
  margin-left: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1;
}

.download-menu summary:hover {
  background: var(--accent-dark);
}

.download-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(360px, 84vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(33, 45, 39, .16);
  padding: 7px;
  display: grid;
  gap: 2px;
}

.download-list a {
  min-height: 36px;
  border-radius: 6px;
  color: var(--ink);
  display: flex;
  align-items: center;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.25;
  text-decoration: none;
  white-space: normal;
}

.download-list a:first-child {
  color: var(--accent);
  background: var(--accent-soft);
}

.download-list a:hover {
  background: var(--warm);
}

.ghost-button {
  background: #fff;
  color: var(--accent);
}

.ghost-button:hover {
  background: var(--accent-soft);
}

.filterbar {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.filter-toggle {
  display: none;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 760;
  text-align: left;
  cursor: pointer;
}

.filter-toggle::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-weight: 800;
}

.filterbar.open .filter-toggle::after {
  content: "-";
}

.category-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.chip:hover,
.chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 24px 34px;
}

.result-strip {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-strip div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.result-strip strong {
  color: var(--accent);
  font-size: 15px;
}

.result-strip span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.factory-link {
  min-height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.factory-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: 232px 1fr;
}

.product-photo {
  width: 100%;
  height: 232px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbf8, #edf3ee);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.product-photo img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  display: block;
}

.no-photo {
  width: 112px;
  height: 112px;
  border: 1px dashed #cbd8d1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 255, 255, .55);
}

.product-body {
  min-width: 0;
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(42px, auto) minmax(34px, auto) auto 1fr;
  gap: 10px;
}

.sku {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.product-name {
  margin: 0;
  min-height: 42px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 760;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-path {
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quick-specs {
  min-height: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  max-width: 100%;
  border: 1px solid #ead7c5;
  border-radius: 999px;
  background: var(--warm);
  color: #60422c;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spec-details {
  margin-top: 2px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.spec-details summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
  list-style-position: inside;
}

.spec-list {
  margin-top: 8px;
  display: grid;
  gap: 0;
}

.spec-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid #edf1ed;
  padding: 6px 0;
  font-size: 12px;
  line-height: 1.35;
}

.spec-row b {
  color: #59645d;
  font-weight: 680;
}

.spec-row span {
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spec-details[open] .spec-row span {
  display: block;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 220px;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.factory-section {
  margin: 0 0 24px;
  padding: 20px 0 28px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 150px;
}

.factory-hero {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  min-height: 560px;
  padding: 30px;
  margin-bottom: 18px;
  background:
    linear-gradient(90deg, rgba(8, 35, 29, .56), rgba(8, 35, 29, .18), rgba(8, 35, 29, .02)),
    url("factory/factory-gate.webp") 56% bottom / cover no-repeat;
}

.factory-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(251, 252, 250, .2));
  pointer-events: none;
}

.factory-hero > * {
  position: relative;
  z-index: 1;
}

.factory-copy-panel {
  max-width: 520px;
  min-height: 500px;
  border-radius: 8px;
  background: rgba(8, 35, 29, .82);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .24);
  padding: 24px;
  backdrop-filter: blur(3px);
}

.section-heading {
  max-width: 820px;
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.factory-hero .section-heading {
  max-width: 680px;
}

.section-heading span {
  color: var(--copper);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.section-heading h2 {
  margin: 0;
  color: var(--accent);
  font-size: 30px;
  line-height: 1.12;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.factory-hero .section-heading span,
.factory-hero .section-heading h2,
.factory-hero .section-heading p {
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .32);
}

.factory-hero .section-heading h2 {
  font-size: 36px;
}

.factory-profile {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(310px, .85fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.profile-facts,
.capability-panel,
.factory-card,
.certificate-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.profile-facts {
  margin: 0;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.profile-facts div {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  font-size: 14px;
  line-height: 1.4;
}

.profile-facts dt {
  color: var(--accent);
  font-weight: 800;
}

.profile-facts dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.capability-panel {
  padding: 18px 20px;
  background: var(--accent-soft);
}

.factory-hero .profile-facts,
.factory-hero .capability-panel {
  background: rgba(255, 255, 255, .9);
  border-color: rgba(255, 255, 255, .45);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
  backdrop-filter: blur(4px);
}

.factory-hero .factory-profile {
  max-width: none;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 0;
}

.capability-panel h3 {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 22px;
  line-height: 1.2;
}

.capability-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.38;
}

.factory-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.factory-card {
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 170px auto auto 1fr;
}

.factory-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line);
  background: #f8fbf8;
}

.factory-card span,
.factory-card h3,
.factory-card p {
  margin-left: 14px;
  margin-right: 14px;
}

.factory-card span {
  margin-top: 13px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
}

.factory-card h3 {
  margin-top: 5px;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.25;
}

.factory-card p {
  margin-top: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.certificate-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.certificate-card {
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.certificate-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  display: block;
  background: #fff;
}

.certificate-card h3 {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .header-actions {
    justify-content: stretch;
    align-items: stretch;
  }

  .search-box {
    flex: 1 1 auto;
  }

  .search-box input {
    width: 100%;
  }

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

  .factory-profile,
  .factory-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .certificate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar,
  .filterbar,
  main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand img {
    width: 98px;
    height: 40px;
  }

  .brand span {
    font-size: 20px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .download-menu summary {
    width: 100%;
  }

  .download-list {
    left: 0;
    right: auto;
    width: 100%;
  }

  .filter-toggle {
    display: block;
  }

  .category-menu {
    display: none;
  }

  .filterbar.open .category-menu {
    display: flex;
  }

  .result-strip {
    align-items: stretch;
    display: grid;
  }

  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
  }

  .section-heading h2 {
    font-size: 24px;
  }

  .factory-profile,
  .factory-card-grid,
  .certificate-grid {
    grid-template-columns: 1fr;
  }

  .profile-facts div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
