/* Trade Market — store slots, store cards and the store editor, on top of sango-theme.css. */

.type-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 0.4rem;
}
.type-badge.offer {
  background: var(--color-highlight-soft);
  color: var(--color-highlight);
  border: 1px solid var(--color-highlight);
}
.type-badge.request {
  background: rgba(166, 61, 47, 0.08);
  color: var(--color-negative);
  border: 1px solid var(--color-negative);
}

/* --- Front page: one section per category, five store slots each --- */
.cat-section {
  margin-bottom: 1.75rem;
}
.cat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.cat-head h3 {
  border: none;
  margin: 0;
  background-color: #8f4b36;
  padding: 8px;
  border-radius: 4px 16px 4px 4px;
  margin-bottom:8px;
}
.cat-head h3 a {
  text-decoration: none;
  color: inherit;
}
.cat-head p {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--color-text);
  opacity: 0.65;
}
.cat-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.store-slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}
@media (max-width: 760px) {
  .store-slots { grid-template-columns: repeat(2, 1fr); }
}

.store-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 130px;
  padding: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #130707 center / cover no-repeat;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-ui);
  box-shadow: 2px 2px 0 var(--color-shadow);
}
.store-slot:hover { transform: translateY(-2px); }
.store-slot .slot-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.1) 70%);
}
.store-slot .slot-text { position: relative; }
.store-slot strong { display: block; font-size: 0.9rem; line-height: 1.2; }
.store-slot small { font-size: 0.75rem; opacity: 0.85; }
.store-slot .store-logo {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  width: 34px;
  height: 34px;
  font-size: 0.9rem;
}
.store-slot.empty {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: transparent;
  border-style: dashed;
  color: var(--color-text);
  opacity: 0.65;
  box-shadow: none;
}

/* --- Store logo (image, or an initial when there is none) --- */
.store-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--color-border);
  background: #130707;
  flex: none;
}
.store-logo-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: bold;
  font-size: 1.4rem;
  color: var(--color-highlight);
}

/* --- Full store list / single store --- */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.store-card { padding: 0; overflow: hidden; }
.store-banner {
  position: relative;
  height: 110px;
  background: #2a1414 center / cover no-repeat;
}
.store-flag { position: absolute; top: 0.5rem; right: 0.5rem; }
.store-body { padding: 0 1rem 1rem; }
.store-body .store-logo { margin-top: -28px; position: relative; }
.store-body h3 { border: none; margin: 0.4rem 0 0.2rem; }
.store-meta {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text);
  opacity: 0.65;
}
.store-desc { font-size: 0.9rem; }

/* --- Store editor --- */
.image-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.image-preview {
  height: 60px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.upload-status {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text);
  opacity: 0.65;
}
.store-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.store-row-main { flex: 1 1 200px; min-width: 0; }
.store-row-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* --- Header ticker: the latest listings/requests, scrolling right to left --- */
.ticker {
  overflow: hidden;
  margin: 0.6rem 0;
  padding: 0.45rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: darkgoldenrod;
  text-align: left;
  white-space: nowrap;
}
.ticker[hidden] { display: none; }
.ticker-track {
  display: inline-flex;
  width: max-content;
  animation: ticker-scroll 30s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-set { display: inline-flex; min-width: 100vw; } /* each copy fills the screen so the -50% loop never shows a gap */
.ticker a {
  color: inherit;
  text-decoration: none;
  margin-right: 3rem;
}
.ticker a:hover { text-decoration: underline; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
/*
@media (prefers-reduced-motion: reduce) {
  .ticker { overflow-x: auto; }
  .ticker-track { animation: none; }
}
*/
/* --- Recents tiles: a listing photo fills the tile behind the shade and text --- */
.store-slot .slot-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}

/* --- Recents: requests are flagged loudly so they read differently from offers --- */
.slot-badge {
  display: inline-block;
  margin-bottom: 0.3rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #89f6dd;
  color: #1e1d1a;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}
