:root {
  --green-950: #082e21;
  --green-900: #0b3d2c;
  --green-700: #166534;
  --green-100: #dcfce7;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --paper: #fbfaf7;
  --card: #ffffff;
  --ink: #1c1917;
  --muted: #6b7280;
  --line: #e7e5e4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.05), 0 10px 30px rgba(28, 25, 23, 0.06);
  --max: 1120px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--green-700);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--green-900);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(251, 250, 247, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green-900);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--green-900);
  color: #f7f3e8;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.04em;
}

.brand-name {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -0.01em;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.cart-button:hover {
  border-color: #d6d3d1;
}

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--green-900);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* Hero */
.hero {
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(255, 255, 255, 0.1), transparent 65%),
    radial-gradient(700px 380px at 95% 10%, rgba(180, 83, 9, 0.22), transparent 60%),
    var(--green-900);
  color: #f7f3e8;
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 9vw, 96px) clamp(16px, 4vw, 40px) clamp(56px, 9vw, 104px);
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c8e6d2;
}

.hero h1 {
  margin: 0;
  max-width: 15ch;
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.lede {
  margin: 20px 0 28px;
  max-width: 54ch;
  color: #d8e8dd;
  font-size: clamp(15px, 2vw, 17px);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: #f7f3e8;
  color: var(--green-950);
}

.button.primary:hover {
  background: #fff;
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.link-button {
  background: none;
  border: 0;
  padding: 4px 6px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.icon-button:hover {
  background: #f5f5f4;
  border-color: var(--line);
}

/* Catalog */
.catalog {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 64px) clamp(16px, 4vw, 40px) 72px;
}

.catalog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.catalog h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.01em;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search {
  flex: 1 1 240px;
  min-width: 200px;
}

.search input {
  width: min(260px, 70vw);
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.search input::placeholder {
  color: #a8a29e;
}

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

.chip {
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
}

.chip:hover {
  border-color: #d6d3d1;
}

.chip[aria-pressed="true"] {
  background: var(--green-900);
  border-color: var(--green-900);
  color: #fff;
}

.status {
  min-height: 24px;
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(14px, 2vw, 22px);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(28, 25, 23, 0.06), 0 16px 36px rgba(28, 25, 23, 0.09);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f3efe6;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(28, 25, 23, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge.low {
  background: var(--amber);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  padding: 14px 16px 16px;
}

.card-category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-name {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

.price {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.price small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
}

.add-button {
  padding: 9px 16px;
  border: 1px solid var(--green-900);
  border-radius: 999px;
  background: transparent;
  color: var(--green-900);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.add-button:hover:not(:disabled) {
  background: var(--green-900);
  color: #fff;
}

.add-button:disabled {
  border-color: var(--line);
  color: #a8a29e;
  cursor: not-allowed;
}

.empty {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px clamp(16px, 4vw, 40px) 48px;
  text-align: center;
  font-size: 14px;
}

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

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

/* Cart */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(12, 10, 9, 0.45);
  animation: fade 0.15s ease;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: 100dvh;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(28, 25, 23, 0.18);
  animation: slide-in 0.2s ease;
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.cart-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
}

.cart-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.cart-item img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #f3efe6;
}

.cart-item-name {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}

.cart-item-price {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.stepper button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.stepper button:hover {
  background: #f5f5f4;
}

.stepper span {
  min-width: 22px;
  text-align: center;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.remove-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.cart-empty {
  margin: 24px 0 8px;
  color: var(--muted);
  text-align: center;
}

.customer {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.form-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.customer label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}

.customer input,
.customer textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
}

.cart-foot {
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--card);
}

.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 15px;
}

.cart-total strong {
  font-size: 20px;
}

.button.checkout {
  width: 100%;
  background: var(--green-900);
  color: #fff;
}

.button.checkout:hover:not(:disabled) {
  background: var(--green-950);
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  top: 84px;
  z-index: 70;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--green-950);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: fade 0.15s ease;
}

@keyframes slide-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 560px) {
  .cart-panel {
    width: 100%;
    border-left: 0;
  }

  .catalog-head {
    align-items: stretch;
  }

  .toolbar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    flex: none;
    min-width: 0;
  }

  .search input {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
