/* buy-offer.css — shared buy-offer modal (js/buy-offer-modal.js).
   Used on item.html (per-listing "Make offer" + section button) and
   index.html ("Buying an item instead?" in the List Your Price section). */

.bo-overlay {
  position: fixed; inset: 0;
  background: rgba(2,6,23,0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.bo-overlay--open { display: flex; }
.bo-modal {
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  overflow-y: auto;
  background: #0F172A;
  border: 1px solid #334155;
  border-radius: 1rem;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
  font-family: 'Inter', sans-serif;
}
.bo-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: #16233D;
  border-bottom: 1px solid #1E293B;
  position: sticky; top: 0;
}
.bo-head img {
  width: 30px; height: 30px; object-fit: contain;
  border-radius: 0.4rem; background: #0F172A;
  border: 1px solid #334155; padding: 2px;
  image-rendering: pixelated;
}
.bo-head-title { flex: 1; min-width: 0; }
.bo-head-title .bo-kicker { color: #94A3B8; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.bo-head-title .bo-item { color: #E2E8F0; font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bo-close {
  background: none; border: none; color: #94A3B8;
  font-size: 1rem; cursor: pointer; padding: 2px 6px;
}
.bo-close:hover { color: #fff; }
.bo-body { padding: 14px 16px 16px; }
.bo-label { font-size: 0.74rem; color: #94A3B8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin: 12px 0 6px; }
.bo-label:first-child { margin-top: 0; }
.bo-seg { display: flex; gap: 6px; }
.bo-seg button {
  flex: 1;
  background: #1E293B;
  border: 1px solid #334155;
  color: #94A3B8;
  border-radius: 0.55rem;
  padding: 7px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.bo-seg button img { width: 15px; height: 15px; object-fit: contain; }
.bo-seg button.active { background: rgba(29,78,216,0.25); border-color: #3B82F6; color: #E2E8F0; }
.bo-input, .bo-note {
  width: 100%;
  box-sizing: border-box;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 0.6rem;
  color: #E2E8F0;
  padding: 9px 12px;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
}
.bo-input:focus, .bo-note:focus { border-color: #2563EB; }
.bo-note { font-size: 0.84rem; resize: none; }
.bo-preview {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(251,191,36,0.07);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 0.6rem;
  color: #FBBF24;
  font-size: 0.84rem;
  font-weight: 600;
  min-height: 1.2em;
}
.bo-preview img { width: 15px; height: 15px; object-fit: contain; vertical-align: middle; }
.bo-preview--bad { color: #F87171; background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.3); }
.bo-info { margin-top: 12px; color: #64748B; font-size: 0.74rem; line-height: 1.5; }
.bo-error { margin-top: 8px; color: #F87171; font-size: 0.78rem; min-height: 1em; }
.bo-footer { display: flex; gap: 8px; margin-top: 14px; }
.bo-btn {
  flex: 1;
  border: none;
  border-radius: 0.6rem;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.bo-btn--cancel { background: #1E293B; color: #94A3B8; border: 1px solid #334155; }
.bo-btn--cancel:hover { color: #E2E8F0; }
.bo-btn--post { background: #1D4ED8; color: #fff; }
.bo-btn--post:hover { background: #2563EB; }
.bo-btn--post:disabled { opacity: 0.55; cursor: default; }
.bo-login {
  text-align: center;
  padding: 8px 0 4px;
  color: #94A3B8;
  font-size: 0.86rem;
  line-height: 1.55;
}
.bo-login a { color: #93C5FD; font-weight: 700; }

/* Item picker (shown when the modal is opened without a preset item, e.g.
   from the homepage's List Your Price section) */
.bo-pick { position: relative; }
.bo-pick-list {
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 20;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  background: #16233D;
  border: 1px solid #334155;
  border-radius: 0.6rem;
  box-shadow: 0 8px 22px rgba(0,0,0,0.5);
}
.bo-pick-list button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  background: none; border: none;
  color: #CBD5E1;
  padding: 7px 10px;
  font-size: 0.84rem;
  cursor: pointer;
}
.bo-pick-list button:hover { background: #1E293B; }
.bo-pick-list button img {
  width: 22px; height: 22px; object-fit: contain;
  image-rendering: pixelated; flex-shrink: 0;
}
.bo-pick-empty { padding: 10px 12px; color: #64748B; font-size: 0.8rem; }
.bo-picked {
  display: flex; align-items: center; gap: 10px;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 0.6rem;
  padding: 8px 12px;
}
.bo-picked img { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; }
.bo-picked span { flex: 1; font-weight: 600; color: #E2E8F0; font-size: 0.88rem; }
.bo-picked button {
  background: none; border: none; color: #94A3B8;
  cursor: pointer; font-size: 1rem; padding: 2px 6px;
}
.bo-picked button:hover { color: #fff; }

/* Success state after posting */
.bo-success {
  text-align: center;
  padding: 10px 0 4px;
  color: #E2E8F0;
  font-size: 0.9rem;
  line-height: 1.6;
}
.bo-success .bo-success-icon { font-size: 2rem; display: block; margin-bottom: 6px; }
