:root {
  --bg: #fffaf2;
  --surface: #ffffff;
  --text: #21170f;
  --muted: #765f4b;
  --line: #eadbc8;
  --accent: #7a3f18;
  --accent-2: #c98a3a;
  --dark: #2b170d;
  --shadow: 0 18px 50px rgba(76, 45, 24, 0.12);
}

* {
  box-sizing: border-box;
}

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

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

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

.site-header,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--dark);
  color: #fff4df;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav a {
  padding: 8px 0;
}

.cart-link span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  margin-left: 5px;
  place-items: center;
  border-radius: 99px;
  background: var(--accent);
  color: white;
  font-size: 12px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: 56px;
  padding: 48px 0 64px;
}

.hero h1,
.simple-page h1,
.cart-page h1,
.detail h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.hero p,
.cart-page > div > p,
.lead,
.simple-page p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: white;
}

.button.ghost {
  border-color: var(--line);
  color: var(--text);
}

.button.small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.button.wide {
  width: 100%;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #fff 0%, #f4e4cf 100%);
  box-shadow: var(--shadow);
}

.hero-panel img {
  width: 100%;
  height: 420px;
  object-fit: contain;
  padding: 42px;
}

.hero-panel div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.hero-panel span,
.category {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: 34px 0 18px;
  border-top: 1px solid var(--line);
}

.toolbar h2 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.03em;
}

.toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.search {
  display: flex;
  gap: 8px;
}

.search input,
.checkout input,
.checkout textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.chip.active {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}

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

.product-card,
.cart-box,
.checkout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(76, 45, 24, 0.07);
}

.product-media {
  display: grid;
  min-height: 240px;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: #f9efe1;
}

.product-media img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  padding: 20px;
}

.product-info {
  padding: 18px;
}

.product-info h3 {
  min-height: 74px;
  margin: 7px 0 8px;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.product-info p:not(.category) {
  min-height: 66px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.product-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.product-bottom strong,
.price-line strong,
.cart-total strong {
  color: var(--dark);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 46px;
  padding: 56px 0 82px;
}

.gallery {
  display: grid;
  gap: 14px;
}

.gallery img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 28px;
}

.detail-copy {
  position: sticky;
  top: 24px;
  align-self: start;
}

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 28px 0 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.price-line span {
  color: #187044;
  font-weight: 800;
}

.attributes {
  padding: 0;
  margin: 22px 0;
  list-style: none;
}

.attributes li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.attributes span,
.cart-line span {
  color: var(--muted);
}

.description {
  margin-top: 26px;
}

.description h2,
.checkout h2 {
  margin: 0 0 12px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.cart-page,
.simple-page {
  padding: 54px 0 90px;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 22px;
  align-items: start;
  margin-top: 30px;
}

.cart-box,
.checkout {
  padding: 22px;
}

.cart-line {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 8px;
  background: #f9efe1;
  padding: 8px;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.qty button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  cursor: pointer;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  padding-top: 18px;
}

.checkout {
  display: grid;
  gap: 14px;
}

.checkout label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--accent);
  font-weight: 800;
}

.empty {
  grid-column: 1 / -1;
  color: var(--muted);
}

.simple-page {
  max-width: 760px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  max-width: 520px;
  margin: 6px 0 0;
}

@media (max-width: 900px) {
  .site-header,
  .site-footer,
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero,
  .detail,
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 28px;
    min-height: 0;
    padding-top: 28px;
  }

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

  .detail-copy {
    position: static;
  }
}

@media (max-width: 560px) {
  .hero h1,
  .simple-page h1,
  .cart-page h1,
  .detail h1 {
    font-size: 40px;
  }

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

  .toolbar,
  .search,
  .product-bottom,
  .price-line,
  .cart-line {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    display: grid;
    width: 100%;
  }

  .cart-line {
    grid-template-columns: 1fr;
  }
}
