:root {
  color-scheme: light;
  --ink: #171514;
  --muted: #6f6862;
  --line: #ded6cf;
  --paper: #fbfaf7;
  --white: #ffffff;
  --clay: #b65f3f;
  --clay-dark: #7f3a25;
  --moss: #5e6d45;
  --blue: #24495c;
  --shadow: 0 18px 45px rgba(43, 34, 28, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(251, 250, 247, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 8px;
  font-weight: 800;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
  color: var(--muted);
  font-weight: 700;
}

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

.cart-button,
.primary-button,
.secondary-button,
.primary-link,
.secondary-link,
.filter,
.icon-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  color: var(--white);
  background: var(--blue);
}

.cart-button span {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink);
  background: var(--white);
  border-radius: 999px;
  font-size: 13px;
}

.hero {
  min-height: calc(100vh - 73px);
  display: grid;
  align-items: end;
  padding: clamp(28px, 7vw, 84px);
  background:
    linear-gradient(90deg, rgba(23, 21, 20, 0.82), rgba(23, 21, 20, 0.34), rgba(23, 21, 20, 0.08)),
    url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1800&q=85") center / cover;
}

.hero-copy {
  width: min(680px, 100%);
  color: var(--white);
  padding-bottom: 4vh;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--clay);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f0c6a7;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 11ch;
  margin-bottom: 18px;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.hero p:not(.eyebrow),
.section-heading p,
.order-band p {
  color: inherit;
  max-width: 650px;
  font-size: 18px;
  line-height: 1.55;
}

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

.primary-link,
.secondary-link,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.primary-link,
.primary-button {
  color: var(--white);
  background: var(--clay);
}

.primary-link:hover,
.primary-button:hover {
  background: var(--clay-dark);
}

.secondary-link,
.secondary-button {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

.section {
  padding: clamp(42px, 8vw, 88px) clamp(18px, 4vw, 54px);
}

.section-heading {
  margin-bottom: 24px;
}

.pricing-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 980px;
  margin-top: 18px;
}

.pricing-rules span {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 13px;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

.pricing-rules strong {
  color: var(--ink);
  margin-left: 4px;
}

.selection-summary {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  margin-top: 12px;
  padding: 0 14px;
  color: var(--white);
  background: var(--blue);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
}

.selection-summary strong {
  margin: 0 4px;
}

.section-heading.compact h2 {
  font-size: 30px;
}

.catalog-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter {
  padding: 0 15px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

.filter.active {
  color: var(--white);
  background: var(--moss);
  border-color: var(--moss);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 22px;
}

.product-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-image-button {
  display: block;
  width: 100%;
  padding: 0;
  background: #eee8df;
  border: 0;
  cursor: zoom-in;
}

.product-image-button img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: #eee8df;
}

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

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.product-meta h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.1;
}

.product-meta strong {
  white-space: nowrap;
  color: var(--clay-dark);
  font-size: 18px;
}

.product-card p {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.product-card-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.add-cart-button {
  grid-column: 1 / -1;
  width: 100%;
}

.pack-badge {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--blue);
  background: #e8f4f6;
  border: 1px solid #c7e3e8;
  border-radius: 8px;
  font-weight: 900;
}

.product-quantity {
  display: grid;
  grid-template-columns: 42px 48px 42px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.product-quantity button {
  width: 42px;
  height: 42px;
  border: 0;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.product-quantity button:hover {
  background: var(--paper);
}

.product-quantity strong {
  display: grid;
  height: 42px;
  place-items: center;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-size: 17px;
}

select {
  min-height: 44px;
  padding: 0 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.order-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(34px, 6vw, 62px) clamp(18px, 4vw, 54px);
  color: var(--white);
  background: var(--blue);
}

.order-band .eyebrow {
  color: #b9d4df;
}

.order-band p {
  color: #e7eef1;
  margin-bottom: 0;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.account-panel {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 12px;
}

textarea {
  resize: vertical;
}

.hidden {
  display: none !important;
}

.logged-in {
  display: grid;
  gap: 14px;
}

.history-empty {
  color: var(--muted);
  line-height: 1.5;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.history-item strong,
.history-item span {
  display: block;
}

.history-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  justify-content: flex-end;
  background: rgba(23, 21, 20, 0.42);
}

.drawer.open {
  display: flex;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 34px);
  background: rgba(10, 12, 14, 0.86);
}

.image-viewer.open {
  display: flex;
}

.image-viewer-panel {
  width: min(100%, 1280px);
  max-height: 94vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.image-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--white);
}

.image-viewer-header h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 34px);
}

.image-viewer img {
  display: block;
  width: 100%;
  max-height: calc(94vh - 72px);
  object-fit: contain;
  background: #111;
  border-radius: 8px;
}

.drawer-panel {
  width: min(520px, 100%);
  height: 100%;
  overflow: auto;
  padding: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.icon-button {
  width: 44px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 28px;
  line-height: 1;
}

.cart-items {
  display: grid;
  gap: 12px;
}

.cart-empty {
  color: var(--muted);
  padding: 18px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cart-item img {
  width: 72px;
  height: 84px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.cart-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.cart-breakdown {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cart-breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.cart-breakdown strong {
  color: var(--ink);
  white-space: nowrap;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
  font-weight: 900;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 20px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%) translateY(20px);
  max-width: min(92vw, 520px);
  padding: 13px 16px;
  color: var(--white);
  background: var(--ink);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 780px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .brand {
    min-width: 0;
  }

  .hero {
    min-height: 690px;
    padding-top: 74px;
  }

  h1 {
    font-size: 48px;
  }

  .order-band,
  .account-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 62px 1fr;
  }

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

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

  .product-quantity button,
  .product-quantity strong {
    width: 100%;
  }

  .cart-item img {
    width: 62px;
    height: 74px;
  }

  .quantity-controls {
    grid-column: 2;
  }
}
