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

:root {
  --bg:          #fdefbd;
  --surface:     #FFFFFF;
  --border:      #E2E0D8;
  --border-md:   #C8C6BC;
  --text-1:      #1A1918;
  --text-2:      #5C5A55;
  --text-3:      #9A9891;
  --green-bg:    #E2F3EB;
  --green-bd:    #7ECAA4;
  --green-tx:    #0D5C3A;
  --neutral-bg:  #ECEAE3;
  --neutral-tx:  #3E3C38;
  --free-bg:     #E8F2DE;
  --free-tx:     #2A5710;
  --soldout-bg:  #FEF2F2;
  --soldout-tx:  #991B1B;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --font:        'DM Sans', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  padding: 20px 16px 40px;
}

.page {
  max-width: 988px;
  margin: 0 auto;
}

/* ── Filter bar ── */

.filter-bar {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-label {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.filter-divider {
  width: 0.5px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

@media (max-width: 800px) {
  .filter-divider { display: none; }
}

.ftag {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  font-family: var(--font);
}
.ftag:hover { background: var(--bg); }
.ftag.active { background: var(--text-1); color: #F5F4F0; border-color: var(--text-1); }

.ftag-online {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  font-family: var(--font);
  flex-shrink: 0;
}
.ftag-online svg { width: 11px; height: 11px; }
.ftag-online:hover { background: var(--bg); }
.ftag-online.active { background: var(--green-bg); color: var(--green-tx); border-color: var(--green-bd); }

.filter-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .filter-right { margin-left: 0; width: 100%; }
}

.result-count {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}
.result-count strong { color: var(--text-1); font-weight: 500; }

.sort-select {
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  font-family: var(--font);
}

.clear-btn {
  font-size: 12px;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font);
  transition: color 0.12s;
}
.clear-btn:hover { color: var(--text-1); }

/* ── Cards grid ── */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

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

/* ── Card ── */

.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
}

.card--sold-out { opacity: 0.75; }

.card-img {
  background: var(--neutral-bg);
  height: 120px;
  position: relative;
  border-bottom: 0.5px solid var(--border);
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-img--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img-placeholder { font-size: 11px; color: var(--text-3); text-align: center; padding: 0 16px; line-height: 1.4; }

.badge-row {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
}

.badge-row--right {
  left: auto;
  right: 8px;
}

.bdg {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.bdg svg { width: 9px; height: 9px; }
.bdg-online  { background: #fff; color: var(--text-1); font-weight: 700; }
.bdg-free    { background: #fff; color: var(--text-1); font-weight: 700; }
.bdg-paid    { background: var(--neutral-bg);  color: var(--neutral-tx); }
.bdg-soldout { background: var(--soldout-bg);  color: var(--soldout-tx); }

/* ── Card body ── */

.card-body { padding: 12px; }

.card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.35;
  margin-bottom: 8px;
}

.meta-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}
.meta-row svg { width: 12px; height: 12px; color: var(--text-3); margin-top: 1px; flex-shrink: 0; }
.meta-text { font-size: 11px; color: var(--text-2); line-height: 1.4; }

.divider { height: 0.5px; background: var(--border); margin: 8px 0; }

.chip-row { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }

.chip {
  font-size: 10px;
  color: var(--green-tx);
  background: var(--green-bg);
  border-radius: 20px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.chip svg { width: 10px; height: 10px; }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.org { display: flex; align-items: center; gap: 5px; min-width: 0; }

.org-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #EEEDFE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 500;
  color: #3C3489;
  flex-shrink: 0;
  font-family: var(--font);
}

.org-name {
  font-size: 10px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.cta-btn {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-1);
  background: transparent;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font);
  text-decoration: none;
  transition: background 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cta-btn:hover { background: var(--bg); }
.cta-btn svg { width: 10px; height: 10px; }

/* ── Empty state ── */

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
}
.empty-icon { margin-bottom: 14px; color: var(--text-3); }
.empty-icon svg { width: 40px; height: 40px; }
.empty-title { font-size: 16px; font-weight: 500; color: var(--text-1); margin-bottom: 8px; }
.empty-body { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 20px; }
.empty-cta {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  padding: 9px 20px;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.12s;
}
.empty-cta:hover { background: var(--surface); }

/* ── Load more ── */

.load-more {
  width: 100%;
  margin-top: 16px;
  padding: 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font);
  transition: background 0.12s;
}
.load-more:hover { background: var(--surface); }
.load-more svg { width: 14px; height: 14px; }

/* ── Loading / error ── */

.loading {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--text-3);
  padding: 48px 0;
  text-align: center;
}
