:root {
  --bg: #faf8f5;
  --text: #22201d;
  --muted: #6b655d;
  --accent: #2f6f4f;
  --accent-dark: #1f4d37;
  --border: #e3ddd3;
  --card-bg: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}

.brand h1 {
  margin: 0;
  font-size: 1.4rem;
}

.brand p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

#cart-toggle {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
}

#cart-toggle:hover {
  background: var(--accent-dark);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

#products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.product-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.product-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  flex-grow: 1;
}

.product-card .price {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.product-card button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

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

#cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(360px, 100%);
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  padding: 1.5rem;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  overflow-y: auto;
}

#cart-panel.open {
  transform: translateX(0);
}

#cart-panel h2 {
  margin-top: 0;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}

.cart-line .cart-line-name {
  font-size: 0.9rem;
}

.cart-line input[type="number"] {
  width: 3rem;
}

.cart-line button.remove {
  background: none;
  border: none;
  color: #b33;
  cursor: pointer;
}

#cart-total {
  margin: 1rem 0;
  font-weight: 600;
}

#checkout-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 1rem;
  cursor: pointer;
}

#checkout-btn:hover {
  background: var(--accent-dark);
}

#checkout-btn:disabled {
  background: var(--muted);
  cursor: not-allowed;
}

#cart-error {
  color: #b33;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

#cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: none;
}

#cart-overlay.open {
  display: block;
}

.empty-cart {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-page {
  max-width: 480px;
  margin: 4rem auto;
  text-align: center;
  padding: 0 1.5rem;
}

.status-page h1 {
  margin-bottom: 0.5rem;
}

.status-page a {
  color: var(--accent);
}
