/* Sjekkmat 2026 — Category */
:root {
  --display: 'Bricolage Grotesque', Georgia, serif;
  --body: 'Outfit', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --bg: #fafbfc;
  --surface: #ffffff;
  --surface-2: #f3f5f7;
  --surface-3: #e9ecef;
  --border: #e2e6ea;
  --border-subtle: #edf0f3;
  --ink: #0f1419;
  --ink-2: #3d4852;
  --ink-3: #6b7785;
  --ink-4: #9aa5b1;
  --accent: #2563eb;
  --accent-soft: rgba(37,99,235,0.08);
  --green: #16a34a;
  --green-soft: rgba(22,163,74,0.08);
  --red: #dc2626;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ─── Nav ────────────────────────────── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px); background: rgba(255,255,255,0.92);
}
.nav-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.nav-logo-icon { width: 28px; height: 28px; background: var(--accent); color: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.nav-logo-text { font-family: var(--display); font-weight: 800; font-size: 18px; }
.beta-tag { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; color: var(--accent); background: var(--accent-soft); padding: 2px 6px; border-radius: 4px; margin-left: 6px; font-family: var(--mono); }
.nav-btn { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--accent); color: white; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; }

/* ─── Category Bar ───────────────────── */
.cat-bar {
  display: flex; gap: 8px; padding: 12px 24px;
  overflow-x: auto; border-bottom: 1px solid var(--border);
  background: var(--surface); scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0; padding: 6px 16px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-2); font-family: var(--body); font-size: 13px;
  font-weight: 500; cursor: pointer; transition: all 0.15s;
  white-space: nowrap; text-decoration: none;
}
.cat-pill:hover { border-color: var(--accent); color: var(--accent); }
.cat-pill.active { background: var(--ink); color: white; border-color: var(--ink); }

/* ─── Category Hero ──────────────────── */
.cat-hero {
  text-align: center;
  padding: 40px 24px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cat-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.cat-hero h1 {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.cat-count { color: var(--ink-3); font-size: 15px; }

/* ─── Content ────────────────────────── */
.content { max-width: 960px; margin: 0 auto; padding: 24px; }

/* ─── Sort Bar ───────────────────────── */
.sort-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px;
}
.sort-label { font-size: 13px; color: var(--ink-3); margin-right: 4px; }
.sort-btn {
  padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-3); font-family: var(--body);
  font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.sort-btn:hover { border-color: var(--accent); color: var(--accent); }
.sort-btn.active { background: var(--ink); color: white; border-color: var(--ink); }

/* ─── Product Grid ───────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.pg-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
}
.pg-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.pg-card-top {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px;
}
.pg-card-img {
  width: 56px; height: 56px; object-fit: contain;
  border-radius: 8px; background: var(--surface-2); flex-shrink: 0;
}
.pg-card-info { flex: 1; min-width: 0; }
.pg-card-name {
  font-weight: 600; font-size: 14px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pg-card-brand { font-size: 12px; color: var(--ink-4); margin-top: 2px; }

.pg-card-prices {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto;
}
.pg-chip {
  font-size: 11px; padding: 3px 8px; border-radius: 12px;
  background: var(--surface-2); color: var(--ink-2);
  font-family: var(--mono); font-weight: 500; white-space: nowrap;
}
.pg-chip.best {
  background: var(--green-soft); color: var(--green);
  border: 1px solid rgba(22,163,74,0.2);
}

.loading-text { text-align: center; color: var(--ink-4); padding: 40px; }
.empty-state { text-align: center; color: var(--ink-4); padding: 60px 20px; font-size: 15px; }

/* ─── Footer ─────────────────────────── */
.footer {
  display: flex; justify-content: space-between; padding: 24px;
  border-top: 1px solid var(--border); color: var(--ink-4);
  font-size: 12px; margin-top: 48px;
}

/* ─── Mobile ─────────────────────────── */
@media (max-width: 768px) {
  .cat-bar { padding: 10px 16px; gap: 6px; }
  .cat-pill { font-size: 12px; padding: 5px 12px; }
  .cat-hero { padding: 28px 16px 24px; }
  .cat-hero h1 { font-size: 1.5rem; }
  .cat-icon { font-size: 36px; }
  .content { padding: 16px; }
  .product-grid { grid-template-columns: 1fr; }
  .sort-bar { flex-wrap: wrap; }
  .footer { flex-direction: column; gap: 4px; align-items: center; }
}
/* ─── Brand Filter (v2) ──────────────── */
.brand-filter { position: relative; margin-bottom: 16px; }
.bf-bar { display: flex; align-items: center; gap: 8px; }
.bf-trigger {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); font-family: var(--body); font-size: 13px;
  font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.bf-trigger:hover { border-color: var(--accent); color: var(--accent); }
.bf-chevron { transition: transform 0.2s; }
.bf-clear {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-3); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.bf-clear:hover { background: var(--red); color: white; border-color: var(--red); }

/* Panel — desktop dropdown */
.bf-panel {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  width: 300px; max-height: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); z-index: 150;
  flex-direction: column; overflow: hidden;
}
.bf-panel.open { display: flex; }
.bf-panel-header {
  display: none; /* only on mobile */
}
.bf-search-wrap { padding: 10px; border-bottom: 1px solid var(--border); }
.bf-search {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-family: var(--body); font-size: 14px;
  color: var(--ink); outline: none; transition: border-color 0.15s;
}
.bf-search:focus { border-color: var(--accent); }
.bf-list { overflow-y: auto; flex: 1; max-height: 340px; }
.bf-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 14px; border: none; background: none;
  color: var(--ink); font-family: var(--body); font-size: 14px;
  cursor: pointer; transition: background 0.1s; text-align: left;
}
.bf-item:hover { background: var(--surface-2); }
.bf-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.bf-item-name { flex: 1; }
.bf-item-count {
  font-size: 12px; color: var(--ink-4); font-family: var(--mono);
  min-width: 24px; text-align: right;
}
.bf-item.active .bf-item-count { color: var(--accent); }

.bf-overlay { display: none; }

/* ─── Mobile: bottom sheet ───────────── */
@media (max-width: 768px) {
  .bf-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 199; display: none;
  }
  .bf-overlay.open { display: block; }

  .bf-panel {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    width: 100%; max-height: 75vh; border-radius: 16px 16px 0 0;
    border: none; z-index: 200;
    transform: translateY(100%); transition: transform 0.3s ease;
  }
  .bf-panel.open {
    display: flex; transform: translateY(0);
  }
  .bf-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; border-bottom: 1px solid var(--border);
  }
  .bf-panel-title { font-weight: 700; font-size: 16px; }
  .bf-panel-close {
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: var(--surface-2);
    font-size: 18px; cursor: pointer; color: var(--ink-3);
    display: flex; align-items: center; justify-content: center;
  }
  .bf-list { max-height: none; }
  .bf-item { padding: 14px 16px; font-size: 15px; }
}

/* Remove old pill styles if still present */
.brand-hidden, .brand-toggle { display: none; }

/* ─── Cart Button on Cards ───────────── */
.pg-card { position: relative; }
.pg-cart-btn {
  position: absolute; top: 8px; right: 8px; z-index: 10;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--border); background: white;
  color: var(--ink-2); font-size: 18px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.pg-cart-btn:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.1); }
.pg-cart-btn.added { background: var(--accent); color: white; border-color: var(--accent); }

/* ─── Load More ──────────────────────── */
.load-more-wrap {
  grid-column: 1 / -1; display: flex; justify-content: center;
  padding: 24px 0;
}
.load-more-btn {
  padding: 12px 32px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--ink); font-family: var(--body); font-size: 14px;
  font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.load-more-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ─── Loading Skeleton ───────────────── */
.loading-skeleton {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 768px) {
  .loading-skeleton { grid-template-columns: 1fr; }
}
.skel-card {
  height: 140px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
