:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --border: #e8e8ec;
  --border-strong: #d4d4da;
  --text: #111111;
  --muted: #6b6b76;
  --accent: #111111;
  --accent-hover: #333333;
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --max-w: 440px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  opacity: 0.75;
}

.page {
  width: min(var(--max-w), 100%);
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
}

/* ── Store header (lynk-style) ── */

.store-header {
  text-align: center;
  padding: 2.5rem 0 1.25rem;
}

.store-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: var(--shadow);
}

.store-name {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.store-tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 320px;
  margin-inline: auto;
}

/* ── Back link ── */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  color: var(--muted);
  padding: 1.25rem 0 0.5rem;
}

.back-link:hover {
  color: var(--text);
  opacity: 1;
}

/* ── Filters ── */

.filters {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.75rem 0 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.12s;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Product list (vertical, lynk-style) ── */

.product-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.product-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.12s, box-shadow 0.12s;
  cursor: pointer;
}

.product-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.product-item-thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  overflow: hidden;
}

.product-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-item-body {
  flex: 1;
  min-width: 0;
}

.product-item-name {
  margin: 0 0 0.15rem;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-item-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.product-item-price {
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Product detail ── */

.product-detail {
  padding-top: 0.5rem;
}

.product-detail-media {
  width: 100%;
  aspect-ratio: 1;
  max-height: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.product-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-cat {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.product-detail-title {
  margin: 0 0 0.5rem;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.product-detail-price {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.product-detail-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.product-detail-body {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.product-detail-seller {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ── Cards & panels ── */

.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.panel + .panel {
  margin-top: 0.75rem;
}

.panel-title {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.page-title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Forms ── */

.form-group {
  margin-bottom: 0.875rem;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.form-group input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  transition: border-color 0.12s;
}

.form-group input::placeholder {
  color: #aaa;
}

.form-group input:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--surface);
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

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

.btn-block {
  width: 100%;
}

/* ── Summary rows ── */

.summary-product {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.summary-product-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.summary-row strong {
  color: var(--text);
}

.summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

/* ── Alerts ── */

.alert {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
}

.alert-info {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--success);
}

/* ── Status ── */

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-settlement,
.status-capture,
.status-paid {
  background: #dcfce7;
  color: var(--success);
}

.status-pending {
  background: #fef3c7;
  color: var(--warn);
}

.status-expire,
.status-cancel,
.status-deny {
  background: #fee2e2;
  color: var(--danger);
}

/* ── Misc ── */

.loading,
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
}
