/* 고객용 공개 페이지 — 모바일 우선 */
:root {
  --pp-bg: #f5f6f8;
  --pp-card: #fff;
  --pp-text: #111;
  --pp-muted: #6b7280;
  --pp-accent: #2563eb;
  --pp-border: #e5e7eb;
}

/* 삼성 인터넷·크롬 등: 시스템 다크모드여도 이 페이지는 라이트 테마로 렌더 */
html {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body.pp-body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  background: var(--pp-bg);
  color: var(--pp-text);
  line-height: 1.45;
  padding-bottom: 88px;
  color-scheme: light;
}

/* 중개사 앱 미리보기 iframe: 전화/문자는 미리보기에서 숨김 (편집은 모달에서만) */
body.pp-body.pp-body--embed {
  padding-bottom: 24px;
}
body.pp-body--embed .pp-fab {
  display: none !important;
}

.pp-header {
  padding: 16px;
  background: var(--pp-card);
  border-bottom: 1px solid var(--pp-border);
}

.pp-detailHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 14px;
  margin: 8px 12px 0;
  position: relative;
}

.pp-detailHeader__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  font-size: 17px;
  color: #111827;
  pointer-events: none;
}

.pp-detailHeader__back,
.pp-detailHeader__close {
  border: 0;
  background: transparent;
  font-size: 22px;
  color: #6b7280;
  cursor: pointer;
  padding: 8px 12px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.pp-detailHeader__back:hover,
.pp-detailHeader__close:hover {
  color: #111827;
}

.pp-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
}

.pp-intro {
  margin: 0;
  font-size: 14px;
  color: var(--pp-muted);
}

.pp-hero {
  width: 100%;
  aspect-ratio: 8 / 3;
  object-fit: cover;
  background: #e5e7eb;
  display: block;
}

.pp-priceBar {
  padding: 16px;
  background: var(--pp-card);
  border-bottom: 1px solid var(--pp-border);
}

.pp-priceMain {
  font-size: 22px;
  font-weight: 800;
  color: var(--pp-accent);
  text-align: center;
}

.pp-priceSub {
  margin-top: 6px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: #1d4ed8;
}

.pp-priceSub--muted {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
}

.pp-badgeRow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 8px;
}

.pp-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  margin-bottom: 8px;
}

.pp-section {
  margin: 12px;
  padding: 14px 16px;
  background: var(--pp-card);
  border-radius: 12px;
  border: 1px solid var(--pp-border);
}

.pp-section h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.pp-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid #f3f4f6;
}

.pp-row:last-child {
  border-bottom: none;
}

.pp-row span:first-child {
  color: var(--pp-muted);
}

.pp-map {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  background: #ddd;
}

.pp-mapWrap {
  position: relative;
}

.pp-mapLockBtn {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  border: 1px solid #d1d5db;
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* 고객용 공유 매물: 위치(미니지도) 카드 하단 안내 */
.pp-locationDisclaimer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
  font-size: 11px;
  line-height: 1.55;
  color: var(--pp-muted);
}

.pp-locationDisclaimer p {
  margin: 0;
}

.pp-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.pp-gallery img,
.pp-gallery video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
}

.pp-error {
  padding: 48px 20px;
  text-align: center;
  font-size: 16px;
  color: var(--pp-muted);
}

/* 비공개(링크 비활성) 안내 — 본문 + 일반 공유 페이지와 동일 FAB */
.pp-privateExpiredWrap {
  min-height: 40vh;
}

.pp-privateExpired {
  margin-top: 12px;
}

.pp-privateExpired__title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--pp-text);
  text-align: center;
  line-height: 1.4;
}

.pp-privateExpired__body {
  margin: 0;
  font-size: 15px;
  color: var(--pp-muted);
  text-align: center;
  line-height: 1.55;
}

/* 미리보기(embed)에서도 만료 안내 시 문의 버튼 노출 */
body.pp-body--embed .pp-privateExpiredWrap .pp-fab {
  display: flex !important;
}

.pp-fab {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  z-index: 50;
}

.pp-fab a {
  flex: 1;
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
}

.pp-fab .pp-call {
  background: var(--pp-accent);
  color: #fff;
}

.pp-fab .pp-sms {
  background: #fff;
  color: var(--pp-accent);
  border: 2px solid var(--pp-accent);
}

.pp-listCard {
  margin: 12px;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--pp-card);
  border: 1px solid var(--pp-border);
  position: relative;
}

.pp-listCard__indexBadge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(55, 65, 81, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}

.pp-listCard img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e5e7eb;
}

.pp-listCard__body {
  padding: 12px 14px 14px;
}

.pp-listCard__price {
  font-size: 18px;
  font-weight: 800;
  color: var(--pp-accent);
  text-align: center;
}

.pp-listCard__meta {
  font-size: 13px;
  color: var(--pp-muted);
  margin-top: 4px;
}

.pp-listCard__mapBlock {
  margin-top: 10px;
}

.pp-listCard__map {
  height: 160px;
}

.pp-listCard__mapAddr {
  margin-top: 8px;
  font-size: 12px;
  color: var(--pp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-listCard__btn {
  display: block;
  margin-top: 10px;
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  background: #f3f4f6;
  color: var(--pp-accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}

.pp-listCard__condCompact .pp-row {
  font-size: 12px;
  gap: 8px;
}

.pp-listCard__condCompact .pp-row span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-listCard__condCompact .pp-row {
  font-size: 12px;
  gap: 8px;
}

.pp-listCard__condCompact .pp-row span:first-child {
  flex: 0 0 auto;
  white-space: nowrap;
}

.pp-listCard__condCompact .pp-row span:last-child {
  min-width: 0;
  flex: 1;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-muted {
  color: var(--pp-muted);
}

/* 360° 가상투어 (고객 페이지 전용 섹션 — virtual_tours 연동) */
.pp-section--virtualTour {
  padding: 0;
  overflow: hidden;
}

.pp-virtualTourBody {
  padding: 14px 16px 16px;
}

.pp-section--virtualTour h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}

.pp-virtualTourCard {
  position: relative;
  margin: 0;
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  aspect-ratio: 16 / 9;
  max-height: 220px;
  cursor: pointer;
}

.pp-virtualTourCard--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.pp-virtualTourThumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.95;
}

.pp-virtualTourBadge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.pp-virtualTourBtn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.pp-virtualTourBtn:active {
  opacity: 0.92;
}

.pp-watermark {
  margin: 18px 12px 96px;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}

/* 일부 브라우저가 prefers-color-scheme: dark 로 배경·카드를 덮어쓰는 경우 대비 */
@media (prefers-color-scheme: dark) {
  :root {
    --pp-bg: #f5f6f8;
    --pp-card: #ffffff;
    --pp-text: #111111;
    --pp-muted: #6b7280;
    --pp-accent: #2563eb;
    --pp-border: #e5e7eb;
  }

  body.pp-body {
    background-color: #f5f6f8;
    color: #111827;
  }

  .pp-header,
  .pp-priceBar,
  .pp-section:not(.pp-section--virtualTour),
  .pp-listCard {
    background-color: #ffffff;
    color: #111827;
    border-color: #e5e7eb;
  }

  .pp-section h2,
  .pp-title {
    color: #111827;
  }

  .pp-row {
    border-bottom-color: #f3f4f6;
  }

  .pp-priceSub {
    color: #1d4ed8;
  }

  .pp-priceSub--muted {
    color: #374151;
  }

  .pp-badge {
    background: #eff6ff;
    color: #1d4ed8;
  }

  .pp-fab .pp-sms {
    background: #ffffff;
    color: #2563eb;
    border-color: #2563eb;
  }
}
