:root {
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --border: #e3e3e3;
  --accent: #111111;
  --accent-contrast: #ffffff;
  --success-bg: #e7f6ec;
  --success-text: #1e6b3c;
  --error-bg: #fdeaea;
  --error-text: #a5271c;
  --radius: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #fafafa;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.site-header { border-bottom: 1px solid var(--border); background: #fff; }
.header-inner { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
.logo { font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; }
.site-header nav a { margin-left: 20px; color: var(--ink); text-decoration: none; font-size: 15px; }
.site-header nav a:hover { text-decoration: underline; }

.main-content { padding: 32px 20px 60px; min-height: 60vh; }
.page-title { font-size: 28px; margin-bottom: 24px; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; font-size: 14px; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.product-card { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s; }
.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.product-card-img { aspect-ratio: 1/1; background: #f1f1f1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.no-image { color: var(--muted); font-size: 13px; }
.no-image.large { width: 100%; height: 100%; min-height: 300px; display: flex; align-items: center; justify-content: center; background: #f1f1f1; border-radius: var(--radius); }
.product-card-body { padding: 14px; }
.product-card-body h3 { margin: 0 0 6px; font-size: 16px; }
.price { font-weight: 600; margin: 0; }
.out-of-stock { color: var(--muted); font-size: 13px; margin-top: 4px; }

.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.product-detail-img img { width: 100%; border-radius: var(--radius); }
.product-detail-body h1 { margin-top: 0; }
.description { color: #333; white-space: pre-line; }
.add-to-cart-form { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin-top: 20px; }
.add-to-cart-form label { font-size: 13px; font-weight: 600; }
.add-to-cart-form select, .add-to-cart-form input[type=number] { padding: 8px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 14px; }

.btn { display: inline-block; padding: 12px 20px; border-radius: var(--radius); border: none; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { opacity: 0.9; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--error-text); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 0; }

.cart-table { width: 100%; border-collapse: collapse; background: #fff; margin-bottom: 20px; }
.cart-table th, .cart-table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.inline-form { display: inline; }

.cart-summary { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); }
.cart-total { font-size: 18px; }

.checkout-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.checkout-form { display: flex; flex-direction: column; gap: 14px; background: #fff; padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); }
.checkout-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.checkout-form input[type=text], .checkout-form input[type=email], .checkout-form input[type=tel], .checkout-form textarea {
  padding: 10px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 14px; font-family: inherit;
}
.radio-label { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }
.order-summary { background: #fff; padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); }
.order-summary ul { list-style: none; padding: 0; margin: 0 0 16px; }
.order-summary li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }

.payment-instructions { background: #fff; padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); margin-top: 20px; }
.payment-instructions code { background: #f1f1f1; padding: 4px 8px; border-radius: 4px; word-break: break-all; }
.qr-code { display: block; margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius); }
.status-pending { display: inline-block; margin-top: 12px; padding: 6px 12px; background: #fff6df; color: #8a6100; border-radius: 999px; font-size: 13px; font-weight: 600; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0; margin-top: 40px; color: var(--muted); font-size: 13px; }

@media (max-width: 780px) {
  .product-detail, .checkout-layout { grid-template-columns: 1fr; }
}
