*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: #1a1a2e; background: #fff; line-height: 1.7; font-size: 16px;
  -webkit-font-smoothing: antialiased; padding-bottom: 80px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

:root {
  --primary: #1066f3;
  --primary-light: #e8f1fe;
  --primary-dark: #0a4fbd;
  --accent: #f97316;
  --gray-50: #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0;
  --gray-300: #cbd5e1; --gray-400: #94a3b8; --gray-500: #64748b;
  --gray-600: #475569; --gray-700: #334155; --gray-800: #1e293b; --gray-900: #0f172a;
  --radius: 16px; --radius-sm: 10px; --radius-xs: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --container: 860px;
}
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ===== NAV ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-200); height: 56px;
  display: flex; align-items: center; padding: 0 20px;
}
.nav-back {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--gray-600);
  cursor: pointer; transition: color 0.2s;
}
.nav-back:hover { color: var(--primary); }
.nav-logo {
  margin-left: auto; font-size: 14px; font-weight: 700; color: var(--primary);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; padding: 14px 0;
  font-size: 13px; color: var(--gray-400); flex-wrap: wrap;
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .current { color: var(--gray-700); font-weight: 600; }

/* ===== GALLERY ===== */
.gallery { margin-bottom: 0; }
.gallery-hero {
  width: 100%; aspect-ratio: 16/9; border-radius: var(--radius);
  overflow: hidden; cursor: pointer; position: relative; background: var(--gray-100);
}
.gallery-hero img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.gallery-hero:hover img { transform: scale(1.03); }
.gallery-count {
  position: absolute; bottom: 12px; right: 12px;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
}
.gallery-thumbs {
  display: flex; gap: 8px; margin-top: 8px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb {
  flex-shrink: 0; width: 100px; height: 68px; border-radius: var(--radius-xs);
  overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s;
  background: var(--gray-100);
}
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--primary); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ===== PRICE HERO ===== */
.price-hero {
  padding: 28px 0 24px; border-bottom: 1px solid var(--gray-200);
}
.price-badges { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.price-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.badge-sale { background: var(--primary-light); color: var(--primary); }
.badge-new { background: #fef3c7; color: #b45309; }
.price-name {
  font-size: clamp(22px, 4vw, 28px); font-weight: 800; color: var(--gray-900);
  margin-bottom: 4px; letter-spacing: -0.03em;
}
.price-address { font-size: 14px; color: var(--gray-500); margin-bottom: 16px; }
.price-main {
  font-size: clamp(28px, 5vw, 36px); font-weight: 900; color: var(--primary);
  letter-spacing: -0.03em; margin-bottom: 4px;
}
.price-main .type { font-size: 16px; font-weight: 600; color: var(--gray-500); margin-right: 8px; }
.price-sub { font-size: 14px; color: var(--gray-400); }
.price-sub strong { color: var(--gray-600); }

/* ===== INFO GRID ===== */
.info-section { padding: 28px 0; border-bottom: 1px solid var(--gray-100); }
.info-section-title {
  font-size: 18px; font-weight: 800; color: var(--gray-900); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.info-section-title .material-symbols-outlined { font-size: 22px; color: var(--primary); }
.info-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--gray-100); border-radius: var(--radius-sm); overflow: hidden;
}
.info-item {
  background: #fff; padding: 16px; display: flex; flex-direction: column; gap: 4px;
}
.info-label { font-size: 12px; color: var(--gray-400); font-weight: 500; }
.info-value { font-size: 15px; font-weight: 700; color: var(--gray-800); }

/* ===== DESCRIPTION ===== */
.description { padding: 28px 0; border-bottom: 1px solid var(--gray-100); }
.description p {
  font-size: 15px; color: var(--gray-600); line-height: 1.9; margin-bottom: 12px;
}

/* ===== COMPLEX INFO ===== */
.complex-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.complex-item {
  background: var(--gray-50); border-radius: var(--radius-xs); padding: 14px 16px;
}
.complex-item .label { font-size: 12px; color: var(--gray-400); margin-bottom: 2px; }
.complex-item .value { font-size: 14px; font-weight: 700; color: var(--gray-800); }

/* ===== MAP ===== */
.map-placeholder {
  width: 100%; height: 240px; border-radius: var(--radius-sm);
  background: var(--gray-100); display: flex; align-items: center;
  justify-content: center; flex-direction: column; gap: 8px; color: var(--gray-400);
  margin-bottom: 20px;
}
.transport-list { display: flex; flex-direction: column; gap: 10px; }
.transport-item {
  display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--gray-600);
}
.transport-icon {
  width: 32px; height: 32px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  flex-shrink: 0;
}
.transport-icon.subway { background: #dbeafe; color: #1d4ed8; }
.transport-icon.bus { background: #dcfce7; color: #16a34a; }
.transport-icon.school { background: #fef9c3; color: #a16207; }
.transport-icon.amenity { background: #f3e8ff; color: #7c3aed; }

/* ===== PRICE TABLE ===== */
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-table th {
  background: var(--gray-50); padding: 10px 12px; font-weight: 600;
  color: var(--gray-500); text-align: left; border-bottom: 2px solid var(--gray-200);
  font-size: 12px; white-space: nowrap;
}
.price-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700); white-space: nowrap;
}
.price-table td.price { font-weight: 700; color: var(--primary); }
.nearby-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.nearby-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: var(--gray-50); border-radius: var(--radius-xs);
}
.nearby-name { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.nearby-sub { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.nearby-price { font-size: 16px; font-weight: 800; color: var(--primary); text-align: right; }
.nearby-price-sub { font-size: 11px; color: var(--gray-400); }

/* ===== AGENT ===== */
.agent-card {
  display: flex; gap: 16px; align-items: center; padding: 20px;
  background: var(--gray-50); border-radius: var(--radius); margin-bottom: 16px;
}
.agent-photo {
  width: 64px; height: 64px; border-radius: 50%; background: var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--gray-400); flex-shrink: 0; overflow: hidden;
}
.agent-photo img { width: 100%; height: 100%; object-fit: cover; }
.agent-name { font-size: 17px; font-weight: 800; color: var(--gray-900); }
.agent-office { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.agent-phone { font-size: 14px; color: var(--primary); font-weight: 600; margin-top: 4px; }
.agent-hours { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.agent-btns { display: flex; gap: 10px; }
.agent-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.agent-btn-call { background: var(--primary); color: #fff; }
.agent-btn-call:hover { background: var(--primary-dark); }
.agent-btn-kakao { background: #fee500; color: #191919; }
.agent-btn-kakao:hover { background: #fdd835; }

/* ===== LEGAL ===== */
.legal {
  padding: 24px 0; margin-top: 12px;
}
.legal-title { font-size: 14px; font-weight: 700; color: var(--gray-500); margin-bottom: 8px; }
.legal-text { font-size: 12px; color: var(--gray-400); line-height: 1.8; }

/* ===== MOBILE STICKY BAR ===== */
.sticky-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: #fff; border-top: 1px solid var(--gray-200); padding: 10px 16px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.sticky-bar-inner { display: flex; gap: 8px; max-width: var(--container); margin: 0 auto; }
.sticky-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; border-radius: var(--radius-xs); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; border: none;
}
.sticky-btn-call { background: var(--primary); color: #fff; }
.sticky-btn-kakao { background: #fee500; color: #191919; }
.sticky-btn-inquiry { background: var(--gray-100); color: var(--gray-700); }

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.92); align-items: center; justify-content: center;
  flex-direction: column; cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 80vh; object-fit: contain; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; color: #fff; font-size: 32px;
  cursor: pointer; width: 44px; height: 44px; display: flex;
  align-items: center; justify-content: center;
}
.lightbox-nav {
  display: flex; gap: 16px; margin-top: 16px;
}
.lightbox-nav button {
  background: rgba(255,255,255,0.15); color: #fff; border: none;
  width: 44px; height: 44px; border-radius: 50%; font-size: 20px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lightbox-nav button:hover { background: rgba(255,255,255,0.3); }
.lightbox-counter { color: rgba(255,255,255,0.6); font-size: 13px; margin-top: 8px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .sticky-bar { display: block; }
  body { padding-bottom: 140px; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .complex-grid { grid-template-columns: 1fr; }
  .agent-btns { flex-direction: column; }
  .gallery-hero { border-radius: 0; }
  .container { padding: 0 16px; }
  .price-table { font-size: 13px; }
  .price-table th, .price-table td { padding: 8px; }
}
