:root {
  --bg: #f3f6f4;
  --bg-accent: #e4efe8;
  --surface: #ffffff;
  --ink: #14241a;
  --muted: #5a6f62;
  --brand: #1b6b45;
  --brand-dark: #0f4730;
  --accent: #c4a35a;
  --danger: #a33b2c;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(20, 36, 26, 0.08);
  --font: "Segoe UI", "PT Sans", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d9ebe0 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #efe6c9 0%, transparent 50%),
    var(--bg);
}

body {
  padding-bottom: 32px;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

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

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

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(20, 36, 26, 0.12);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.cart-btn {
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink);
}

.search-section input {
  width: 100%;
  border: 1px solid #c9d7ce;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 1rem;
  background: var(--surface);
  outline: none;
}

.search-section input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(27, 107, 69, 0.15);
}

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

.product-list,
.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

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

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.price {
  font-weight: 700;
  color: var(--brand-dark);
  font-size: 1.05rem;
}

.stock-ok { color: var(--brand); }
.stock-out { color: var(--danger); }

.product-actions {
  display: flex;
  gap: 8px;
}

button.primary,
.product-actions button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button.primary:active,
.product-actions button:active {
  transform: scale(0.98);
}

button.primary:disabled,
.product-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cart-panel {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 22, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  z-index: 20;
  animation: fade 0.2s ease;
}

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

.cart-panel-inner {
  width: min(560px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 18px 18px 12px 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  animation: slide 0.28s ease;
}

@keyframes slide {
  from { transform: translateY(24px); }
  to { transform: none; }
}

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

.cart-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.linkish {
  border: none;
  background: none;
  color: var(--brand);
  cursor: pointer;
  font-size: 0.95rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #e4ebe6;
}

.cart-item button {
  border: none;
  background: #eef4f0;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}

.cart-total {
  font-size: 1.05rem;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.field input {
  border: 1px solid #c9d7ce;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  color: var(--ink);
}

.primary {
  width: 100%;
  margin-top: 4px;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.checkout-msg {
  padding: 10px;
  border-radius: 10px;
  background: var(--bg-accent);
  color: var(--brand-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
