/* Roostd Rentals — the public rental-classifieds marketing site
   (app/marketplace/). Loaded alongside style.css, reusing its :root
   tokens (--accent, --gray-*, --radius, --shadow, --font-sans, .button,
   .card, .badge, .link, .flashes, form.stacked) rather than redefining
   them — this file only adds the public-site-specific layout: header/nav,
   hero slideshow, filter bar, listing cards, and the partner/ads strips.
*/

.mp-body { background: var(--bg); font-family: var(--font-sans); color: var(--text); margin: 0; }

/* ---------- Header ---------- */

.mp-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.mp-header-inner {
  max-width: 1160px; margin: 0 auto; padding: 0.9rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.mp-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.mp-brand-mark { width: 24px; height: 24px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #818cf8); flex-shrink: 0; }
.mp-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; flex: 1; }
.mp-nav-link {
  padding: 0.4rem 0.7rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500;
  color: var(--muted); text-decoration: none;
}
.mp-nav-link:hover { background: var(--gray-50); color: var(--text); }
.mp-nav-link.active { background: var(--accent-subtle); color: var(--accent); }
.mp-header-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.mp-owner-cta, .mp-login-cta { white-space: nowrap; }
.mp-login-cta { font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

.mp-main { max-width: 1160px; margin: 0 auto; padding: 1.75rem 1.5rem 3.5rem; }
.mp-flashes { margin-top: 0; }

/* ---------- Hero ---------- */

.mp-hero { margin-bottom: 1.75rem; }
.hero-slideshow { height: 360px; border-radius: var(--radius-lg); }
.hero-slideshow .slide img { filter: brightness(0.72); }
.mp-hero-empty {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(135deg, var(--accent), #6d28d9); padding: 0 2rem;
}
.mp-hero-empty h2 { color: white; font-size: 1.6rem; max-width: 34rem; margin: 0; }
.hero-slide-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.5rem;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.78), transparent);
  color: white; text-decoration: none; display: block;
}
.hero-slide-caption h2 { margin: 0.35rem 0 0.25rem; font-size: 1.5rem; color: white; }
.hero-slide-caption p { margin: 0; opacity: 0.9; }

/* ---------- Filters ---------- */

.mp-filters { margin-bottom: 1.5rem; }
.mp-filter-form { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.9rem; }
.mp-filter-form input {
  padding: 0.55rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: 0.875rem; background: var(--surface);
}
.mp-filter-form input[name="q"] { flex: 2; min-width: 180px; }
.mp-filter-form input[name="city"] { flex: 1; min-width: 120px; }
.mp-filter-form input[type="number"] { width: 110px; }
.mp-category-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mp-pill {
  padding: 0.4rem 0.9rem; border-radius: 999px; border: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 600; color: var(--gray-600); text-decoration: none; background: var(--surface);
}
.mp-pill:hover { border-color: var(--accent-border); color: var(--accent); }
.mp-pill.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ---------- Listings grid ---------- */

.mp-section-title { font-size: 1.15rem; margin: 0 0 0.9rem; }
.mp-listings { margin-bottom: 2.5rem; }
.mp-empty { color: var(--muted); }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.1rem; }

.mp-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.mp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.mp-card-photo { position: relative; height: 160px; background: var(--gray-100); }
.mp-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-card-category {
  position: absolute; top: 0.6rem; left: 0.6rem; background: rgba(15, 23, 42, 0.75); color: white;
  font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 999px;
}
.mp-card-body { padding: 0.9rem 1rem 1.1rem; }
.mp-card-price { font-size: 1.05rem; color: var(--text); display: block; }
.mp-card-title { font-weight: 600; margin-top: 0.2rem; }
.mp-card-address, .mp-card-specs { font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }
.mp-card-company { font-size: 0.78rem; color: var(--accent); margin-top: 0.5rem; font-weight: 600; }

/* ---------- Partners ---------- */

.mp-partners-strip { margin-bottom: 2.5rem; }
.mp-partners-row, .mp-partners-grid { display: flex; gap: 1rem; flex-wrap: wrap; }
.mp-partners-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.mp-partner-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
  width: 150px; text-decoration: none; color: inherit;
}
.mp-partner-card-lg { width: auto; padding: 1.4rem; }
.mp-partner-photo {
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: var(--accent-subtle);
  display: flex; align-items: center; justify-content: center;
}
.mp-partner-photo img { width: 100%; height: 100%; object-fit: cover; }
.mp-partner-initial { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.mp-muted { color: var(--muted); font-size: 0.85rem; }

/* ---------- Local business ads ---------- */

.mp-local-ads { margin-bottom: 1rem; }
.mp-ads-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.mp-ad-card {
  position: relative; background: var(--gray-50); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1rem;
}
.mp-ad-label {
  position: absolute; top: 0.7rem; right: 0.8rem; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--gray-400);
}
.mp-ad-icon { font-size: 1.5rem; display: block; margin-bottom: 0.4rem; }
.mp-ad-card strong { display: block; margin-bottom: 0.25rem; }
.mp-ad-card p { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- Listing detail ---------- */

.mp-detail { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; margin: 1.25rem 0 2.5rem; align-items: start; }
.mp-detail-main .hero-slideshow { height: 380px; margin-bottom: 1.2rem; }
.mp-detail-main .hero-slideshow img { filter: none; }
.mp-detail-address { color: var(--muted); margin: 0.2rem 0 0.6rem; }
.mp-detail-price { font-size: 1.5rem; font-weight: 700; margin: 0 0 1rem; }
.mp-spec-grid { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.mp-spec-grid div { text-align: left; }
.mp-spec-grid strong { display: block; font-size: 1.1rem; }
.mp-spec-grid span { font-size: 0.78rem; color: var(--muted); }
.mp-detail-side { position: sticky; top: 5rem; }

/* ---------- Location map ---------- */

.mp-map-section { margin-bottom: 2.5rem; }
.mp-map-controls {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; margin-bottom: 0.75rem;
  font-size: 0.82rem; color: var(--gray-700);
}
.mp-map-controls label { display: flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.mp-legend-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 2px solid white; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25); }
.mp-dot-school { background: #0369a1; }
.mp-dot-worship { background: #7c3aed; }
.mp-dot-park { background: #15803d; }
.mp-dot-grocery { background: #b45309; }
.mp-map-status { margin-left: auto; color: var(--muted); font-size: 0.78rem; }
.mp-map { height: 420px; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }

@media (max-width: 700px) {
  .mp-map { height: 300px; }
  .mp-map-status { margin-left: 0; }
}

/* ---------- Footer ---------- */

.mp-footer { background: var(--gray-900); color: var(--gray-300); margin-top: 3rem; }
.mp-footer-inner {
  max-width: 1160px; margin: 0 auto; padding: 2.25rem 1.5rem; display: flex; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.mp-footer-inner strong { color: white; }
.mp-footer-inner p { max-width: 26rem; font-size: 0.85rem; line-height: 1.5; }
.mp-footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.mp-footer-links a { color: var(--gray-300); font-size: 0.85rem; text-decoration: none; }
.mp-footer-links a:hover { color: white; text-decoration: underline; }

@media (max-width: 800px) {
  .mp-detail { grid-template-columns: 1fr; }
  .mp-detail-side { position: static; }
  .hero-slideshow { height: 260px; }
}

@media (max-width: 700px) {
  /* At full width the header is one row (logo, nav, CTA) because it all
     fits — below this it doesn't, and letting a wrapping flex row reflow
     on its own puts .mp-nav (flex:1, and wrapping internally) ahead of
     the logo, since align-items:center vertically centers the short
     single-line brand/CTA against nav's now-taller 2-line block. Stack
     explicitly instead of relying on wrap to guess a sane order. */
  .mp-header-inner { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .mp-nav { order: 2; flex: none; }
  .mp-header-actions { order: 3; flex-direction: column; align-items: stretch; }
  .mp-owner-cta, .mp-login-cta { text-align: center; }
}
