/* =========================================================================
   ODINS HANDELSPLATZ — Warenkatalog
   Aufbauend auf style.css. Struktur und Verhalten stammen aus dem
   bestehenden Katalog (katalog.html), die Optik folgt dem Design-System.
   Lesbarkeit hat hier Vorrang vor Atmosphaere.
   ========================================================================= */

.shop-toolbar {
  position: sticky;
  top: 111px;
  z-index: 40;
  padding: 18px 0 14px;
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.shop-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-dim);
}
.shop-stats b { color: var(--ink); font-weight: 600; }

.shop-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}
.shop-controls .search-field { margin-left: 0; flex: 1 1 260px; }

.sort-select {
  padding: 10px 34px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.86rem;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2399a1ae'><path d='M6 8l4 4 4-4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}
.sort-select:hover { border-color: var(--bronze); }

.shop-tabs {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.shop-tabs .filter-btn { flex: 0 0 auto; }

/* --------------------------------------------------------- Kategorien */

.shop-results { padding: 28px 0 60px; }

.category { margin-bottom: 34px; scroll-margin-top: 120px; }
.category-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.category-head h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.category-head .cat-count { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-dim); }
.category-head .cat-range {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-dim);
  white-space: nowrap;
}
.category-note {
  flex-basis: 100%;
  font-size: 0.82rem;
  color: var(--bronze-soft);
  font-style: italic;
}

/* -------------------------------------------------------------- Tabelle */

.table-scroll { overflow-x: auto; }
.shop-table { width: 100%; border-collapse: collapse; }
.shop-table thead th {
  text-align: left;
  padding: 6px 12px 8px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.shop-table thead th.num { text-align: right; }
.shop-table tbody tr { border-top: 1px solid var(--line); transition: background 0.12s ease; }
.shop-table tbody tr:hover { background: var(--surface); }
.shop-table td { padding: 10px 12px; font-size: 0.9rem; vertical-align: middle; }

td.name {
  border-left: 3px solid var(--tier-color, transparent);
  color: var(--ink);
}
td.price {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
}
td.price .unit { margin-left: 5px; font-weight: 400; font-size: 0.74rem; color: var(--ink-dim); }

.type-tag {
  display: inline-block;
  padding: 2px 9px;
  background: var(--surface-3);
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.type-tag[data-type='dino'] { color: var(--ember-hot); background: color-mix(in srgb, var(--ember) 18%, var(--surface-3)); }
.type-tag[data-type='command'] { color: #e58e97; background: color-mix(in srgb, var(--blood) 26%, var(--surface-3)); }
.type-tag[data-type='beacon'] { color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--surface-3)); }

/* ------------------------------------------------------- Boxen aufklappen */

.box-row { cursor: pointer; }
.box-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.box-row .chevron {
  display: inline-block;
  margin-right: 7px;
  font-size: 0.72em;
  color: var(--ink-dim);
  transition: transform 0.16s ease, color 0.16s ease;
}
.box-row.open { background: var(--surface); }
.box-row.open .chevron { transform: rotate(90deg); color: var(--gold); }

.box-contents td { padding: 0 12px 16px; border-top: none; }
.box-contents-inner {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.tier-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 0.86rem; }
.tier-badge {
  flex: 0 0 auto;
  padding: 2px 9px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.tier-items { color: var(--ink-muted); }
.item-info-text { font-size: 0.86rem; line-height: 1.5; color: var(--ink-muted); }
.box-note {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--bronze-soft);
}

.t-ram { color: #8f9aab; background: color-mix(in srgb, #8f9aab 18%, var(--surface)); }
.t-app { color: #58a86d; background: color-mix(in srgb, #58a86d 16%, var(--surface)); }
.t-jou { color: #5b96d6; background: color-mix(in srgb, #5b96d6 16%, var(--surface)); }
.t-mas { color: #9d76d0; background: color-mix(in srgb, #9d76d0 16%, var(--surface)); }
.t-asc { color: var(--ember-hot); background: color-mix(in srgb, var(--ember) 20%, var(--surface)); }
.t-fix { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }

/* --------------------------------------------------------------- Mobil */

@media (max-width: 900px) {
  .shop-toolbar { top: 0; }
}

@media (max-width: 640px) {
  .category-head .cat-range { display: none; }
  .shop-table thead { display: none; }
  .shop-table tbody tr { display: flex; flex-wrap: wrap; padding: 9px 0; gap: 3px 10px; }
  .shop-table tbody tr.box-contents { display: table-row; }
  .shop-table td.name { width: 100%; border-left: none; padding-bottom: 2px; }
  .shop-table td.type { order: 2; padding-top: 0; }
  .shop-table td.price { order: 1; margin-left: auto; padding-top: 0; }
  .box-contents td { display: block; width: 100%; }
}
