:root {
  --ink: #111827;
  --muted: #5d6675;
  --line: #d5dbe5;
  --soft: #eef2f6;
  --surface: #ffffff;
  --navy: #101828;
  --navy-2: #172033;
  --teal: #008f7e;
  --blue: #2563eb;
  --amber: #f5a623;
  --red: #d8342a;
  --green-soft: #e7f8f4;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #e9edf3;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

img {
  display: block;
  width: 100%;
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  width: 100%;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 48px);
  color: #fff;
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  font-size: 14px;
}

.sidebar nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 0;
  overflow-x: auto;
}

.sidebar nav a {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 700;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-panel {
  max-width: 250px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-panel p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

main {
  margin-left: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.72fr);
  gap: clamp(18px, 4vw, 38px);
  align-items: center;
  min-height: auto;
  padding: clamp(28px, 5vw, 58px) clamp(16px, 4vw, 48px);
  background: linear-gradient(135deg, #ffffff 0%, #f7fafc 58%, #e8f7f3 100%);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.workflow h2 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(36px, 5.5vw, 74px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions,
.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.primary-action,
.secondary-action,
.ghost-button,
.chip,
.fit-button {
  min-height: 42px;
  border-radius: 8px;
  cursor: pointer;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 0;
  font-weight: 900;
}

.primary-action {
  color: #fff;
  background: var(--teal);
}

.secondary-action {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.secondary-action.dark-text {
  border: 1px solid var(--line);
  background: #fff;
}

.hero-feature {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-feature img {
  height: 300px;
  object-fit: cover;
}

.feature-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.feature-metrics div {
  padding: 15px;
  border-right: 1px solid var(--line);
}

.feature-metrics div:last-child {
  border-right: 0;
}

.feature-metrics span {
  display: block;
  font-size: 22px;
  font-weight: 900;
}

.feature-metrics small {
  color: var(--muted);
}

.sync-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: #fff8e6;
}

.sync-panel h2 {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 32px);
}

.sync-panel p:last-child {
  margin: 5px 0 0;
  color: #66501f;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.toolbar {
  position: sticky;
  top: 72px;
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--navy-2);
}

.search-wrap,
.select-wrap {
  display: grid;
  gap: 6px;
}

label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.filters label {
  color: var(--muted);
}

input[type="search"],
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
}

input[type="search"] {
  border-color: #f3b13f;
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.18);
}

.category-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px clamp(16px, 4vw, 48px) 0;
  background: #e9edf3;
}

.chip,
.fit-button,
.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.chip {
  flex: 0 0 auto;
  padding: 0 14px;
  font-weight: 800;
}

.chip.active,
.fit-button.active {
  border-color: var(--navy);
  color: #fff;
  background: var(--navy);
}

.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  padding: 18px clamp(16px, 4vw, 48px) 64px;
}

.filters,
.catalog,
.workflow {
  min-width: 0;
}

.filters {
  position: sticky;
  top: 158px;
  align-self: start;
}

.filter-block {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.filter-block h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 11px 0;
  color: var(--ink);
  text-transform: none;
  font-size: 14px;
}

.check-row input {
  width: 18px;
  height: 18px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.filter-block p {
  margin: 10px 0 0;
  color: var(--muted);
}

.fit-button {
  width: 100%;
  margin: 6px 0;
  padding: 0 12px;
  text-align: left;
}

.catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.catalog-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}

.catalog .eyebrow {
  color: var(--red);
}

.ghost-button {
  padding: 0 14px;
  font-weight: 800;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
}

.product-card img {
  height: 214px;
  padding: 12px;
  object-fit: contain;
  background: #f8fafc;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px;
}

.product-top {
  display: grid;
  gap: 9px;
}

.product-card h3 {
  display: -webkit-box;
  min-height: 44px;
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.badge {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #855300;
  background: #fff0c9;
  font-size: 12px;
  font-weight: 900;
}

.badge.hot {
  color: #9f1d15;
  background: #ffe8e5;
}

.product-description {
  display: -webkit-box;
  min-height: 38px;
  margin: 8px 0 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta-line {
  display: grid;
  gap: 3px;
  min-height: 36px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.metric-row div {
  padding: 8px 7px;
  border-radius: 8px;
  background: var(--soft);
}

.metric-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-row strong {
  display: block;
  margin-top: 1px;
  font-size: 14px;
}

.metric-row div:last-child {
  background: var(--green-soft);
}

.metric-row div:last-child strong {
  color: var(--teal);
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.product-actions button {
  min-height: 39px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.details-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.apply-button {
  border: 0;
  color: #111827;
  background: var(--amber);
}

.apply-button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: var(--soft);
}

.empty-state {
  display: none;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.workflow {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 30px;
  padding: 70px clamp(16px, 4vw, 48px);
  color: #fff;
  background: var(--navy);
}

.workflow h2 {
  font-size: clamp(34px, 5vw, 60px);
}

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

.workflow-steps article {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.workflow-steps span {
  color: var(--amber);
  font-weight: 900;
}

.workflow-steps h3 {
  margin: 12px 0 6px;
}

.workflow-steps p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.drawer-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  background: rgba(8, 13, 20, 0.46);
}

.product-drawer {
  position: fixed;
  z-index: 31;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(500px, 100vw);
  overflow-y: auto;
  background: #fff;
  box-shadow: -18px 0 50px rgba(16, 22, 33, 0.18);
}

.drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font-size: 26px;
  cursor: pointer;
}

.product-drawer img {
  height: 310px;
  padding: 18px;
  object-fit: contain;
  background: #f8fafc;
}

.drawer-body {
  padding: 24px;
}

.drawer-body h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.16;
}

.drawer-body p {
  color: var(--muted);
  white-space: pre-line;
}

.drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 0;
}

.drawer-stats div {
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
}

.drawer-stats dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.drawer-stats dd {
  margin: 4px 0 0;
  font-weight: 900;
}

@media (max-width: 1280px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .sidebar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sidebar nav {
    justify-content: flex-start;
  }

  .sidebar-panel {
    max-width: none;
  }

  .toolbar {
    top: 156px;
  }

  .hero,
  .sync-panel,
  .toolbar,
  .layout,
  .workflow {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .filter-block {
    margin-bottom: 0;
  }
}

@media (max-width: 720px) {
  .sidebar {
    position: static;
    padding: 12px 14px;
  }

  .toolbar {
    position: static;
  }

  .hero,
  .layout,
  .workflow,
  .toolbar,
  .category-row,
  .sync-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero p {
    font-size: 16px;
  }

  .hero-feature img {
    height: 230px;
  }

  .filters,
  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card img {
    height: 168px;
  }

  .product-body {
    padding: 10px;
  }

  .metric-row,
  .drawer-stats {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 440px) {
  .brand span:last-child {
    font-size: 18px;
  }

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