/* Property detail page (/propiedad/{slug}) */
.pd {
  --pd-ink: #17181a;
  --pd-muted: #6b6f6c;
  --pd-soft: #8a8d89;
  --pd-line: #e4e2dc;
  --pd-card: #fff;
  --pd-tint: #ecebe5;
  --pd-radius: 22px;
  color: var(--pd-ink);
  padding-bottom: 40px;
}
.pd h1, .pd h2, .pd h3 { color: var(--pd-ink); }

/* Breadcrumbs */
.pd-crumbs {
  padding-top: 104px;
  padding-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--pd-soft);
}
.pd-crumbs a { color: var(--pd-muted); text-decoration: none; }
.pd-crumbs a:hover { color: var(--pd-ink); text-decoration: underline; }
.pd-crumbs strong { color: var(--pd-ink); font-weight: 500; }

/* Gallery */
.pd-gallery {
  position: relative;
  display: grid;
  gap: 8px;
  height: clamp(380px, 46vw, 600px);
  border-radius: var(--pd-radius);
  overflow: hidden;
}
.pd-gallery > button:not(.pd-gallery__all) {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--pd-tint);
  cursor: zoom-in;
}
.pd-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .9s cubic-bezier(.22, 1, .36, 1);
}
.pd-gallery > button:not(.pd-gallery__all):hover img { transform: scale(1.03); }
.pd-gallery > button:focus-visible { outline: 3px solid var(--pd-ink); outline-offset: -3px; }

.pd-gallery--1 { grid-template-columns: 1fr; }
.pd-gallery--2 { grid-template-columns: 1fr 1fr; }
.pd-gallery--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.pd-gallery--3 > button:first-child { grid-row: 1 / 3; }
.pd-gallery--4 { grid-template-columns: 2fr 1fr; grid-template-rows: repeat(3, 1fr); }
.pd-gallery--4 > button:first-child { grid-row: 1 / 4; }
.pd-gallery--5 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pd-gallery--5 > button:first-child { grid-row: 1 / 3; }

.pd-gallery__all {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--pd-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(20, 22, 24, .18);
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.pd-gallery__all:hover { background: #fff; }
.pd-gallery__tag {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 2;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--pd-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  pointer-events: none;
}

/* Heading */
.pd-head {
  padding: 40px 0 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.pd-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.pd-chips li {
  padding: 6px 12px;
  border: 1px solid var(--pd-line);
  border-radius: 999px;
  background: var(--pd-card);
  font-size: 12.5px;
  font-weight: 500;
  color: #3d403d;
}
.pd-chips li.is-ok { border-color: #cfe0cf; background: #eef5ec; color: #2d5a39; }
.pd-head h1 {
  margin: 0 0 12px;
  font-family: 'DM Serif Display', serif;
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.035em;
}
.pd-address {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--pd-muted);
  font-size: 15px;
}
.pd-price { flex: none; text-align: right; }
.pd-price small { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--pd-soft); }
.pd-price strong { display: block; font-size: clamp(30px, 3vw, 40px); font-weight: 600; letter-spacing: -.03em; line-height: 1.05; }
.pd-price span { display: block; margin-top: 6px; color: var(--pd-muted); font-size: 14px; }

/* Key specs */
.pd-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pd-specs li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--pd-card);
  border: 1px solid var(--pd-line);
  border-radius: 16px;
}
.pd-specs .pd-ico {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--pd-tint);
  color: var(--pd-ink);
}
.pd-specs strong { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.pd-specs span:not(.pd-ico) { display: block; font-size: 13px; color: var(--pd-muted); }

/* Body layout */
.pd-layout {
  padding-block: 56px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.pd-main { display: flex; flex-direction: column; gap: 56px; min-width: 0; }
.pd-section-title {
  margin: 0 0 18px;
  font-family: 'DM Serif Display', serif;
  font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.pd-eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--pd-soft); }
.pd-desc p { max-width: 720px; margin: 0; color: #4f5451; font-size: 16px; line-height: 1.75; }
.pd-desc p + p { margin-top: 16px; }

.pd-amenities { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.pd-amenities li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--pd-line);
  border-radius: 14px;
  background: var(--pd-card);
  font-size: 15px;
  font-weight: 500;
}
.pd-amenities svg { color: #2d5a39; flex: none; }

/* Location */
.pd-map {
  position: relative;
  height: 360px;
  border-radius: var(--pd-radius);
  overflow: hidden;
  background-color: #e3e5df;
  border: 1px solid var(--pd-line);
}
.pd-map__canvas { position: absolute; inset: 0; z-index: 0; }
.pd-map .leaflet-container { font: inherit; background: #e3e5df; }
.pd-map__note {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
  color: var(--pd-muted);
  font-size: 12.5px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(20, 22, 24, .12);
}
.pd-loc-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 16px; color: var(--pd-muted); font-size: 15px; }
.pd-loc-meta b { color: var(--pd-ink); font-weight: 600; }

/* Facts partial inside the main column */
.pd-main .bk-facts { padding: 0; }
.pd-main .bk-facts .market-wrap { width: auto; }
.pd-main .bk-facts__grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px 48px; }

/* Contact sidebar */
.pd .bk-contact { top: 96px; }
.pd-card-price { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid #efefec; }
.pd-card-price strong { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.pd-card-price span { font-size: 13px; color: var(--pd-muted); }

/* Related */
.pd .related-properties { border-radius: 32px 32px 0 0; }

/* Lightbox */
.pd-viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0f1214;
  color: #fff;
}
.pd-viewer::backdrop { background: #0f1214; }
.pd-viewer[open] { display: grid; grid-template-columns: 64px 1fr 64px; grid-template-rows: 64px 1fr; align-items: center; }
.pd-viewer__bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-size: 14px; color: #c9ccc8; }
.pd-viewer img { grid-row: 2; grid-column: 2; width: 100%; height: calc(100vh - 100px); object-fit: contain; }
.pd-viewer button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  justify-self: center;
}
.pd-viewer button:hover { background: rgba(255,255,255,.1); }
.pd-viewer [data-prev] { grid-row: 2; grid-column: 1; }
.pd-viewer [data-next] { grid-row: 2; grid-column: 3; }
.pd-viewer [data-prev] svg { transform: rotate(180deg); }

/* Mobile CTA */
.pd-mobile-cta { display: none; }

@media (max-width: 1020px) {
  .pd-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 920px) {
  .pd-layout { grid-template-columns: 1fr; }
  .pd .bk-contact { position: static; }
  .pd-mobile-cta {
    position: fixed;
    z-index: 55;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 16px max(10px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(245, 243, 238, .96);
    border-top: 1px solid var(--pd-line);
    backdrop-filter: blur(14px);
  }
  .pd-mobile-cta strong { display: block; font-size: 18px; }
  .pd-mobile-cta small { color: var(--pd-muted); font-size: 12px; }
  .pd-mobile-cta a {
    min-height: 48px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    border-radius: 12px;
    background: var(--pd-ink);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
  }
  .pd { padding-bottom: 90px; }
}
@media (max-width: 700px) {
  .pd-crumbs { padding-top: 84px; font-size: 12.5px; }
  .pd-gallery {
    height: 340px;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-radius: 18px;
  }
  .pd-gallery > button:not(.pd-gallery__all) { flex: 0 0 100%; scroll-snap-align: center; }
  .pd-gallery__all { position: absolute; }
  .pd-head { display: block; padding: 28px 0 24px; }
  .pd-price { text-align: left; margin-top: 20px; }
  .pd-specs { grid-template-columns: 1fr 1fr; }
  .pd-specs li { padding: 14px; gap: 10px; }
  .pd-specs .pd-ico { width: 36px; height: 36px; }
  .pd-layout { padding-block: 40px 64px; }
  .pd-main { gap: 44px; }
  .pd-map { height: 280px; }
  .pd-viewer[open] { grid-template-columns: 52px 1fr 52px; }
}
