:root {
  --bg: #ffffff;
  --fg: #121212;
  --muted: #6b6b6b;
  --faint: #999999;
  --line: #e8e8e8;
  --card-bg: #fafafa;
  --card-hover: #f5f5f5;
  --accent: #121212;
  --accent-light: #f0f0f0;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --mono: 'Fragment Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── Nav ─────────────────────────────────────────── */

.nav__badge { width: 16px; height: 16px; margin-left: 4px; vertical-align: middle; }
.nav__logo { vertical-align: middle; }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
}
.nav__brand {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav__links {
  display: flex;
  gap: 4px;
}
.nav__links a {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 14px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.15s;
}
.nav__links a:hover { color: var(--fg); background: var(--accent-light); }
.nav__links a.active { color: var(--bg); background: var(--fg); }

/* ─── Shop Layout ─────────────────────────────────── */

.shop {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.shop__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 48px 0 32px;
}
.shop__header h1 {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.shop__sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.6;
}
.shop__controls {
  min-width: 240px;
  display: flex;
  align-items: center;
  padding-top: 8px;
}
.shop__controls input {
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  outline: none;
  background: var(--bg);
  color: var(--fg);
  transition: border-color 0.15s;
}
.shop__controls input:focus { border-color: var(--fg); }
.shop__controls input::placeholder { color: var(--faint); }

/* ─── Categories ──────────────────────────────────── */

.shop__categories {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.cat-chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.cat-chip:hover { border-color: var(--fg); color: var(--fg); }
.cat-chip.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ─── Featured ────────────────────────────────────── */

.section-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 16px;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

/* ─── Product Grid ────────────────────────────────── */

.shop__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding-bottom: 48px;
}

/* ─── Product Card ────────────────────────────────── */

.product-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}
.product-card:hover {
  border-color: #ccc;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.product-card .pc-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--card-bg);
}

.product-card .pc-body {
  padding: 14px 16px 16px;
}
.product-card .pc-cat {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--faint);
  margin-bottom: 4px;
}
.product-card .pc-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card .pc-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 8px;
}
.product-card .pc-price {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
}
.product-card .pc-original {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  text-decoration: line-through;
  margin-left: 6px;
}
.product-card .pc-source {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Featured card — wider, horizontal layout */
.product-card.featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.product-card.featured .pc-img {
  aspect-ratio: auto;
  height: 100%;
  min-height: 280px;
}
.product-card.featured .pc-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
}
.product-card.featured .pc-title {
  font-size: 18px;
  -webkit-line-clamp: 3;
}
.product-card.featured .pc-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
  font-style: italic;
}

/* ─── Empty State ─────────────────────────────────── */

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--faint);
}
.empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.3;
}
.empty-state p {
  font-family: var(--mono);
  font-size: 12px;
}

/* ─── Footer ──────────────────────────────────────── */

.shop__footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  text-align: center;
}
.shop__footer p {
  font-size: 12px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 8px;
  line-height: 1.6;
}
.shop__footer .muted {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
}

/* ─── Modal ───────────────────────────────────────── */

.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-bg.open { display: flex; }

.modal-card {
  background: var(--bg);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--accent-light); }

.modal-img-wrap {
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.modal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-body {
  padding: 32px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-cat {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--faint);
  margin-bottom: 8px;
}
.modal-body h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}
.modal-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.modal-note {
  background: var(--accent-light);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.note-label {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--faint);
  display: block;
  margin-bottom: 6px;
}
.modal-note p {
  font-size: 12px;
  color: var(--fg);
  line-height: 1.6;
  font-style: italic;
}

.modal-pricing {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.modal-price {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
}
.modal-original {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--faint);
  text-decoration: line-through;
}
.modal-source {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.btn-buy {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 12px 24px;
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-buy:hover { opacity: 0.85; }
.btn-share {
  font-family: var(--mono);
  font-size: 12px;
  padding: 12px 20px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.btn-share:hover { border-color: var(--fg); }

.modal-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ─── Responsive ──────────────────────────────────── */

@media (max-width: 768px) {
  .shop__header { flex-direction: column; padding: 32px 0 24px; }
  .shop__controls { min-width: 100%; }
  .shop__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .featured-grid { grid-template-columns: 1fr; }
  .product-card.featured { grid-template-columns: 1fr; }
  .product-card.featured .pc-img { min-height: 200px; }
  .modal-card { grid-template-columns: 1fr; max-height: 95vh; }
  .modal-img-wrap { max-height: 40vh; }
  .modal-body { padding: 20px; }
  .nav { padding: 12px 16px; }
  .shop { padding: 0 16px; }
}

@media (max-width: 480px) {
  .shop__grid { grid-template-columns: 1fr; }
  .shop__header h1 { font-size: 22px; }
}


/* ─── Admin Controls ─────────────────────────────── */

.pc-admin {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
}

.pc-toggle {
  background: rgba(0,0,0,0.85);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 10px;
  font-family: 'Fragment Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.pc-toggle:hover {
  background: rgba(0,0,0,0.95);
  border-color: rgba(255,255,255,0.5);
}

.product-card {
  position: relative;
}

.pc-hidden {
  opacity: 0.4;
}

.pc-hidden-badge {
  display: inline-block;
  background: #ff4444;
  color: #fff;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 2px;
  letter-spacing: 1px;
  margin-left: 6px;
  vertical-align: middle;
}

body.admin-mode .product-card:has(.pc-hidden) {
  border: 1px dashed rgba(255,68,68,0.3);
}

.btn-toggle-modal {
  background: transparent;
  color: #999;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 16px;
  font-family: 'Fragment Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn-toggle-modal:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}
