:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #121826;
  --muted: #667085;
  --line: #d9e0ea;
  --brand: #0f766e;
  --brand-dark: #0a5f59;
  --soft: #e9f6f4;
  --warn: #b42318;
  --ok: #067647;
  --shadow: 0 18px 46px rgba(17, 24, 39, .1);
}

* { box-sizing: border-box; }

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

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 22px;
  background: rgba(255, 255, 255, .95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}

.logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
}

.search input,
.selectors select,
.catalog-head select,
.drawer select,
.drawer input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search input:focus,
.selectors select:focus,
.catalog-head select:focus,
.drawer select:focus,
.drawer input:focus {
  border-color: #2a9d8f;
  box-shadow: 0 0 0 3px rgba(42, 157, 143, .14);
}

.selectors {
  display: grid;
  grid-template-columns: 150px 94px;
  gap: 10px;
}

main {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero {
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: end;
  padding: 30px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(15, 118, 110, .74), rgba(17, 24, 39, .68)),
    url("https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?auto=format&fit=crop&w=1400&q=80") center/cover;
  color: #fff;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hero h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 660px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, .88);
  font-size: 16px;
  line-height: 1.55;
}

.hero-panel {
  min-height: 104px;
  display: grid;
  align-content: center;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
  font-weight: 800;
}

.shop-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.filters,
.catalog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filters {
  align-self: start;
  overflow: hidden;
}

.filter-head,
.catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.filter-head h2,
.catalog-head h2 {
  margin: 0;
  font-size: 18px;
}

.catalog-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.filter-head button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.category-list {
  display: grid;
  gap: 4px;
  padding: 8px;
}

.category-button {
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: transparent;
  color: #344054;
  text-align: left;
}

.category-button.active {
  background: var(--soft);
  color: var(--brand-dark);
  font-weight: 900;
}

.category-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.catalog {
  min-width: 0;
  padding-bottom: 16px;
}

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

.product-card {
  min-height: 206px;
  display: grid;
  grid-template-rows: 88px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: #8ecdc5;
  box-shadow: var(--shadow);
}

.product-logo {
  display: grid;
  place-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(18, 24, 38, .08);
}

.product-logo img {
  max-width: 130px;
  max-height: 50px;
  object-fit: contain;
}

.product-info {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 13px;
}

.product-name {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 900;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 11px;
  font-weight: 800;
}

.tag.ok {
  background: #ecfdf3;
  color: var(--ok);
}

.tag.warn {
  background: #fff1f0;
  color: var(--warn);
}

.price-range {
  color: var(--muted);
  font-size: 13px;
}

.message,
.empty-state {
  margin: 16px;
  padding: 18px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  line-height: 1.5;
}

.empty-state {
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}

.drawer.open {
  pointer-events: auto;
  opacity: 1;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .38);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(520px, 100%);
  height: 100%;
  overflow: auto;
  padding: 22px;
  background: var(--surface);
  box-shadow: -18px 0 50px rgba(17, 24, 39, .18);
  transform: translateX(24px);
  transition: transform .18s ease;
}

.drawer.open .drawer-panel {
  transform: translateX(0);
}

.drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 24px;
  line-height: 1;
}

.detail-head {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-right: 34px;
}

.detail-logo {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-logo img {
  max-width: 66px;
  max-height: 52px;
  object-fit: contain;
}

.detail-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.detail-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.detail-section {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.detail-section h3 {
  margin: 0;
  font-size: 16px;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.info-box {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

.info-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.info-box b {
  display: block;
  margin-top: 5px;
  word-break: break-word;
}

.buy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-button {
  border: 0;
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

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

.help-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.rich-text {
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
}

.rich-text p {
  margin: 0;
}

@media (max-width: 920px) {
  .topbar,
  .hero,
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .selectors,
  .buy-row,
  .option-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 20px, 1280px);
    padding-top: 12px;
  }

  .topbar {
    padding: 12px;
  }

  .hero {
    padding: 22px;
  }

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