/* ==========================================================================
   Live marketplace bridge: new pine/gold UI + existing SPA markup
   ========================================================================== */

.barter-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  padding: 0.75rem 1rem;
  background: var(--gold-500);
  color: var(--pine-950);
  font-weight: 700;
  border-radius: 0 0 6px 0;
}
.barter-skip-link:focus { left: 0; }

#barter-root,
#barter-root > .entry-content,
.entry-content:has(#barter-root) {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.chrome-public .app-sidebar,
body.chrome-public .app-sidebar-backdrop,
body.chrome-public .app-topbar { display: none !important; }
body.chrome-public .app-main { margin-left: 0; }
body.chrome-public .app-content { padding: 0; max-width: none; }
body.chrome-public .app-shell { display: block; }

body.chrome-app .site-header,
body.chrome-app .site-footer,
body.chrome-app #barter-home,
body.chrome-app .to-top { display: none !important; }
body.chrome-app { background: var(--paper); }

body.route-messages .app-content {
  padding: 0;
  max-width: none;
  height: calc(100vh - 61px);
  overflow: hidden;
}
body.route-messages #barter-view,
body.route-messages .inbox-shell { height: 100%; }

body:not(.route-home) #barter-home { display: none; }
body.route-home #barter-view { min-height: 0; }
body.route-home .app-content { padding: 0; }

.mod-only,
.member-only { display: none !important; }
body.is-member .member-only { display: flex !important; }
body.is-member a.member-only.app-nav-link { display: flex !important; }
body.is-mod .mod-only { display: flex !important; }
body.is-mod .app-nav-section.mod-only { display: block !important; }
body.is-member .guest-only { display: none !important; }
body:not(.is-member) .guest-only { display: flex !important; }

.item-thumb { position: relative; overflow: hidden; }
.item-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.gallery-main { position: relative; overflow: hidden; }
.gallery-main img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.barter-listing-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 640px) { .barter-listing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .barter-listing-grid { grid-template-columns: repeat(3, 1fr); } }

.barter-skeleton-wrap { padding: 24px 0; }
.barter-skeleton-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 640px) { .barter-skeleton-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .barter-skeleton-grid { grid-template-columns: repeat(3, 1fr); } }
.barter-skeleton-card {
  background: #fff; border: 1px solid var(--clay-200); border-radius: 12px; overflow: hidden;
}
.barter-skeleton-thumb { aspect-ratio: 4/3; background: var(--paper-2); }
.barter-skeleton-body { padding: 16px; }
.barter-skeleton-line {
  height: 10px; background: var(--paper-2); border-radius: 6px; margin-bottom: 10px;
}
.barter-skeleton-line.w-80 { width: 80%; }
.barter-skeleton-line.w-55 { width: 55%; }
.barter-skeleton-line.w-30 { width: 30%; }

.barter-empty-state,
.barter-error-state {
  text-align: center; padding: 48px 20px; background: #fff;
  border: 1px solid var(--clay-200); border-radius: 12px;
}
.barter-empty-state h5,
.barter-error-state strong {
  font-family: var(--font-display); font-size: 1.4rem; text-transform: uppercase;
}
.barter-empty-state p,
.barter-error-state .mt-1 { color: var(--ink-soft); margin: 8px 0 18px; }
.barter-error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.page-title {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  flex-wrap: wrap; margin-bottom: 22px;
}
.page-title h1 {
  font-size: clamp(1.4rem, 3.5vw, 1.9rem); text-transform: uppercase;
}
.page-title p { color: var(--ink-soft); margin-top: 4px; }

.app-page-head { margin-bottom: 22px; }
.app-page-head .app-page-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.btn-primary, .btn-success { background: var(--gold-500); color: var(--pine-950); border-color: transparent; }
.btn-primary:hover, .btn-success:hover { background: var(--gold-600); }
.btn-outline-light, .btn-outline-primary, .btn-white { border-color: var(--pine-700); color: var(--pine-700); background: #fff; }
.btn-danger { background: #b5451f; color: #fff; }
.btn-sm { padding: 9px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 22px; }
.btn-block { width: 100%; }

.card, .card-bordered, .panel {
  background: #fff; border: 1px solid var(--clay-200); border-radius: 12px;
}
.card-inner { padding: 18px; }
.card-title, .nk-block-title {
  font-family: var(--font-display); text-transform: uppercase; font-size: 1.05rem;
}
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row.g-gs { gap: 16px; }
.col-lg-8 { flex: 1 1 60%; min-width: 0; }
.col-lg-4, .col-4 { flex: 1 1 280px; min-width: 0; }
.col-6 { flex: 1 1 240px; }
.col-sm-6, .col-md-2, .col-md-3, .col-md-4, .col-md-8, .col-lg-3 { flex: 1 1 180px; }

.form-group { display: block; margin-bottom: 14px; }
.form-label, .form-group label, .field span {
  display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px;
}
.form-control, select, textarea, input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="number"], input[type="tel"], input[type="date"], input[type="time"], input[type="file"] {
  width: 100%; padding: 12px 14px; border-radius: 7px; border: 1.5px solid var(--clay-200);
  background: #fff; color: var(--ink); font: inherit; font-size: 0.95rem;
}
textarea.form-control, .field textarea { min-height: 88px; resize: vertical; }
.form-control:focus, select:focus, textarea:focus, input:focus {
  outline: 2.5px solid var(--gold-500); outline-offset: 2px;
}
.form-row, .form-row-3 { display: grid; gap: 12px; }
@media (min-width: 700px) {
  .form-row { grid-template-columns: repeat(2, 1fr); }
  .form-row-3 { grid-template-columns: repeat(3, 1fr); }
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-card-wide { max-width: 520px; }

.table, table.data-table, table.table-tranx {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
}
.table th, table.data-table th, table.table-tranx th {
  text-align: left; font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--ink-soft); padding: 10px 12px; border-bottom: 2px solid var(--clay-200);
}
.table td, table.data-table td, table.table-tranx td {
  padding: 12px; border-bottom: 1px solid var(--clay-200); vertical-align: middle;
}
.table-responsive { overflow-x: auto; }

.badge, .badge-dim {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  background: var(--paper-2); color: var(--ink-soft);
}
.badge-success, .badge-dim.badge-success { background: var(--good-100); color: var(--good-600); }
.badge-warning, .badge-dim.badge-warning { background: #fdeecb; color: #93650c; }
.badge-info, .badge-dim.badge-info, .badge-primary, .badge-dim.badge-primary { background: #dcecff; color: #1c4f8c; }
.badge-danger, .badge-dim.badge-danger { background: #f8d4c8; color: #b5451f; }

.alert {
  padding: 12px 14px; border-radius: 8px; margin: 12px 0; font-size: 0.9rem;
  background: var(--paper-2); color: var(--ink);
}
.alert-danger { background: #f8d4c8; color: #b5451f; }
.alert-success { background: var(--good-100); color: var(--good-600); }
.alert-info, .alert-warning { background: #fdeecb; color: #93650c; }

.text-danger { color: #b5451f; }
.fw-bold { font-weight: 700; }
.form-note { font-size: 0.82rem; color: var(--ink-soft); }
.form-control-lg { padding: 14px 16px; font-size: 1rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-3 { margin-bottom: 16px; }
.py-4 { padding-block: 24px; }
.d-flex { display: flex; }
.gap-2, .g-2 { gap: 8px; }
.w-100 { width: 100%; }

.barter-dropdown { position: relative; }
.barter-dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, 86vw);
  background: #fff; border: 1px solid var(--clay-200); border-radius: 12px;
  box-shadow: 0 16px 32px rgba(18,38,29,0.14); padding: 10px;
  display: none; z-index: 80;
}
.barter-dropdown.is-open .barter-dropdown-menu { display: block; }
.barter-dropdown-head {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 12px;
  border-bottom: 1px solid var(--clay-200); margin-bottom: 8px;
}
.nk-notification-item, .activity-item {
  display: flex; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--clay-200);
  cursor: pointer;
}
.nk-notification-item:last-child { border-bottom: 0; }
.nk-notification-text { font-size: 0.87rem; }
.nk-notification-time { font-size: 0.76rem; color: var(--ink-soft); }
.icon-btn .badge, #notif-status.badge {
  position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; padding: 0;
  border-radius: 50%; background: var(--gold-500);
}
#notif-status[hidden] { display: none !important; }

.barter-social-auth { display: grid; gap: 10px; margin-top: 18px; }
.barter-btn-google, .barter-btn-facebook {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 16px; border-radius: 7px; font-weight: 700;
  border: 1.5px solid var(--clay-200); background: #fff; color: var(--ink);
}
.barter-btn-facebook { background: #1877f2; color: #fff; border-color: #1877f2; }
.barter-social-auth .is-disabled { opacity: 0.55; }
.overline-title { text-align: center; font-size: 0.75rem; color: var(--ink-soft); margin: 18px 0 8px; }

.barter-msg-layout { display: grid; min-height: 520px; }
@media (min-width: 800px) { .barter-msg-layout { grid-template-columns: 280px 1fr; } }
.barter-msg-list { border-right: 1px solid var(--clay-200); }
.barter-msg-item { padding: 14px 16px; border-bottom: 1px solid var(--clay-200); cursor: pointer; }
.barter-msg-item.active { background: var(--paper-2); }
.barter-msg-item .name { font-weight: 700; }
.barter-msg-item .preview { font-size: 0.82rem; color: var(--ink-soft); }
.barter-msg-thread { display: flex; flex-direction: column; min-height: 520px; }
.barter-msg-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.barter-bubble {
  max-width: 78%; padding: 10px 12px; border-radius: 12px; background: var(--paper-2);
}
.barter-bubble.mine { margin-left: auto; background: var(--pine-700); color: var(--paper); }

.profile-head { display: flex; gap: 12px; align-items: center; }
.avatar-lg {
  width: 56px; height: 56px; border-radius: 50%; background: var(--pine-700); color: var(--paper);
  display: grid; place-items: center; font-weight: 700; overflow: hidden; flex-shrink: 0;
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.detail-hero {
  aspect-ratio: 4/3; background: var(--paper-2); border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; margin-bottom: 16px;
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.barter-filter-actions { display: flex; gap: 10px; flex-wrap: wrap; }

em.icon.ni { display: none; }

.cat-chip { cursor: pointer; }
a.cat-chip { display: inline-block; }
.barter-upload-zone {
  border: 1.5px dashed var(--clay-400); border-radius: 12px; padding: 28px; text-align: center;
  background: var(--paper-2); margin-bottom: 12px;
}
.barter-photo-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.barter-photo-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.barter-photo-item img { width: 100%; height: 100%; object-fit: cover; }
.item-card .item-fav { z-index: 2; }
.barter-cms-body h1,
.barter-cms-body h2,
.barter-cms-body h3 { text-transform: none; margin: 0.6em 0 0.4em; }
.barter-cms-body p,
.barter-cms-body li { color: var(--ink-soft); }
.barter-cms-body ul { padding-left: 1.2em; list-style: disc; margin: 0 0 1em; }
.barter-cms-body a { color: var(--pine-700); font-weight: 700; }

.filter-panel .field, .filter-panel .form-group { margin-bottom: 12px; }
.filter-actions { display: flex; gap: 10px; padding-top: 18px; }
@media (min-width: 960px) {
  .filter-panel .filter-panel-head { display: flex; }
  .filter-panel .filter-actions { display: flex; }
}

.item-actions .item-fav { position: static; width: auto; height: auto; border-radius: 6px; }

.listing-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group input { flex: 1; }
.shipping-checks { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.barter-upload-zone.is-dragover { border-color: var(--gold-500); background: #fff; }
.growth-bars { display: flex; gap: 8px; align-items: flex-end; height: 120px; }
.growth-bars span { flex: 1; background: var(--gold-500); border-radius: 4px 4px 0 0; min-height: 8px; }
.admin-mod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 22px; }
.admin-mod-grid h3 { font-size: 1.05rem; text-transform: uppercase; margin-bottom: 8px; }
.thread-empty { display: grid; place-items: center; height: 100%; padding: 32px; }
.barter-photo-remove { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; padding: 0; display: grid; place-items: center; }
.barter-photo-name { display: none; }
.condition-radio {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px;
  border: 1.5px solid var(--clay-200); border-radius: 8px; background: #fff; cursor: pointer; font-size: 0.88rem;
  text-align: center; min-height: 44px;
}
.condition-radio:has(input:checked) { border-color: var(--pine-700); background: var(--paper-2); }

#home-listings:empty::before,
#home-categories:empty::before { content: none; }
#home-listings { min-height: 120px; }

.wp-site-blocks > header,
.wp-site-blocks > footer,
.entry-header { display: none !important; }
