:root {
  --bg: #f2f0eb;
  --surface: #fffefa;
  --surface-strong: #f5f1e8;
  --ink: #171a1d;
  --muted: #667071;
  --line: #ded8ce;
  --accent: #2d7a34;
  --accent-strong: #1f5f28;
  --accent-soft: #dfeeda;
  --metal: #394143;
  --shadow: 0 22px 70px rgba(31, 38, 31, 0.12);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}
body.cart-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 12px clamp(16px, 4vw, 56px);
  background: rgba(255, 254, 250, 0.96);
  border-bottom: 1px solid rgba(222, 216, 206, 0.75);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}
.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 20px; line-height: 1; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 13px; }
.topbar__links {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}
.topbar__links a { text-decoration: none; }
.topbar__links a:hover { color: var(--ink); }
.cart-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ink), #2f3738);
  color: #fff;
}
.cart-chip__count {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(420px, 1.08fr);
  grid-template-rows: 1fr auto;
  gap: 28px;
  min-height: 500px;
  margin: 22px clamp(16px, 4vw, 56px) 0;
  padding: clamp(28px, 5vw, 62px);
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 78% 38%, rgba(189, 173, 78, 0.32), transparent 28%),
    linear-gradient(135deg, #162017, #3d4742);
  color: #fff;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 18, 16, 0.04) 0%, rgba(13, 18, 16, 0.18) 33%, rgba(16, 52, 27, 0.88) 58%, rgba(28, 112, 43, 0.96) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.28));
}
.hero__media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(32, 41, 33, 0.2), rgba(109, 122, 103, 0.08)),
    url("/img/hero-taiga-background.jpg");
  background-position: left center;
  background-repeat: no-repeat;
  background-size: cover;
  transform: scaleX(-1) scale(1.02);
}
.hero__content, .hero__stats { position: relative; z-index: 1; }
.hero__content {
  grid-column: 2;
  grid-row: 1;
  max-width: 700px;
  align-self: end;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.hero .eyebrow { color: #c9e7be; }
h1, h2, p { margin-top: 0; }
h1 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: clamp(44px, 9vw, 96px);
  line-height: 0.92;
}
.hero__copy {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.45;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.primary-link, .ghost-link, .primary-button, .order-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
}
.primary-link, .primary-button, .order-button { border: 0; background: var(--accent); color: #fff; }
.primary-link:hover, .primary-button:hover, .order-button:hover { background: var(--accent-strong); }
.ghost-link {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.hero__stats {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-self: end;
}
.hero__stats div {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}
.hero__stats dt { font-size: 30px; font-weight: 900; }
.hero__stats dd { margin: 4px 0 0; color: rgba(255, 255, 255, 0.72); }

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
  padding: 24px clamp(16px, 4vw, 56px) 48px;
}
.workspace > * { min-width: 0; }
.filters, .catalog-panel, .cart-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(31, 38, 31, 0.06);
}
.filters, .cart-panel { position: sticky; top: 92px; }
.filters, .catalog-panel, .cart-panel { padding: 20px; }
.panel-title, .catalog-toolbar, .cart-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.panel-title { margin-bottom: 18px; font-weight: 900; }
.panel-title button, .icon-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
}
.panel-title button { padding: 8px 10px; font-size: 13px; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.field input, .field select, .field textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.field input, .field select { height: 44px; padding: 0 12px; }
.field textarea { min-height: 90px; padding: 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 125, 50, 0.14);
}
.range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.contact-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}
.contact-strip a { text-decoration: none; }
.catalog-toolbar { margin-bottom: 18px; }
.catalog-toolbar h2, .cart-panel h2 { margin-bottom: 0; font-size: 24px; }
.result-count { margin: 0; color: var(--muted); font-weight: 700; }
.category-pills {
  display: flex;
  gap: 8px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.category-pill {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.category-pill.is-active { border-color: var(--accent); background: var(--accent); color: #fff; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.product-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.product-card:hover {
  border-color: rgba(45, 122, 52, 0.42);
  box-shadow: 0 16px 34px rgba(31, 38, 31, 0.1);
  transform: translateY(-2px);
}
.product-card__image {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid rgba(222, 216, 206, 0.75);
  background: #fff;
}
.product-card__image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: clamp(14px, 2.2vw, 24px);
  filter: drop-shadow(0 12px 18px rgba(23, 26, 29, 0.08));
  transition: transform 0.25s ease;
}
.product-card:hover .product-card__image img { transform: scale(1.035); }
.product-card__body { display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; padding: 18px; }
.product-card__category {
  min-width: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.product-card h3 { margin: 0; font-size: 18px; line-height: 1.28; }
.product-card h3,
.product-card p {
  min-width: 0;
  overflow-wrap: anywhere;
}
.product-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.product-card__foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: auto;
}
.price { font-size: 20px; font-weight: 900; }
.product-actions { display: inline-flex; gap: 8px; }
.secondary-button, .add-button { min-height: 40px; border-radius: 6px; font-weight: 800; }
.secondary-button { padding: 8px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.secondary-button:hover { border-color: var(--accent); color: var(--accent-strong); }
.add-button { width: 42px; border: 0; background: var(--accent); color: #fff; font-size: 20px; }
.add-button:hover { background: var(--accent-strong); }

.cart-panel { display: grid; max-height: calc(100vh - 112px); }
.cart-close { display: none; }
.icon-button { width: 38px; height: 38px; font-size: 25px; line-height: 1; }
.cart-list { display: grid; gap: 12px; min-height: 110px; max-height: 28vh; margin: 16px 0; overflow: auto; }
.cart-empty {
  display: grid;
  place-items: center;
  min-height: 100px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface-strong);
}
.cart-item h3 { margin: 0 0 8px; font-size: 14px; line-height: 1.25; }
.cart-item__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.qty button { width: 30px; height: 30px; border: 0; background: #fff; color: var(--ink); font-weight: 900; }
.qty span { min-width: 28px; text-align: center; font-size: 13px; font-weight: 800; }
.remove-button { border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.cart-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 2px solid var(--metal);
  font-size: 18px;
}
.checkout { overflow: auto; padding-right: 2px; }
.terms { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 14px; color: var(--muted); font-size: 14px; }
.terms a { color: var(--accent-strong); font-weight: 800; }
.order-button { width: 100%; }
.order-button:disabled { cursor: not-allowed; opacity: 0.58; }
.form-status { min-height: 22px; margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.35; }
.empty-state {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 260px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty-state strong { color: var(--ink); font-size: 22px; }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(16px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: #fff;
}
.footer strong, .footer span, .footer a { display: block; }
.footer span, .footer address { color: rgba(255, 255, 255, 0.72); }
.footer address { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; font-style: normal; }
.footer a { text-decoration: none; }

.cart-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(23, 26, 29, 0.46); }
.product-dialog {
  width: min(980px, calc(100vw - 30px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.product-dialog::backdrop { background: rgba(23, 26, 29, 0.58); }
.dialog-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.dialog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  min-height: min(620px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
}
.dialog-gallery {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  padding: 24px;
  background: var(--surface-strong);
}
.dialog-main-image {
  display: block;
  align-self: center;
  justify-self: center;
  width: 100%;
  height: clamp(320px, 54vh, 520px);
  max-height: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
  padding: clamp(16px, 2.8vw, 28px);
  filter: drop-shadow(0 18px 24px rgba(23, 26, 29, 0.08));
}
.dialog-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 88px;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}
.dialog-thumb-button {
  display: grid;
  place-items: center;
  width: 88px;
  height: 72px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.dialog-thumb-button.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 125, 50, 0.14);
}
.dialog-thumb-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 78px;
  max-height: 62px;
  object-fit: contain;
}
.dialog-content {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 0;
  padding: 56px 34px 34px;
  overflow: auto;
}
.dialog-content .eyebrow {
  max-width: calc(100% - 58px);
  line-height: 1.35;
}
.dialog-content h2 { margin: 0; font-size: 30px; line-height: 1.1; }
.dialog-content p { color: var(--muted); line-height: 1.55; }
.dialog-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.dialog-meta span { color: var(--muted); }

@media (max-width: 1220px) {
  .workspace { grid-template-columns: 260px minmax(0, 1fr); }
  .cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 60;
    width: min(420px, 100vw);
    height: 100vh;
    max-height: none;
    border-radius: 0;
    transform: translateX(104%);
    transition: transform 0.2s ease;
  }
  body.cart-open .cart-panel { transform: translateX(0); }
  .cart-close { display: inline-grid; }
  .cart-list { max-height: 30vh; }
}
@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar__links { display: none; }
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: auto;
    background:
      radial-gradient(circle at 80% 25%, rgba(189, 173, 78, 0.32), transparent 30%),
      linear-gradient(135deg, #162017, #3d4742);
  }
  .hero__media {
    background-position: 52% center;
    background-size: cover;
    opacity: 0.72;
  }
  .hero__content,
  .hero__stats {
    grid-column: 1;
  }
  .hero__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero__stats div {
    padding: 14px;
  }
  .hero__stats dt {
    font-size: 24px;
  }
  .workspace { grid-template-columns: 1fr; }
  .filters { position: static; }
  .product-grid { grid-template-columns: 1fr; }
  .dialog-layout { grid-template-columns: 1fr; }
  .dialog-layout { min-height: 0; overflow: auto; }
  .dialog-gallery { padding: 18px; }
  .dialog-main-image { height: min(330px, 52vh); }
  .dialog-content { padding: 24px; }
}
@media (max-width: 620px) {
  .topbar { padding: 10px 12px; }
  .brand small, .cart-chip span:not(.cart-chip__count) { display: none; }
  .hero { margin: 12px; padding: 26px; }
  h1 { font-size: 42px; }
  .hero__copy { font-size: 17px; }
  .hero__actions { display: grid; }
  .workspace { padding: 12px 12px 34px; }
  .catalog-toolbar { display: grid; }
  .product-card__foot { grid-template-columns: 1fr; }
  .product-actions { display: grid; grid-template-columns: 1fr 42px; }
  .footer { display: grid; }
}

@media (max-width: 480px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 8px 10px;
  }
  .brand { min-width: 0; gap: 8px; }
  .brand img {
    width: 44px;
    height: 44px;
  }
  .brand strong {
    max-width: 128px;
    overflow: hidden;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cart-chip {
    gap: 7px;
    min-height: 40px;
    padding: 7px 10px;
  }
  .cart-chip__count {
    min-width: 24px;
    height: 24px;
  }
  .cart-chip strong {
    max-width: 82px;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero {
    min-height: 520px;
    margin: 10px;
    padding: 22px;
  }
  .hero::after {
    background:
      linear-gradient(180deg, rgba(14, 47, 24, 0.94) 0%, rgba(16, 52, 27, 0.9) 58%, rgba(9, 16, 13, 0.72) 100%),
      linear-gradient(90deg, rgba(13, 18, 16, 0.42), rgba(13, 18, 16, 0.22));
  }
  .hero__media {
    background-position: 38% center;
    opacity: 0.52;
  }
  h1 {
    max-width: 100%;
    font-size: 38px;
    line-height: 0.98;
  }
  .hero__copy {
    max-width: 100%;
    font-size: 16px;
  }
  .hero__actions {
    gap: 10px;
    margin-top: 24px;
  }
  .primary-link,
  .ghost-link {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    text-align: center;
  }
  .hero__stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .hero__stats div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    min-height: 54px;
    padding: 11px 13px;
  }
  .hero__stats dt { font-size: 23px; }

  .workspace {
    gap: 12px;
    padding: 10px 10px 28px;
  }
  .filters,
  .catalog-panel {
    padding: 14px;
  }
  .panel-title { margin-bottom: 12px; }
  .range-fields { grid-template-columns: 1fr; gap: 0; }
  .contact-strip {
    align-items: center;
    margin-top: 4px;
    padding: 12px;
  }
  .catalog-toolbar {
    gap: 8px;
    margin-bottom: 14px;
  }
  .catalog-toolbar h2,
  .cart-panel h2 {
    font-size: 20px;
  }
  .result-count {
    font-size: 13px;
  }
  .category-pills {
    margin: 0 -14px 14px;
    padding: 0 14px 12px;
  }
  .category-pill {
    max-width: 82vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .product-grid { gap: 12px; }
  .product-card__image { aspect-ratio: 1.15 / 1; }
  .product-card__image img { padding: 12px; }
  .product-card__body {
    gap: 10px;
    padding: 14px;
  }
  .product-card h3 {
    font-size: 17px;
  }
  .product-card p {
    font-size: 13px;
  }
  .price { font-size: 19px; }
  .secondary-button,
  .add-button {
    min-height: 44px;
  }
  .add-button { width: 44px; }

  .cart-panel {
    width: 100vw;
    height: 100dvh;
    padding: 16px;
  }
  .cart-list {
    max-height: 26dvh;
    margin: 14px 0;
  }
  .checkout {
    max-height: 48dvh;
    overflow: auto;
  }
  .cart-item {
    grid-template-columns: 56px 1fr;
  }
  .cart-item img {
    width: 56px;
    height: 56px;
  }
  .cart-item__row {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }
  .dialog-layout {
    max-height: 100dvh;
  }
  .dialog-close {
    top: 10px;
    right: 10px;
  }
  .dialog-gallery {
    gap: 10px;
    padding: 14px;
  }
  .dialog-main-image {
    height: min(280px, 42dvh);
    padding: 12px;
  }
  .dialog-thumbs {
    grid-auto-columns: 76px;
  }
  .dialog-thumb-button {
    width: 76px;
    height: 62px;
  }
  .dialog-thumb-image {
    max-width: 66px;
    max-height: 52px;
  }
  .dialog-content {
    gap: 12px;
    padding: 18px;
  }
  .dialog-content .eyebrow {
    max-width: calc(100% - 48px);
    font-size: 11px;
  }
  .dialog-content h2 {
    font-size: 24px;
  }
  .dialog-content p {
    font-size: 14px;
    line-height: 1.48;
  }

  .footer {
    gap: 14px;
    padding: 22px 14px;
  }
  .footer address {
    display: grid;
    gap: 10px;
  }
}

@media (max-width: 360px) {
  .brand strong { max-width: 96px; }
  .cart-chip strong { display: none; }
  h1 { font-size: 34px; }
  .hero { padding: 18px; }
  .product-actions { grid-template-columns: minmax(0, 1fr) 44px; }
  .secondary-button { padding-inline: 8px; }
}
