/**
 * Thin BarterHub overrides on top of official DashLite CSS.
 * Keep minimal — pixel fidelity comes from dashlite.css.
 */

/* Hide WP theme remnants inside shell */
body.nk-body {
  margin: 0 !important;
  background: #f5f6fa;
}
body.nk-body.pg-auth {
  background: #fff;
}
body.nk-body .nk-app-root > .entry-content,
body.nk-body .nk-app-root .alignwide,
body.nk-body .wp-block-group,
body.nk-body .entry-header,
body.nk-body .wp-site-blocks > header,
body.nk-body .wp-site-blocks > footer {
  display: contents;
}
body.nk-body .nk-app-root {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Role-gated nav */
.mod-only,
.member-only {
  display: none !important;
}
body.is-member .member-only {
  display: block !important;
}
body.is-member li.member-only {
  display: list-item !important;
}
body.is-mod .mod-only {
  display: block !important;
}
body.is-mod li.mod-only {
  display: list-item !important;
}

/* Listing product cards using DashLite card system */
.barter-upload-zone {
  border: 2px dashed #dbdfea;
  border-radius: 8px;
  background: #fafbfe;
  padding: 2rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.barter-upload-zone:hover,
.barter-upload-zone.is-dragover {
  border-color: #6576ff;
  background: rgba(101, 118, 255, 0.06);
}
.barter-photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}
.barter-photo-item {
  position: relative;
  border: 1px solid #dbdfea;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.barter-photo-item img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}
.barter-photo-item .barter-photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
}
.barter-social-auth {
  display: grid;
  gap: .75rem;
  margin-top: .25rem;
}
.barter-btn-google,
.barter-btn-facebook {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  font-weight: 600;
}
.barter-btn-google {
  background: #fff !important;
  border: 1px solid #dbdfea !important;
  color: #364a63 !important;
}
.barter-btn-google:hover {
  background: #f5f6fa !important;
  color: #364a63 !important;
}
.barter-btn-facebook {
  background: #1877f2 !important;
  border-color: #1877f2 !important;
  color: #fff !important;
}
.barter-btn-facebook:hover {
  background: #0f66d0 !important;
  color: #fff !important;
}
.barter-social-icon {
  display: inline-flex;
  align-items: center;
}
.barter-btn-google.is-disabled,
.barter-btn-facebook.is-disabled {
  opacity: .85;
}
.barter-listing-thumb {
  height: 160px;
  background: linear-gradient(145deg, rgba(101, 118, 255, 0.12), #f5f6fa);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6576ff;
  font-weight: 700;
  font-size: 1.5rem;
  overflow: hidden;
}
.barter-listing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.barter-listing-card {
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.barter-listing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(54, 74, 99, 0.12);
}

/* Messages */
.barter-msg-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 520px;
}
.barter-msg-list {
  border-right: 1px solid #dbdfea;
  max-height: 560px;
  overflow: auto;
}
.barter-msg-item {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #dbdfea;
  cursor: pointer;
}
.barter-msg-item:hover,
.barter-msg-item.active {
  background: rgba(101, 118, 255, 0.08);
}
.barter-msg-thread {
  display: flex;
  flex-direction: column;
  height: 560px;
}
.barter-msg-body {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  background: #fafbfe;
}
.barter-bubble {
  max-width: 75%;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 0.65rem;
  background: #fff;
  border: 1px solid #dbdfea;
}
.barter-bubble.mine {
  margin-left: auto;
  background: #6576ff;
  color: #fff;
  border-color: #6576ff;
}

.nk-header-search {
  flex: 1;
  max-width: 360px;
}
.nk-header-search .form-control {
  background: #f5f6fa;
  border-color: transparent;
}

/* Legacy page-title blocks → DashLite block-head look */
.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.page-title h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #364a63;
  letter-spacing: -0.01em;
}
.page-title p {
  margin: 0.25rem 0 0;
  color: #8091a7;
  font-size: 0.875rem;
}
.form-row,
.form-row-3 {
  display: grid;
  gap: 1rem;
}
.form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 991px) {
  .barter-msg-layout {
    grid-template-columns: 1fr;
  }
  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }
}
