:root {
  --ink: #221915;
  --muted: #6f6158;
  --line: #eadfd6;
  --paper: #fffaf4;
  --surface: #ffffff;
  --accent: #d53d2f;
  --accent-dark: #a62920;
  --matcha: #4b8f5a;
  --sky: #b9e4ef;
  --gold: #f2b84b;
  --shadow: 0 18px 50px rgba(74, 44, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

.site-header,
.site-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 22px 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(14px);
  background: rgba(255, 250, 244, 0.86);
  border-bottom: 1px solid rgba(234, 223, 214, 0.75);
}

.brand,
.nav-links,
.hero-actions,
.summary-row,
.product-action,
.quantity-form,
.tag-row {
  align-items: center;
  display: flex;
}

.brand {
  font-size: 1.05rem;
  font-weight: 800;
  gap: 10px;
}

.brand-mark {
  background: var(--accent);
  border-radius: 8px;
  color: white;
  display: grid;
  height: 34px;
  place-items: center;
  width: 34px;
}

.nav-links {
  gap: 18px;
  font-weight: 700;
}

.cart-pill {
  background: var(--ink);
  border-radius: 999px;
  color: white;
  display: inline-grid;
  font-size: 0.76rem;
  height: 24px;
  margin-left: 4px;
  min-width: 24px;
  padding: 0 7px;
  place-items: center;
}

main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 26px 24px 56px;
}

.hero {
  align-items: center;
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.84fr);
  min-height: clamp(520px, 76vh, 720px);
}

.hero-copy h1,
.page-heading h1,
.success h1 {
  font-size: clamp(3rem, 8vw, 6.6rem);
  letter-spacing: 0;
  line-height: 0.88;
  margin: 0;
  max-width: 840px;
}

.hero-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 620px;
}

.eyebrow,
.category {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

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

.hero-panel {
  background: linear-gradient(145deg, #fff 0%, #fff4e1 48%, #f9d8d3 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 430px;
  overflow: hidden;
}

.hero-panel img {
  height: 100%;
  min-height: 430px;
  object-fit: cover;
  width: 100%;
}

.button,
.icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.button {
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
}

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

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

.button.secondary {
  background: #f3e8dc;
  color: var(--ink);
}

.button.wide {
  width: 100%;
}

.toolbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(74, 44, 22, 0.07);
  margin: 10px 0 24px;
  padding: 18px;
}

.search-form {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 220px auto;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select {
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

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

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(74, 44, 22, 0.08);
  overflow: hidden;
}

.product-image {
  aspect-ratio: 1.22;
  background: #f9efe4;
  position: relative;
}

.product-image img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.badge {
  background: var(--ink);
  border-radius: 999px;
  color: white;
  font-size: 0.76rem;
  font-weight: 800;
  left: 14px;
  padding: 7px 10px;
  position: absolute;
  top: 14px;
}

.photo-credit {
  background: rgba(34, 25, 21, 0.76);
  border-radius: 999px;
  bottom: 12px;
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  left: 12px;
  max-width: calc(100% - 24px);
  overflow: hidden;
  padding: 6px 9px;
  position: absolute;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-info {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.product-info h2,
.cart-line h2,
.summary h2 {
  font-size: 1.1rem;
  line-height: 1.25;
  margin: 0;
}

.product-info p:not(.category),
.cart-line p,
.empty-state p,
.success p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.detail-list {
  color: var(--ink);
  display: grid;
  gap: 7px;
  line-height: 1.45;
  margin: 0;
  padding-left: 18px;
}

.detail-list li::marker {
  color: var(--accent);
}

.tag-row {
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.tag-row span {
  background: #f4eee6;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 9px;
}

.product-action {
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.product-action strong {
  font-size: 1.1rem;
}

.page-heading {
  margin: 36px 0 28px;
}

.page-heading h1,
.success h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
}

.cart-layout,
.checkout-layout {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.cart-lines,
.checkout-form,
.summary,
.success,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(74, 44, 22, 0.08);
}

.cart-lines {
  display: grid;
}

.cart-line {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: 94px minmax(0, 1fr) 130px 90px;
  padding: 18px;
}

.cart-line + .cart-line {
  border-top: 1px solid var(--line);
}

.cart-line img {
  aspect-ratio: 1;
  background: #f9efe4;
  border-radius: 8px;
  object-fit: cover;
}

.quantity-form {
  gap: 8px;
}

.quantity-form input {
  min-height: 40px;
  padding: 8px;
}

.icon-button {
  background: var(--ink);
  color: white;
  display: grid;
  flex: 0 0 40px;
  height: 40px;
  place-items: center;
  width: 40px;
}

.summary,
.checkout-form,
.success,
.empty-state {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.summary {
  position: sticky;
  top: 94px;
}

.summary-row {
  border-bottom: 1px solid var(--line);
  gap: 14px;
  justify-content: space-between;
  padding-bottom: 12px;
}

.summary-row.total {
  border-bottom: 0;
  font-size: 1.18rem;
  padding-top: 6px;
}

.shipping-note {
  background: #eef7ee;
  border: 1px solid #cde6d0;
  border-radius: 8px;
  color: #2f6d38;
  font-weight: 700;
  margin: 0;
  padding: 12px;
}

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

.checkout-form .wide {
  grid-column: 1 / -1;
}

.success {
  margin: 70px auto;
  max-width: 760px;
  text-align: center;
}

.success .button {
  justify-self: center;
}

.flash {
  background: var(--ink);
  border-radius: 8px;
  color: white;
  font-weight: 800;
  left: 50%;
  padding: 12px 18px;
  position: fixed;
  top: 86px;
  transform: translateX(-50%);
  transition: opacity 180ms ease;
  z-index: 10;
}

.flash.is-hidden {
  opacity: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  flex-wrap: wrap;
  font-size: 0.92rem;
  gap: 12px;
}

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

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

  .summary {
    position: static;
  }

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

  .cart-line {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .quantity-form,
  .cart-line > strong {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    gap: 16px;
  }

  .site-header,
  .site-footer,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-header,
  .search-form,
  .checkout-form {
    grid-template-columns: 1fr;
  }

  .site-header,
  .nav-links,
  .search-form {
    display: grid;
  }

  .nav-links {
    gap: 10px;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .hero-copy h1 {
    font-size: clamp(3rem, 18vw, 4.2rem);
  }

  .hero-panel,
  .hero-panel img {
    min-height: 300px;
  }

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

  .product-action {
    align-items: stretch;
    display: grid;
  }
}
