/* ===== Market page ===================================================== */

.mkt-page { min-height: 100vh; padding-top: 64px; }

/* Hero — unified pattern: left-heavy dark vignette for text legibility,
   fading right so the image breathes. */
.mkt-hero {
  position: relative;
  padding: 120px 0 80px;
  background:
    linear-gradient(180deg, transparent 0%, transparent 55%, rgba(0,0,0,1) 100%),
    linear-gradient(90deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.85) 30%, rgba(0,0,0,0.60) 55%, rgba(0,0,0,0.20) 80%, rgba(0,0,0,0.35) 100%),
    url('/images/marche.png') center / cover no-repeat,
    #000;
  overflow: hidden;
  text-align: left;
}
.mkt-hero .container { position: relative; z-index: 1; }
.mkt-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  color: #fff;
  margin: 6px 0 10px;
  letter-spacing: -0.02em;
}
.mkt-sub {
  font-size: 15px;
  color: rgba(241,243,246,0.72);
  margin: 0 0 18px;
  max-width: 520px;
  line-height: 1.55;
}
.mkt-stats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 13px;
  color: var(--muted);
}
.mkt-stats strong { color: var(--gold-lt); font-weight: 800; }
.mkt-stat-sep { opacity: 0.35; }

/* ----- Section --------------------------------------------------------- */
.mkt-section { padding: 32px 0 60px; }

/* ----- Filters --------------------------------------------------------- */
.mkt-filters {
  margin-bottom: 14px;
}
.mkt-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mkt-search-wrap {
  position: relative;
  flex: 0 0 220px;
}
.mkt-search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.mkt-search {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 9px 12px 9px 36px;
  color: #fff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.18s ease;
}
.mkt-search:focus { border-color: var(--gold-lt); }
.mkt-search::placeholder { color: var(--muted); opacity: 0.7; }

.mkt-select {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 9px 10px;
  color: #fff;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.18s ease;
  flex-shrink: 0;
}
.mkt-select:focus { border-color: var(--gold-lt); }
.mkt-select--sort { flex: 0 0 auto; }

/* Price range */
.mkt-price-range {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.mkt-price-input {
  width: 90px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 9px 10px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s ease;
  -moz-appearance: textfield;
}
.mkt-price-input::-webkit-outer-spin-button,
.mkt-price-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.mkt-price-input:focus { border-color: var(--gold-lt); }
.mkt-price-input::placeholder { color: var(--muted); opacity: 0.7; }
.mkt-price-sep { color: var(--muted); font-size: 12px; }
.mkt-price-unit { color: var(--muted); font-size: 12px; }

/* Filter action buttons */
.mkt-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.mkt-filter-btn {
  background: rgba(224,176,90,0.12);
  border: 1px solid rgba(224,176,90,0.35);
  color: var(--gold-lt);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.mkt-filter-btn:hover { background: rgba(224,176,90,0.22); }
.mkt-filter-reset {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.mkt-filter-reset:hover { color: #fff; }

/* ----- Meta row (count + updated) -------------------------------------- */
.mkt-toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.mkt-result-count {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.75;
}
.mkt-updated { font-size: 12px; color: var(--muted); opacity: 0.6; white-space: nowrap; margin: 0; }

/* ----- Grid ------------------------------------------------------------ */
.mkt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  align-items: start;
}

/* ----- Card ------------------------------------------------------------ */
.mkt-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0));
  background-color: var(--card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.mkt-card:hover {
  border-color: rgba(201,147,58,0.35);
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.mkt-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mkt-card-shopname {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-lt);
  letter-spacing: 0.01em;
  line-height: 1.3;
  margin-bottom: 4px;
}
.mkt-card-charline {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mkt-card-charname {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  opacity: 0.85;
}
.mkt-card-class {
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 1px 6px;
}
.mkt-map-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}

/* ----- Item list ------------------------------------------------------- */
.mkt-items {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}
.mkt-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s ease;
}
.mkt-item:first-child { border-top: none; }
.mkt-item:hover { background: rgba(255,255,255,0.03); }

.mkt-item-icon {
  width: 38px; height: 38px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 7px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mkt-item-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}
.mkt-item-info { min-width: 0; }
.mkt-item-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.mkt-item-refine { color: #5ab0ff; margin-right: 3px; font-weight: 700; }
.mkt-item-carded { color: var(--muted); font-size: 10.5px; margin-left: 4px; }
.mkt-item-price {
  font-size: 11.5px;
  color: var(--gold-lt);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.mkt-item-qty {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ----- Buy button ------------------------------------------------------ */
.mkt-card-buy {
  display: block;
  width: calc(100% - 28px);
  margin: 10px 14px 12px;
  padding: 9px 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.mkt-card-buy--guest {
  background: rgba(224,176,90,0.10);
  border: 1px solid rgba(224,176,90,0.28);
  color: var(--gold-lt);
}
.mkt-card-buy--guest:hover { background: rgba(224,176,90,0.18); }
.mkt-card-buy--soon {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ----- Empty state ----------------------------------------------------- */
.mkt-empty {
  text-align: center;
  padding: 80px 20px;
}
.mkt-empty-icon { font-size: 52px; margin-bottom: 16px; }
.mkt-empty-title {
  font-size: 18px; font-weight: 700;
  color: #fff; margin: 0 0 8px;
}
.mkt-empty-sub { font-size: 14px; color: var(--muted); margin: 0; }

/* ----- Pagination ------------------------------------------------------ */
.mkt-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.mkt-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.mkt-page-btn:hover {
  border-color: rgba(224,176,90,0.4);
  color: var(--gold-lt);
}
.mkt-page-btn.active {
  background: rgba(224,176,90,0.14);
  border-color: rgba(224,176,90,0.5);
  color: var(--gold-lt);
  font-weight: 800;
}
.mkt-page-btn--arrow { color: var(--muted); }
.mkt-page-ellipsis {
  font-size: 13px;
  color: var(--muted);
  opacity: 0.5;
  padding: 0 4px;
}

/* ----- Responsive ------------------------------------------------------ */
@media (max-width: 760px) {
  .mkt-filter-row { flex-direction: column; align-items: stretch; }
  .mkt-search-wrap { flex: none; }
  .mkt-select { width: 100%; }
  .mkt-price-range { width: 100%; }
  .mkt-price-input { flex: 1; }
  .mkt-filter-actions { margin-left: 0; }
  .mkt-filter-btn { flex: 1; }
}
@media (max-width: 600px) {
  .mkt-grid { grid-template-columns: 1fr; }
}
