/*
 * marketplace.css — marketplace feed page.
 */
.wg-feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.wg-feed h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.wg-feed-create { border-radius: 999px; box-shadow: 0 2px 12px rgba(14,175,76,0.30); transition: transform .14s cubic-bezier(.34,1.56,.64,1), box-shadow .18s ease; }
.wg-feed-create:hover { transform: translateY(-1px); box-shadow: 0 5px 18px rgba(14,175,76,0.38); }
.wg-feed-create:active { transform: scale(0.96); }

/* premium search field */
.wg-feed .wg-search { gap: 8px; }
.wg-feed .wg-search input {
  border-radius: 999px; padding-left: 16px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.wg-feed .wg-search input:focus { outline: none; border-color: var(--wg-color); box-shadow: 0 0 0 3px rgba(14,175,76,0.16); }
.wg-feed .wg-search .wg-btn { border-radius: 999px; }

.wg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
/* ── Category filter card: tap-to-select chips that wrap like an interests card ── */
.wg-catcard {
  margin: 0 0 16px;
  padding: 14px 16px 13px;
  border: 1px solid var(--wg-border-soft, #e7eae8);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(247,250,248,0.92));
  box-shadow: 0 1px 2px rgba(16,24,32,0.04), 0 8px 24px rgba(16,24,32,0.05);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.wg-catcard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.wg-catcard-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--wg-muted); }

/* modern toggle switch */
.wg-nofood { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 500; color: var(--wg-text); cursor: pointer; user-select: none; }
.wg-nofood input { position: absolute; opacity: 0; width: 0; height: 0; }
.wg-nofood-box { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #d7dde2; flex: 0 0 auto; transition: background .2s ease; }
.wg-nofood-box::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.28); transition: transform .22s cubic-bezier(.34,1.56,.64,1); }
.wg-nofood input:checked + .wg-nofood-box { background: var(--wg-color); }
.wg-nofood input:checked + .wg-nofood-box::after { transform: translateX(14px); }
.wg-nofood input:focus-visible + .wg-nofood-box { box-shadow: 0 0 0 3px rgba(14,175,76,0.25); }
@media (prefers-reduced-motion: reduce) { .wg-nofood-box, .wg-nofood-box::after { transition: none; } }

/* wrapped, compact, spring-animated chips */
.wg-cat-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.wg-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border: 1px solid var(--wg-border); border-radius: 999px; background: #fff; color: var(--wg-text); font: inherit; font-size: 0.76rem; font-weight: 600; line-height: 1.45; cursor: pointer; white-space: nowrap; transition: transform .14s cubic-bezier(.34,1.56,.64,1), background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
.wg-chip:hover { border-color: var(--wg-color); transform: translateY(-1px); }
.wg-chip:active { transform: scale(0.93); }
.wg-chip-ic { font-weight: 700; font-size: 0.82rem; line-height: 1; }
.wg-chip.is-on { background: var(--wg-color); border-color: var(--wg-color); color: #fff; box-shadow: 0 2px 9px rgba(14,175,76,0.30); animation: wg-chip-pop .24s ease; }
@keyframes wg-chip-pop { 0% { transform: scale(0.9); } 55% { transform: scale(1.06); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .wg-chip, .wg-chip-ic, .wg-nofood-box, .wg-nofood-box::after { transition: none; }
  .wg-chip.is-on { animation: none; }
}

/* Save-as-default filter actions */
.wg-filter-actions { display: flex; align-items: center; gap: 14px; margin: -4px 0 14px; }
.wg-savefilt {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px;
  border: 1px solid var(--wg-color); border-radius: 999px;
  background: #fff; color: var(--wg-color-dark); font: inherit; font-size: 0.76rem; font-weight: 700;
  cursor: pointer; transition: transform .14s cubic-bezier(.34,1.56,.64,1), background .16s ease, box-shadow .16s ease, color .16s ease;
}
.wg-savefilt-ic { font-size: 0.8rem; line-height: 1; transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.wg-savefilt:hover { background: #eafaf0; box-shadow: 0 3px 12px rgba(14,175,76,0.2); }
.wg-savefilt:active { transform: scale(0.95); }
.wg-savefilt.is-saved { background: var(--wg-color); border-color: var(--wg-color); color: #fff; box-shadow: 0 3px 14px rgba(14,175,76,0.34); }
.wg-savefilt.is-saved .wg-savefilt-ic { transform: rotate(72deg) scale(1.3); }
.wg-resetfilt { border: 0; background: none; color: var(--wg-muted); font: inherit; font-size: 0.82rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; transition: color .16s ease; }
.wg-resetfilt:hover { color: var(--wg-text); }
@media (prefers-reduced-motion: reduce) { .wg-savefilt, .wg-savefilt-ic { transition: none; } }

/* ── Filter bar: location pill + availability segmented control ── */
.wg-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.wg-locpill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--wg-border); border-radius: 999px; background: #fff; color: var(--wg-text); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(16,24,32,0.04); transition: border-color .16s ease, background .16s ease, color .16s ease, transform .12s ease; }
.wg-locpill:hover { border-color: var(--wg-color); }
.wg-locpill:active { transform: scale(0.97); }
.wg-locpill.is-on { border-color: var(--wg-color); background: #eafaf0; color: var(--wg-color-dark); }
.wg-locpill-pin { color: var(--wg-color); flex: 0 0 auto; }
.wg-locpill-chev { color: var(--wg-muted); flex: 0 0 auto; }

.wg-seg { display: inline-flex; padding: 3px; background: var(--wg-tint); border-radius: 999px; gap: 2px; }
.wg-seg-btn { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--wg-muted); cursor: pointer; transition: background .16s ease, color .16s ease, box-shadow .16s ease, transform .1s ease; }
.wg-seg-btn:active { transform: scale(0.94); }
.wg-seg-btn.is-on { background: #fff; color: var(--wg-color-dark); box-shadow: 0 1px 3px rgba(16,24,32,0.14); }

.wg-type-chips { margin-bottom: 14px; }

/* Location modal grid */
.wg-loc-card { max-width: 460px; }
.wg-loc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.wg-loc-cell { padding: 12px 8px; border: 1px solid var(--wg-border-soft); border-radius: 12px; background: #fff; color: var(--wg-text); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; text-align: center; transition: transform .12s cubic-bezier(.34,1.56,.64,1), background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
.wg-loc-cell:hover { border-color: var(--wg-color); transform: translateY(-2px); }
.wg-loc-cell:active { transform: scale(0.95); }
.wg-loc-cell.is-on { background: var(--wg-color); border-color: var(--wg-color); color: #fff; box-shadow: 0 3px 12px rgba(14,175,76,0.3); }
@media (max-width: 420px) { .wg-loc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .wg-locpill, .wg-seg-btn, .wg-loc-cell { transition: none; } }

.wg-filters select {
  flex: 1 1 30%;
  min-width: 120px;
  padding: 10px 34px 10px 13px;
  font: inherit;
  font-weight: 500;
  color: var(--wg-text);
  border: 1px solid var(--wg-border);
  border-radius: 12px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,24,32,0.04);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.wg-filters select:hover { border-color: var(--wg-color); }
.wg-filters select:focus { outline: none; border-color: var(--wg-color); box-shadow: 0 0 0 3px rgba(14,175,76,0.16); }

/* segmented-control grid toggle */
.wg-grid-toggle { display: inline-flex; gap: 3px; margin: 0 0 14px auto; padding: 3px; background: var(--wg-tint); border-radius: 12px; width: fit-content; }
.wg-gridbtn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 9px;
  color: var(--wg-muted); cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .1s ease;
}
.wg-gridbtn:hover { color: var(--wg-color-dark); }
.wg-gridbtn:active { transform: scale(0.88); }
.wg-gridbtn.is-active { color: var(--wg-color-dark); background: #fff; box-shadow: 0 1px 3px rgba(16,24,32,0.14); }

.wg-feed-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 560px) {
  .wg-feed-list { grid-template-columns: repeat(3, 1fr); }
}
/* Desktop default (no explicit column choice): denser, home-sized cards so more
   items fit the window. `:not([class*="cols-"])` = only when the user hasn't
   picked a column count with the toggle. */
@media (min-width: 960px) {
  .wg-feed-list:not([class*="cols-"]) { grid-template-columns: repeat(4, 1fr); }
  .wg-feed-list:not([class*="cols-"]) .wg-card-title { font-size: 0.8rem; line-height: 1.25; }
  .wg-feed-list:not([class*="cols-"]) .wg-card-price { font-size: 0.85rem; }
  .wg-feed-list:not([class*="cols-"]) .wg-card-meta,
  .wg-feed-list:not([class*="cols-"]) .wg-card-seller,
  .wg-feed-list:not([class*="cols-"]) .wg-card-stats { font-size: 0.68rem; }
}
@media (min-width: 1300px) {
  .wg-feed-list:not([class*="cols-"]) { grid-template-columns: repeat(5, 1fr); }
}
/* Explicit column choice (overrides the responsive default) */
.wg-feed-list.cols-2 { grid-template-columns: repeat(2, 1fr); }
.wg-feed-list.cols-3 { grid-template-columns: repeat(3, 1fr); }
.wg-feed-list.cols-4 { grid-template-columns: repeat(4, 1fr); }
.wg-feed-list.cols-5 { grid-template-columns: repeat(5, 1fr); }
.wg-feed-list.cols-6 { grid-template-columns: repeat(6, 1fr); }
/* The 5/6-column buttons are desktop-only (too tiny to be usable on a phone). */
@media (max-width: 767px) { .wg-gridbtn-wide { display: none; } }

/* Denser grids → smaller card text so it stays readable, not cramped */
.wg-feed-list.cols-3 .wg-card-title { font-size: 0.82rem; }
.wg-feed-list.cols-3 .wg-card-price { font-size: 0.85rem; }
.wg-feed-list.cols-3 .wg-card-meta,
.wg-feed-list.cols-3 .wg-card-seller,
.wg-feed-list.cols-3 .wg-card-stats { font-size: 0.68rem; }
.wg-feed-list.cols-4 .wg-card-title { font-size: 0.76rem; line-height: 1.25; }
.wg-feed-list.cols-5 .wg-card-title,
.wg-feed-list.cols-6 .wg-card-title { font-size: 0.72rem; line-height: 1.2; }
.wg-feed-list.cols-5 .wg-card-price,
.wg-feed-list.cols-6 .wg-card-price { font-size: 0.78rem; }
.wg-feed-list.cols-5 .wg-card-meta, .wg-feed-list.cols-5 .wg-card-seller, .wg-feed-list.cols-5 .wg-card-stats,
.wg-feed-list.cols-6 .wg-card-meta, .wg-feed-list.cols-6 .wg-card-seller, .wg-feed-list.cols-6 .wg-card-stats { font-size: 0.64rem; }
.wg-feed-list.cols-4 .wg-card-price { font-size: 0.8rem; }
.wg-feed-list.cols-4 .wg-card-body { padding: 6px 7px; }
.wg-feed-list.cols-4 .wg-card-meta,
.wg-feed-list.cols-4 .wg-card-seller,
.wg-feed-list.cols-4 .wg-card-stats { font-size: 0.64rem; }
.wg-feed-list.cols-4 .wg-card-stats { gap: 6px; }

.wg-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--wg-border-soft);
  border-radius: var(--wg-radius-card);
  overflow: hidden;
  background: #fff;
  color: var(--wg-text);
  text-decoration: none;
  box-shadow: var(--wg-shadow-card);
  transition: box-shadow .2s ease, transform .2s cubic-bezier(.34,1.56,.64,1);
}
.wg-card { position: relative; }
.wg-card:hover { box-shadow: var(--wg-shadow-hover); text-decoration: none; }
.wg-feed-list .wg-card:hover { transform: translateY(-3px); }
.wg-card:active { transform: scale(0.98); }
/* subtle image zoom on hover (card already clips overflow) */
.wg-feed-list .wg-card img { transition: transform .45s cubic-bezier(.2,.6,.2,1); }
.wg-feed-list .wg-card:hover img { transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) {
  .wg-feed-list .wg-card, .wg-feed-list .wg-card img, .wg-feed-list .wg-card:hover, .wg-feed-list .wg-card:hover img { transition: none; transform: none; }
}
.wg-card .wg-me-badge { position: absolute; top: 6px; left: 6px; z-index: 2; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }

/* .wg-card-img is defined once, globally, in main.css (uniform square). */

.wg-card-body { padding: 8px 10px; }
.wg-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wg-card-price { color: var(--wg-color-dark); font-weight: 800; font-size: 0.95rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.wg-card-meta { color: var(--wg-muted); font-size: 0.78rem; margin-top: 3px; }
.wg-card-seller { color: var(--wg-muted); font-size: 0.72rem; margin-top: 2px; }
.wg-card-stats { display: flex; flex-wrap: wrap; gap: 10px; color: var(--wg-muted); font-size: 0.72rem; margin-top: 4px; }

.wg-feed-empty { text-align: center; color: var(--wg-muted); padding: 48px 16px; font-size: 0.95rem; }
#wg-load-more { display: block; margin: 22px auto 0; min-width: 200px; border-radius: 999px; }

/* gentle fade-in as cards render */
@keyframes wg-card-in { from { opacity: 0; } to { opacity: 1; } }
.wg-feed-list .wg-card { animation: wg-card-in .35s ease both; }
@media (prefers-reduced-motion: reduce) { .wg-feed-list .wg-card { animation: none; } }

/* Vehicles strip at the top of the marketplace → links to the dedicated /vehicles page */
.wg-mkt-vehrow { margin: 4px 0 18px; }
.wg-mkt-vehrow[hidden] { display: none; }
.wg-mkt-vehrow-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.wg-mkt-vehrow-head h2 { font-size: 1rem; margin: 0; }
.wg-mkt-vehrow-head a { font-size: 0.82rem; color: var(--wg-accent, #2b54b8); text-decoration: none; white-space: nowrap; }
.wg-mkt-vehrow-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
/* Compact cards in the strip: ~20% smaller, and only title + price below the image. */
.wg-mkt-vehrow-list .wg-card { flex: 0 0 120px; width: 120px; scroll-snap-align: start; }
.wg-mkt-vehrow-list .wg-card-meta,
.wg-mkt-vehrow-list .wg-card-stats { display: none; }
.wg-mkt-vehrow-list .wg-card-title { font-size: 0.8rem; }
.wg-mkt-vehrow-list .wg-card-price { font-size: 0.82rem; }
