:root {
  --bg: #f6f4f0;
  --ink: #1f1c18;
  --muted: #6b655c;
  --card: #fffdf9;
  --line: #e6e0d6;
  --accent: #2f5d50;
  --accent-hover: #254a40;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar,
.hero,
.products,
.drawer-panel {
  font-family: "Segoe UI", system-ui, sans-serif;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 8%;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
}

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

.cart-button,
.buy-button,
.qty button,
.product-card button,
.drawer-header button {
  cursor: pointer;
  border: 0;
}

.cart-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: white;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
}

.cart-count {
  background: white;
  color: var(--ink);
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.hero {
  padding: 48px 8% 16px;
  max-width: 720px;
}

.hero h1 {
  font-family: Georgia, serif;
  font-weight: 500;
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 12px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 32px 8% 80px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-photo {
  height: 160px;
  display: grid;
  place-items: center;
  font-size: 48px;
}

.product-card h2 {
  font-size: 18px;
  margin: 0;
  padding: 16px 16px 4px;
}

.product-card p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 14px;
  min-height: 42px;
}

.product-card footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 16px;
}

.price {
  font-weight: 700;
}

.product-card button {
  background: var(--accent);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.product-card button:hover {
  background: var(--accent-hover);
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(31, 28, 24, 0.35);
  z-index: 20;
}

.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(420px, 100%);
  background: var(--card);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h2 {
  margin: 0;
  font-size: 22px;
}

.drawer-header button {
  background: transparent;
  font-size: 20px;
  color: var(--muted);
}

.cart-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  overflow: auto;
  flex: 1;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item strong {
  display: block;
}

.cart-item span {
  color: var(--muted);
  font-size: 13px;
}

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

.qty button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg);
}

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

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

.total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.buy-button {
  width: 100%;
  background: var(--accent);
  color: white;
  padding: 14px;
  border-radius: 10px;
  font-size: 16px;
}

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

.buy-button:not(:disabled):hover {
  background: var(--accent-hover);
}
