.detail-page {
  width: min(1240px, calc(100% - 1.2rem));
  margin: 1rem auto 1.6rem;
}

.detail-page,
.detail-page * {
  box-sizing: border-box;
}

.detail-shell {
  border-radius: 24px;
  border: 1px solid rgba(16, 38, 70, 0.13);
  background:
    radial-gradient(circle at 0% 0%, rgba(31, 92, 168, 0.09), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(242, 107, 29, 0.08), transparent 28%),
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 38px rgba(10, 27, 50, 0.14);
  backdrop-filter: blur(4px);
}

.detail-topbar {
  margin-bottom: 1rem;
  padding: 0.88rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #244a7a;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid rgba(31, 73, 131, 0.18);
  background: #f8fbff;
  border-radius: 999px;
  padding: 0.46rem 0.78rem;
}

.detail-back:hover {
  background: #eef5ff;
}

.detail-code {
  color: #59708e;
  font-size: 0.82rem;
  font-weight: 700;
}

.detail-main-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  margin-bottom: 1rem;
}

.detail-gallery {
  padding: 1rem;
}

.detail-gallery-main {
  position: relative;
  overflow: hidden;
  border-radius: 17px;
  border: 1px solid rgba(22, 58, 105, 0.13);
  background: #e6eef9;
  height: clamp(320px, 56vh, 560px);
  touch-action: pan-y;
}

.detail-main-image,
.detail-gallery-empty {
  width: 100%;
  height: 100%;
}

.detail-main-image {
  object-fit: cover;
  display: block;
  user-select: none;
  transition: transform 0.3s ease;
}

.detail-gallery-main:hover .detail-main-image {
  transform: scale(1.02);
}

.detail-gallery-empty {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #6d829f;
  background: linear-gradient(145deg, #dce7f8 0%, #f2f7ff 100%);
}

.detail-gallery-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 24, 48, 0.08) 38%, rgba(8, 24, 48, 0.62) 100%);
}

.detail-kind-badge {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 3;
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 28, 55, 0.76);
  padding: 0.35rem 0.58rem;
  font-weight: 700;
}

.detail-gallery-count {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 3;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 25, 46, 0.58);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.24rem 0.5rem;
}

.detail-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(8, 31, 60, 0.66);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translateY(-50%);
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
}

.detail-gallery-nav:hover {
  background: rgba(242, 107, 29, 0.92);
}

.detail-gallery-nav--prev {
  left: 0.62rem;
}

.detail-gallery-nav--next {
  right: 0.62rem;
}

.detail-thumbs {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.42rem;
}

.detail-thumb {
  border: 1px solid #d6e0ef;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: #eef4fd;
  opacity: 0.68;
  transition: border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.detail-thumb:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.detail-thumb.is-active {
  opacity: 1;
  border-color: var(--ra-brand-primary, #1f5ca8);
  box-shadow: 0 0 0 2px rgba(31, 92, 168, 0.2);
}

.detail-thumb img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  display: block;
}

.detail-info {
  padding: 1rem;
  position: sticky;
  top: calc(var(--site-header-offset, 132px) + 0.75rem);
  height: fit-content;
}

.detail-kicker {
  margin: 0;
  color: #4f6787;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
}

.detail-title {
  margin: 0.38rem 0 0;
  font-family: var(--ra-body-font, "Manrope"), "Segoe UI", sans-serif;
  color: #12315b;
  font-size: clamp(1.45rem, 2.6vw, 2.2rem);
  line-height: 1.15;
}

.detail-address {
  margin: 0.62rem 0 0;
  color: #5f7390;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.detail-price {
  margin: 0.86rem 0 0;
  color: var(--ra-brand-primary, #1f5ca8);
}

.detail-price span {
  display: block;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.05;
}

.detail-price em {
  display: block;
  margin-top: 0.26rem;
  color: #5c6f89;
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 600;
}

.detail-info .ra-card-specs {
  margin-top: 0.8rem;
}

.detail-meta-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.detail-meta-item {
  border-radius: 12px;
  border: 1px solid #d9e3f2;
  background: #f8fbff;
  padding: 0.56rem 0.62rem;
}

.detail-meta-item span {
  display: block;
  color: #60728c;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-meta-item strong {
  display: block;
  margin-top: 0.1rem;
  color: #1f3e66;
  font-size: 0.95rem;
}

.detail-description {
  margin-top: 0.95rem;
}

.detail-description h2 {
  margin: 0;
  color: #1d3d66;
  font-size: 1.08rem;
  font-family: var(--ra-body-font, "Manrope"), "Segoe UI", sans-serif;
}

.detail-description p {
  margin: 0.46rem 0 0;
  line-height: 1.68;
  color: #4e627f;
}

.detail-agent {
  margin-top: 0.95rem;
}

.detail-agent h2 {
  margin: 0;
  color: #1d3d66;
  font-size: 1.08rem;
  font-family: var(--ra-body-font, "Manrope"), "Segoe UI", sans-serif;
}

.detail-agent-card {
  margin-top: 0.5rem;
  border: 1px solid #d9e3f2;
  border-radius: 14px;
  background: #f8fbff;
  padding: 0.85rem 0.75rem;
  text-align: center;
}

.detail-agent-photo {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(31, 92, 168, 0.16);
  box-shadow: 0 10px 18px rgba(15, 44, 82, 0.18);
}

.detail-agent-photo--empty {
  display: inline-grid;
  place-items: center;
  background: linear-gradient(145deg, #dce7f8 0%, #f2f7ff 100%);
  color: #365b89;
  font-size: 1.6rem;
}

.detail-agent-name {
  margin: 0.56rem 0 0;
  color: #12315b;
  font-size: 1rem;
  font-weight: 800;
}

.detail-agent-role {
  margin: 0.15rem 0 0;
  color: #667c99;
  font-size: 0.84rem;
  font-weight: 600;
}

.detail-agent-links {
  margin-top: 0.56rem;
  display: grid;
  gap: 0.35rem;
}

.detail-agent-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  color: #1f5ca8;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.detail-agent-link:hover {
  text-decoration: underline;
}

.detail-agent-missing {
  margin: 0;
  color: #5f7390;
  font-size: 0.84rem;
}

.detail-copy-toast {
  position: fixed;
  left: 50%;
  top: 48px;
  transform: translate(-50%, -100%) translateY(10px);
  background: rgba(9, 31, 58, 0.94);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.52rem 0.86rem;
  font-size: 0.83rem;
  font-weight: 700;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1200;
  pointer-events: none;
}

.detail-copy-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -100%) translateY(0);
}

.detail-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.6rem 0.82rem;
}

.detail-btn--primary {
  color: #fff;
  background: linear-gradient(100deg, var(--ra-brand-primary, #1f5ca8), var(--ra-brand-secondary, #27afc9));
  border-color: rgba(11, 44, 84, 0.22);
}

.detail-btn--ghost {
  color: #2e4f79;
  background: #f6f9ff;
  border-color: #d8e2f0;
}

.detail-map-shell,
.detail-related {
  padding: 1rem;
  margin-bottom: 1rem;
}

.detail-section-head h2 {
  margin: 0.35rem 0 0;
  color: #0f2d55;
  font-family: var(--ra-body-font, "Manrope"), "Segoe UI", sans-serif;
  font-size: clamp(1.3rem, 2.5vw, 1.95rem);
  line-height: 1.2;
}

.detail-map {
  margin-top: 0.88rem;
  border-radius: 16px;
  border: 1px solid #d2deee;
  overflow: hidden;
  height: 360px;
  background: linear-gradient(155deg, #e7effa, #f7faff);
}

.detail-map-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: #566b89;
  font-weight: 600;
}

.detail-related-grid {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-related-card {
  width: 100%;
  min-height: 100%;
}

.detail-related-media {
  height: 190px;
}

.detail-related-address {
  margin: 0.62rem 0 0;
  color: #5d718d;
  font-size: 0.83rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

@media (max-width: 1180px) {
  .detail-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .detail-main-grid {
    grid-template-columns: 1fr;
  }

  .detail-info {
    position: static;
  }
}

@media (max-width: 760px) {
  .detail-page {
    width: min(1240px, calc(100% - 0.86rem));
  }

  .detail-shell {
    border-radius: 16px;
  }

  .detail-gallery,
  .detail-info,
  .detail-map-shell,
  .detail-related {
    padding: 0.86rem;
  }

  .detail-thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail-map {
    height: 300px;
  }

  .detail-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .detail-topbar {
    padding: 0.74rem;
  }

  .detail-code {
    display: none;
  }

  .detail-gallery-main {
    height: 280px;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr;
  }

  .detail-related-grid {
    grid-template-columns: 1fr;
  }
}
