/* ── LISTING FILTER BAR ───────────────────────────────── */

.listing-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 36px 0;
  padding-top: 8px;
}

.listing-filter-bar .btn-primary {
  min-width: 180px;
  padding: 14px 24px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.listing-filter-bar .btn-primary:hover {
  background: var(--accent);
  color: var(--surface);
}

/* ── OWNER ACTION BUTTONS ─────────────────────────────── */

.owner-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  align-items: center;
}

.owner-actions .btn-primary,
.owner-actions .btn-secondary {
  min-width: 96px;
  padding: 10px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.owner-actions .btn-secondary {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

.owner-actions .btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── ACTIVE FILTER STATE ─────────────────────────────── */

.listing-filter-bar .btn-primary.active {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}

/* ── EMPTY LISTING STATE ─────────────────────────────── */

.listing-empty-state {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 48px 32px;
  text-align: center;
  color: var(--text);
}

.listing-empty-state i {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 14px;
  display: inline-block;
}

.listing-empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin: 0 0 10px;
  color: var(--text);
}

.listing-empty-state p {
  max-width: 520px;
  margin: 0 auto 24px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.9rem;
}

.listing-empty-state .btn-primary {
  display: inline-block;
  text-decoration: none;
  padding: 14px 24px;
}

/* ── OWNER ACTION BUTTONS POLISH ─────────────────────── */

.owner-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.owner-actions button {
  flex: 1;
  min-height: 40px;
}

.owner-actions .btn-edit-listing {
  background: var(--accent);
  color: var(--surface);
  border: 1px solid var(--accent);
}

.owner-actions .btn-delete-listing {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.owner-actions .btn-delete-listing:hover {
  color: #d06b6b;
  border-color: #d06b6b;
}

/* ── LISTING SEARCH AND SORT BAR ─────────────────────── */

.listing-search-sort-bar {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 14px;
  margin: -18px 0 36px;
  align-items: center;
}

.listing-search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 0 16px;
  min-height: 48px;
}

.listing-search-box i {
  color: var(--accent);
  font-size: 1rem;
}

.listing-search-box input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: 'Jost', sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
}

.listing-search-box input::placeholder {
  color: var(--muted);
}

.listing-sort-select {
  min-height: 48px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 14px;
  outline: none;
  cursor: pointer;
}

.listing-sort-select:focus,
.listing-search-box:focus-within {
  border-color: var(--accent);
}

/* ── LISTING MODAL ───────────────────────────────────── */

.listing-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.listing-modal.d-none {
  display: none;
}

.listing-modal-card {
  width: min(480px, 100%);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 32px;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.listing-modal-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  margin: 0 0 12px;
}

.listing-modal-message {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 22px;
}

.listing-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

/* .d-none lives in base.css with the same (0,1,0) specificity as the rule
   above, and this file loads later — so display:flex would win and the delete
   confirmation would show the edit form. Same compound-selector fix already
   used for .listing-modal.d-none. */
.listing-modal-fields.d-none {
  display: none;
}

.listing-modal-fields input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 12px 14px;
  font-family: 'Jost', sans-serif;
  outline: none;
}

.listing-modal-fields input:focus {
  border-color: var(--accent);
}

.listing-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.listing-modal-actions .btn-primary,
.listing-modal-actions .btn-secondary {
  min-width: 120px;
  padding: 12px 18px;
  cursor: pointer;
}

.listing-modal-actions .btn-secondary {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

.listing-modal-actions .btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── LISTING IMAGES ──────────────────────────────────── */

.card-img {
  overflow: hidden;
}

.listing-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Listing detail image */
.product-img {
  overflow: hidden;
}

.listing-detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── COVER IMAGE CHOICE ──────────────────────────────── */

.cover-image-choice {
  width: 100%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 16px 18px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
}

.cover-image-choice:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cover-image-status {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 10px 0 0;
  text-align: center;
}

/* ── LISTING LIFECYCLE CONTROLS ─────────────────────── */

.owner-lifecycle-controls {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.owner-lifecycle-controls .status-text {
  margin: 0 0 16px;
  padding: 0;
  line-height: 1.6;
}

.owner-lifecycle-controls .product-actions {
  align-items: stretch;
}

.owner-lifecycle-controls .btn-primary,
.owner-lifecycle-controls .btn-outline {
  flex: 1 1 160px;
  min-height: 48px;
  margin-left: 0;
}

.owner-lifecycle-controls [data-listing-status-action]:disabled {
  cursor: wait;
  opacity: 0.6;
}

/* ── LISTING LIFECYCLE STATUS BADGES ────────────────── */

.listing-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid currentColor;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.listing-status-available {
  color: var(--accent);
}

.listing-status-reserved {
  color: var(--accent2);
}

.listing-status-sold {
  color: #d06b6b;
}

.listing-status-archived {
  color: var(--muted);
}

/* ── WISHLIST HEART BUTTON ───────────────────────────── */

.btn-wishlist-heart {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  padding: 4px 6px;
  margin-left: auto;
  transition:
    color 0.15s ease,
    transform 0.1s ease;
}

.btn-wishlist-heart:hover {
  color: #c96b6b;
  transform: scale(1.2);
}

.btn-wishlist-heart.wishlisted {
  color: #c96b6b;
}

/* ── WISHLIST CARD ACTIONS ──────────────────────────── */

.wishlist-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.wishlist-card-actions .btn-secondary {
  flex: 1;
  min-height: 40px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.wishlist-card-actions .btn-secondary:hover {
  color: #c96b6b;
  border-color: #c96b6b;
}

.wishlist-card-actions .btn-primary {
  flex: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

/* ── OWNER RESERVATION REQUESTS ─────────────────────── */

.owner-reservation-panel {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.owner-reservation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.owner-reservation-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.owner-reservation-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.owner-reservation-refresh {
  flex: 0 0 auto;
  min-height: 40px;
  margin-left: 0;
  padding: 0 18px;
}

.owner-reservation-list {
  display: grid;
  gap: 12px;
}

.owner-reservation-list .status-text {
  margin: 0;
  padding: 12px 0;
  line-height: 1.5;
}

.owner-reservation-card {
  padding: 16px;
  border: 1px solid var(--border);
}

.owner-reservation-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.owner-reservation-card-header > div {
  min-width: 0;
}

.owner-reservation-requester {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.owner-reservation-date {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.owner-reservation-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid currentColor;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.owner-reservation-status-pending {
  color: var(--accent2);
}

.owner-reservation-status-accepted {
  color: var(--accent);
}

.owner-reservation-status-rejected {
  color: #d06b6b;
}

.owner-reservation-status-cancelled {
  color: var(--muted);
}

.owner-reservation-message {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.owner-reservation-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.owner-reservation-actions .btn-primary,
.owner-reservation-actions .btn-outline {
  flex: 1 1 140px;
  min-height: 42px;
  margin-left: 0;
}

.owner-reservation-actions button:disabled {
  cursor: wait;
  opacity: 0.6;
}

/* ── OWNER RESERVATION RESPONSIVE STYLES ────────────── */

@media (max-width: 640px) {
  .owner-reservation-header {
    flex-direction: column;
  }

  .owner-reservation-refresh {
    width: 100%;
  }

  .owner-reservation-card-header {
    flex-direction: column;
  }

  .owner-reservation-actions {
    flex-direction: column;
  }

  .owner-reservation-actions .btn-primary,
  .owner-reservation-actions .btn-outline {
    width: 100%;
    flex-basis: auto;
  }
}
