:root {
  --green: #2e7d32;
  --green-dark: #1b5e20;
  --bg: #f7f7f5;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e0e0e0;
}

* { box-sizing: border-box; }

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

header {
  background: var(--green-dark);
  color: white;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand .logo {
  height: 48px;
  width: 48px;
  object-fit: contain;
  background: white;
  border-radius: 8px;
  padding: 3px;
}

#cart-toggle {
  background: white;
  color: var(--green-dark);
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem;
}

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

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

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fafafa;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

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

.product-card h3 a {
  color: inherit;
  text-decoration: none;
}

.product-card h3 a:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

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

.product-card .price {
  font-weight: 700;
  color: var(--green-dark);
  margin: 0.5rem 0;
}

.add-to-cart {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.6rem;
  font-weight: 600;
  cursor: pointer;
}

.add-to-cart:hover { background: var(--green-dark); }

#cart-drawer {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  max-width: 90vw;
  height: 100%;
  background: white;
  box-shadow: -4px 0 16px rgba(0,0,0,0.15);
  transition: right 0.25s ease;
  padding: 1.25rem;
  overflow-y: auto;
  z-index: 100;
}

#cart-drawer.open { right: 0; }

#cart-drawer h2 {
  margin-top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#close-cart {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted);
}

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

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

.cart-line input[type="number"] {
  width: 48px;
  text-align: center;
}

.cart-line .remove {
  background: none;
  border: none;
  color: #c62828;
  cursor: pointer;
  font-size: 0.85rem;
}

#cart-totals {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
  font-size: 0.95rem;
}

#cart-totals .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

#cart-totals .row.grand {
  font-weight: 700;
  font-size: 1.05rem;
}

#paypal-button-container {
  margin-top: 1rem;
}

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

#cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  z-index: 99;
}

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