/* ============================================================
   Listing Share Bar + Share Modal
   ============================================================ */

/* --- Top bar above hero --- */
.listing-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto 0.75rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-family: 'Inter', sans-serif;
}

.listing-top-bar__back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #314169;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.listing-top-bar__back:hover {
  color: #0d6efd;
  text-decoration: underline;
}
.listing-top-bar__back .material-symbols-outlined {
  font-size: 18px;
}

.listing-top-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Share button (matches fav-chip style) */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #e1e6ef;
  background: #fff;
  color: #6b7280;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: var(--fav-chip-size, 22px);
  line-height: 1.1;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.share-btn:hover {
  border-color: #b0b8c9;
  background: #f8f9fb;
}
.share-btn .material-symbols-outlined {
  font-size: 1.2em;
  color: #9aa3b2;
}
.report-pill {
  text-decoration: none;
}
.report-pill:visited {
  color: #6b7280;
}
.report-pill:hover {
  text-decoration: none;
}

/* Mobile responsive top bar */
@media (max-width: 600px) {
  .listing-top-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }
  .listing-top-bar__back {
    font-size: 0.82rem;
  }
  .share-btn {
    font-size: 18px;
    padding: 0.35rem 0.6rem;
  }
  .listing-top-bar__actions .fav-chip,
  .listing-top-bar__actions .fav-btn {
    font-size: 18px;
    padding: 0.35rem 0.6rem;
  }
}

/* --- Share Modal Overlay --- */
.share-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(29,29,31,.40);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.share-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.share-modal {
  position: relative;
  width: 92vw;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: #f5f5f7;
  border: 1px solid #d7d7dc;
  border-radius: 24px;
  box-shadow: 0 18px 34px rgba(0,0,0,.12);
  padding: 1.6rem;
  font-family: 'Inter', sans-serif;
  transform: translateY(12px);
  transition: transform .2s;
}
.share-overlay.is-open .share-modal {
  transform: translateY(0);
}

/* Close button */
.share-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid #d7d7dc;
  border-radius: 999px;
  background: #ffffff;
  color: #6b7280;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.share-modal__close:hover {
  background: #f8f9fb;
  border-color: #c9ccd4;
}

/* Header */
.share-modal__title {
  margin: 0 0 1.15rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: #1d1d1f;
  letter-spacing: -0.01em;
}

/* --- Preview card (matches map marker popup style) --- */
.share-preview {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #d7d7dc;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  box-shadow: 0 12px 28px rgba(0,0,0,.05);
}

.share-preview__img {
  width: 180px;
  height: 135px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #e5e7eb;
}

.share-preview__info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  font-size: 0.98rem;
  color: #666666;
  justify-content: center;
}

.share-preview__price {
  font-size: 1.55rem;
  font-weight: 800;
  color: #1d1d1f;
  white-space: nowrap;
}

.share-preview__facts {
  color: #666666;
  font-size: 0.92rem;
}

.share-preview__addr {
  font-weight: 700;
  font-size: 1rem;
  color: #314169;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-preview__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.share-preview__badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #e8ecf3;
  color: #4b5563;
  white-space: nowrap;
}

/* --- Share buttons grid --- */
.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}



.share-grid__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.9rem 0.6rem;
  border: 1px solid #d7d7dc;
  border-radius: 18px;
  background: #ffffff;
  cursor: pointer;
  text-decoration: none;
  color: #4a4a50;
  font-size: 0.82rem;
  font-weight: 700;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.share-grid__btn:hover {
  background: #f8f9fb;
  border-color: #c9ccd4;
  color: #1d1d1f;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0,0,0,.05);
  text-decoration: none;
}

/* Shared listing section heading style (matches summary line styling) */
.listing-subsection-title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: #6b7280;
}

@media (max-width: 576px) {
  .listing-subsection-title {
    font-size: 1.05rem;
  }
}

/* Shared neutral note block for listing detail notices */
.listing-theme-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.8rem;
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.4;
}

.listing-theme-note .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  margin-top: 0.08rem;
  color: #64748b;
}

.listing-theme-note__content {
  min-width: 0;
}

.listing-theme-note__title {
  margin: 0 0 0.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.listing-theme-note--compact {
  margin-top: 1rem;
  font-size: 0.82rem;
}

.listing-theme-note--compact .listing-theme-note__title {
  font-size: 0.84rem;
}

.listing-theme-note a {
  color: #2f5f99;
  text-decoration: underline;
}

.listing-theme-note a:hover {
  color: #1f4e85;
}

/* Compact nearby lists (schools/stations/healthcare) */
.nearby-section-summary {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.35;
}

.nearby-group-title {
  margin: 0.2rem 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

.nearby-group {
  margin: 0.35rem 0 0.8rem;
}

.nearby-toggle-btn {
  margin-top: 0.35rem;
  border: 1px solid #d6dde8;
  background: #fff;
  color: #2f5f99;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  line-height: 1.25;
}

.nearby-toggle-btn:hover {
  background: #f8fafc;
  border-color: #c6d3e5;
  text-decoration: underline;
}

.nearby-item[hidden] {
  display: none !important;
}

.share-grid__icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

/* Platform icon colours */
.share-grid__icon--whatsapp  { background: #25d366; color: #fff; }
.share-grid__icon--facebook  { background: #1877f2; color: #fff; }

.share-grid__icon--x         { background: #000;    color: #fff; }
.share-grid__icon--linkedin  { background: #0a66c2; color: #fff; }
.share-grid__icon--pinterest { background: #e60023; color: #fff; }
.share-grid__icon--email     { background: #6b7280; color: #fff; }
.share-grid__icon--copy      { background: #314169; color: #fff; }
.share-grid__icon--caption   { background: #7c3aed; color: #fff; }

.share-grid__icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.share-grid__icon .material-symbols-outlined {
  font-size: 18px;
}

/* Copied confirmation */
.share-grid__btn--copied {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #166534;
}
.share-grid__btn--copied .share-grid__icon--copy,
.share-grid__btn--copied .share-grid__icon--caption {
  background: #22c55e;
}

/* Mobile: 2-col grid */
@media (max-width: 400px) {
  .share-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .share-preview {
    flex-direction: column;
  }
  .share-preview__img {
    width: 100%;
    height: 120px;
  }
}

/* Rent detail top bar – match gallery-width */
.listing-top-bar--rent {
  max-width: 1100px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2.5rem;
  padding-left: 0;
  padding-right: 0;
}

/* Sale detail top bar – fill the column */
.listing-top-bar--sale {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* --- Location breadcrumbs beside back link --- */
.listing-top-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 0;
}

.location-crumbs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fav-chip-size, 22px);
  line-height: 1.1;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.location-crumbs a {
  color: #3a6ea5;
  text-decoration: none;
  font-weight: 500;
}
.location-crumbs .crumb-home {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  color: #3a6ea5;
  text-decoration: none;
}
.location-crumbs .crumb-home .material-symbols-outlined {
  font-size: 1.05em;
  color: inherit;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.location-crumbs .crumb-home:hover {
  color: #2f5b8d;
  text-decoration: none;
}

.location-crumbs a:hover {
  text-decoration: underline;
}

.crumb-sep {
  color: #b0b8c9;
  font-weight: 400;
}

@media (max-width: 600px) {
  .listing-top-links {
    gap: 10px;
  }
  .location-crumbs {
    font-size: 18px;
  }
}
