:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --ink: #151515;
  --muted: #6f6f6f;
  --line: #deded9;
  --accent: #d64242;
  --accent-dark: #9f2525;
  --soft: #eeeeee;
  --radius: 8px;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

button,
input,
select {
  font: inherit;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.top-nav {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a:hover {
  color: var(--ink);
}

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(580px, calc(100vh - 64px));
  padding: 52px 32px;
  background:
    linear-gradient(90deg, rgb(247 247 247 / 0.98) 0%, rgb(247 247 247 / 0.88) 34%, rgb(247 247 247 / 0.22) 70%),
    linear-gradient(0deg, rgb(0 0 0 / 0.10), rgb(0 0 0 / 0.02)),
    url("https://images.unsplash.com/photo-1620751852890-a89137ec78b9?auto=format&fit=crop&w=1800&q=82");
  background-position: center, center, center 58%;
  background-size: cover;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 1220px);
  max-width: 560px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 460px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

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

.hero-note {
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  background: rgb(255 255 255 / 0.74);
  color: var(--ink);
  padding: 0 16px;
}

.hero-stats {
  display: flex;
  gap: 28px;
  margin: 34px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid rgb(21 21 21 / 0.16);
}

.hero-stats div {
  display: grid;
  gap: 2px;
}

.hero-stats dt {
  font-size: 22px;
  font-weight: 700;
}

.hero-stats dd {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 56px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 32px;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner p {
  margin: 0;
}

.footer-brand {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

.footer-contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
}

.footer-contacts a {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.footer-contacts a:hover {
  color: var(--accent-dark);
}

.toolbar {
  display: grid;
  gap: 18px;
  padding: 18px 0 22px;
}

.summary {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.summary span:first-child {
  color: var(--ink);
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px;
  gap: 12px;
}

.search-box,
.select-box {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.search-box input,
.select-box select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-button,
.link-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
}

.tab-button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}

.filters {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 22px;
  padding-top: 6px;
}

.filter-block {
  display: grid;
  gap: 12px;
}

.filter-block h2 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.checkbox-list {
  display: grid;
  gap: 10px;
}

.checkbox-list label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.checkbox-list input {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--surface);
}

.swatch.active {
  border: 2px solid var(--ink);
}

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

.product-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.product-image {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--soft);
  cursor: pointer;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 180ms ease;
}

.product-card:hover img {
  transform: scale(1.025);
}

.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

.product-meta {
  display: grid;
  gap: 6px;
}

.product-name {
  min-height: 40px;
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.product-facts {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.price-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-weight: 700;
}

.price-row del {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--ink);
  padding: 0 14px;
  cursor: pointer;
}

.primary-button {
  background: var(--ink);
  color: var(--surface);
}

.ghost-button {
  background: var(--surface);
  color: var(--ink);
}

.empty-state {
  margin: 40px 0;
  color: var(--muted);
}

.product-dialog {
  width: min(980px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
}

.product-dialog::backdrop {
  background: rgb(0 0 0 / 0.42);
}

.dialog-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  background: var(--surface);
  font-size: 28px;
  cursor: pointer;
  z-index: 2;
}

.dialog-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(300px, 1.05fr);
  gap: 28px;
  padding: 28px;
}

.dialog-gallery {
  display: grid;
  gap: 10px;
}

.dialog-gallery > img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--soft);
}

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

.thumbs button {
  border: 1px solid var(--line);
  padding: 0;
  background: var(--surface);
  aspect-ratio: 1;
  cursor: pointer;
  overflow: hidden;
}

.thumbs button.active {
  border-color: var(--ink);
}

.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dialog-info {
  display: grid;
  align-content: start;
  gap: 16px;
  padding-right: 24px;
}

.dialog-info h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.price-line {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 24px;
  font-weight: 700;
}

.price-line del {
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
}

.specs {
  display: grid;
  grid-template-columns: minmax(120px, 0.5fr) 1fr;
  gap: 10px 14px;
  margin: 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.specs dt {
  color: var(--muted);
}

.specs dd {
  margin: 0;
}

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

@media (max-width: 820px) {
  .brand-bar {
    padding: 0 18px;
  }

  .top-nav {
    gap: 14px;
  }

  .hero {
    min-height: 560px;
    padding: 42px 18px;
    background:
      linear-gradient(0deg, rgb(247 247 247 / 0.98) 0%, rgb(247 247 247 / 0.90) 45%, rgb(247 247 247 / 0.18) 100%),
      url("https://images.unsplash.com/photo-1620751852890-a89137ec78b9?auto=format&fit=crop&w=1200&q=82");
    background-position: center 52%;
    background-size: cover;
  }

  main {
    padding: 18px 18px 44px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px 18px;
  }

  .footer-contacts {
    justify-content: flex-start;
  }

  .controls,
  .catalog-layout,
  .dialog-layout {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

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

  .dialog-info {
    padding-right: 0;
  }
}

@media (max-width: 520px) {
  .brand-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: 700px;
    padding: 32px 18px 36px;
    background-position: 56% bottom;
  }

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

  .hero-copy > p:not(.eyebrow) {
    font-size: 15px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-actions .primary-button,
  .hero-actions .secondary-button {
    width: 100%;
  }

  .hero-note {
    font-size: 13px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 24px;
  }

  .hero-stats dt {
    font-size: 19px;
  }

  .hero-stats dd {
    font-size: 12px;
  }

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

  .product-card {
    gap: 8px;
  }

  .product-name {
    min-height: 34px;
    font-size: 13px;
    line-height: 1.3;
  }

  .product-facts {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .price-row {
    flex-wrap: wrap;
    gap: 2px 6px;
    font-size: 14px;
  }

  .price-row del {
    font-size: 12px;
  }

  .card-actions {
    grid-template-columns: 1fr 36px;
    gap: 6px;
  }

  .primary-button,
  .ghost-button {
    min-height: 36px;
    padding: 0 8px;
    font-size: 13px;
  }

  .product-dialog {
    width: 100vw;
    max-width: none;
  }

  .dialog-layout {
    padding: 18px;
  }
}
