:root {
  --bg: #f3efe6;
  --bg-deep: #e7e0d2;
  --ink: #1c1915;
  --muted: #6b645a;
  --card: #fffdf8;
  --line: #d4cbb8;
  --accent: #d35400;
  --accent-hover: #b34700;
  --danger: #9b2c2c;
  --shadow: 0 12px 40px rgba(28, 25, 21, 0.08);
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 1rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav a {
  color: var(--muted);
  font-weight: 600;
}

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-weight: 700;
}

.cart-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.35rem;
  text-align: center;
}

.hero {
  padding: 1.5rem 0 2rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.hero p {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-bottom: 3rem;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.product {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.product-visual {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  margin-bottom: 0.9rem;
  background:
    linear-gradient(145deg, var(--tone-a, #c8ddd4), var(--tone-b, #f0e6d2));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: rgba(28, 25, 21, 0.35);
}

.product h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.product .desc {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.price {
  font-weight: 700;
  font-size: 1.1rem;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--bg-deep);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #e7c3c3;
}

.panel {
  margin: 0.5rem 0 2.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.panel h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 2rem;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.cart-row:last-child {
  border-bottom: 0;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.qty button {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

@media (max-width: 700px) {
  .form-grid,
  .cart-row {
    grid-template-columns: 1fr;
  }
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

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

.error {
  color: var(--danger);
  margin: 0.75rem 0 0;
}

.status-card {
  display: grid;
  gap: 0.65rem;
}

.status-card code {
  font-size: 0.9rem;
  word-break: break-all;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s ease;
  pointer-events: none;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.footer-note {
  padding: 0 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}
