/* ==========================================================================
   property-detail.css — Rentadomus Property Detail Page
   Design language: Apple Liquid Glass
   Base: dark navy #0a0f1e, glassmorphism, SF Pro, #ff6b00 accent
   ========================================================================== */

/* ==========================================================================
   1. Page Background & Base
   ========================================================================== */
.property-detail-page {
  min-height: 100vh;
  background: radial-gradient(ellipse 80% 60% at 20% 10%, rgba(255, 107, 0,0.1) 0%, transparent 60%),
              radial-gradient(ellipse 60% 50% at 80% 80%, rgba(255, 138, 61,0.06) 0%, transparent 60%),
              #0a0f1e;
  color: #f5f5f7;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
}

/* Reset section defaults that conflict with global styles.css */
.property-detail-page section {
  height: auto;
  min-height: 0;
  display: block;
  align-items: initial;
  justify-content: initial;
  scroll-snap-align: none;
}

.property-detail-page [hidden] { display: none !important; }
.property-detail-page .hidden  { display: none !important; }

/* ==========================================================================
   2. Main Layout Container
   ========================================================================== */
.detail-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(80px, 10vh, 100px) 24px 60px;
}

/* ==========================================================================
   3. Top Bar & Back Link
   ========================================================================== */
.detail-topbar {
  margin-bottom: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.back-link:hover {
  background: rgba(255,255,255,0.1);
  color: #f5f5f7;
}

/* ==========================================================================
   4. Main Card — Two-Column Grid
   ========================================================================== */
.detail-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "media content"
    "bottom bottom";
  grid-template-rows: auto auto;
  gap: 24px;
  align-items: start;
}
.detail-media-column { grid-area: media; min-width: 0; }
.detail-content { grid-area: content; min-width: 0; }
.detail-bottom-row { grid-area: bottom; margin-top: 16px; }

/* ==========================================================================
   5. Media Column
   ========================================================================== */
.detail-media-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   6. Gallery — Hero mosaic + Lightbox (Airbnb-inspired)
   ========================================================================== */
.detail-gallery {
  position: relative;
  margin-bottom: 16px;
}
.detail-gallery--hero { margin-bottom: 20px; }

/* ── Hero mosaic (desktop / tablet) ── */
.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  height: clamp(360px, 56vh, 560px);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.hero-cell {
  position: relative;
  overflow: hidden;
  border: none;
  padding: 0;
  background: #0a0a0c;
  cursor: pointer;
  border-radius: 0;
  isolation: isolate;
}
.hero-cell--main {
  grid-row: 1 / span 2;
  grid-column: 1;
}
.hero-cell-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .55s cubic-bezier(.2,.7,.2,1), filter .35s ease;
}
.hero-cell:hover .hero-cell-img { transform: scale(1.045); filter: brightness(1.06); }
.hero-cell-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 167, 102,0) 0%, rgba(255, 107, 0,0) 100%);
  transition: background .25s ease;
  pointer-events: none;
}
.hero-cell:hover .hero-cell-overlay { background: linear-gradient(135deg, rgba(255, 167, 102,0.10) 0%, rgba(255, 107, 0,0.12) 100%); }
.hero-cell:focus-visible { outline: 3px solid #ffa766; outline-offset: -3px; }

/* +N more cell overlay */
.hero-cell--more .hero-more-count {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 22, 0.55);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  backdrop-filter: blur(2px);
}
.hero-cell--more.has-more .hero-more-count { display: flex; }

/* Show-all button (bottom-right of hero) */
.hero-show-all {
  position: absolute;
  bottom: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.92);
  color: #0a0a0c;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 4;
  transition: transform .15s ease, box-shadow .2s ease;
}
.hero-show-all:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

/* ── Mobile hero (single image, swipe) ── */
.hero-mobile {
  display: none;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #0a0a0c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.hero-mobile-track {
  display: flex;
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.hero-mobile-track::-webkit-scrollbar { display: none; }
.hero-mobile-track > img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  scroll-snap-align: start;
  display: block;
}
.hero-mobile-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
}

/* Mobile breakpoint: swap mosaic ↔ swipe */
@media (max-width: 720px) {
  .hero-grid { display: none; }
  .hero-mobile { display: block; }
}

/* Mobile nav arrows */
.hero-mobile .detail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.hero-mobile .detail-nav-prev { left: 10px; }
.hero-mobile .detail-nav-next { right: 10px; }

/* ── Lightbox ── */
.detail-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 12, 22, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  animation: lightbox-fade .25s ease-out;
}
.detail-lightbox[hidden] { display: none; }
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
  font-size: 1.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background .18s, transform .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.18); transform: scale(1.06); }
.lightbox-counter {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  z-index: 5;
}
.lightbox-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 80px 16px;
  min-height: 0;
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.7);
  animation: lightbox-img-in .35s ease-out;
}
@keyframes lightbox-img-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 1.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, transform .15s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); transform: translateY(-50%) scale(1.06); }
.lightbox-nav--prev { left: 18px; }
.lightbox-nav--next { right: 18px; }
.lightbox-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 24px 22px;
  justify-content: center;
  scrollbar-width: thin;
}
.lightbox-thumb {
  flex: 0 0 90px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #0a0a0c;
  padding: 0;
  transition: border-color .15s, transform .12s;
}
.lightbox-thumb:hover { transform: translateY(-2px); }
.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lightbox-thumb.is-active { border-color: #ffa766; box-shadow: 0 0 0 1px rgba(255, 167, 102,0.4); }

@media (max-width: 720px) {
  .lightbox-stage { padding: 60px 12px 12px; }
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.5rem; }
  .lightbox-nav--prev { left: 6px; }
  .lightbox-nav--next { right: 6px; }
  .lightbox-thumb { flex: 0 0 60px; height: 44px; }
}

/* Tablet adjustment of the hero grid */
@media (max-width: 1024px) and (min-width: 721px) {
  .hero-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 6px; }
  .hero-show-all { bottom: 14px; right: 14px; font-size: 0.8rem; padding: 8px 14px; }
}

/* ==========================================================================
   7. Map Block (Glass Card)
   ========================================================================== */
.detail-glass-block {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 20px;
}

.detail-map-block {
  /* inherits .detail-glass-block */
}

.detail-block-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.62);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
}

.detail-map-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.detail-map {
  width: 100%;
  height: 280px;
  background: rgba(255,255,255,0.04);
}
.detail-map-block {
  padding: 16px;
}

.detail-streetview-btn {
  z-index: 1000;
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18);
  color: #f5f5f7;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.detail-streetview-btn:hover {
  background: rgba(0,0,0,0.72);
}

/* ==========================================================================
   8. Content Column
   ========================================================================== */
.detail-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #f5f5f7;
}
@media (min-width: 1100px) {
  .detail-content {
    /* was position:sticky top:96px - the sticky right column overlapped the
       full-width map row below it (Leaflet panes painted over the listing).
       Normal flow: everything scrolls together, the map stays at the bottom. */
    position: static;
    align-self: flex-start;
  }
}

/* ==========================================================================
   8a. Badge
   ========================================================================== */
.detail-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 107, 0,0.15);
  border: 1px solid rgba(255, 107, 0,0.3);
  color: #ff8a3d;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
  width: fit-content;
}

/* ==========================================================================
   8b. Title / Location / Address / Date
   ========================================================================== */
#detail-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.15;
  color: #f5f5f7;
}

.detail-location {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.detail-address-inline {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.62);
  margin: 0;
}

.detail-created-at {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.62);
  margin: 0;
}

.detail-created-at strong {
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

/* ==========================================================================
   9. Price Block
   ========================================================================== */
.detail-price-card {
  background: linear-gradient(180deg, rgba(255, 107, 0, 0.08) 0%, rgba(255, 255, 255, 0.03) 60%);
  border: 1px solid rgba(255, 107, 0, 0.18);
  border-radius: 18px;
  padding: 18px 20px 16px;
  box-shadow: 0 14px 36px rgba(255, 107, 0, 0.07);
}
.detail-price-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.72rem;
  color: rgba(180, 220, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.detail-price {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f5f5f7;
  display: block;
  margin-top: 2px;
}

.detail-price-breakdown {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
}

.detail-price-row strong {
  color: rgba(255,255,255,0.8);
  font-weight: 600;
}

.detail-price-row.is-total {
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.detail-price-row.is-total strong {
  color: #f5f5f7;
}

/* ==========================================================================
   10. Metrics Strip (sqm / beds / baths)
   ========================================================================== */
.detail-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.metric {
  flex: 1;
  min-width: 80px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.62);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f5f5f7;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   11. Features Grid (JS-injected chips)
   ========================================================================== */
.detail-features-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-features-grid > * {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
}
.detail-features-grid .detail-feature-label {
  font-weight: 500;
  color: rgba(255,255,255,0.55);
}
.detail-features-grid .detail-feature-value {
  font-weight: 600;
  color: rgba(255,255,255,0.92);
}

/* Energy class — colored badge using the --energy-color variable */
.detail-features-grid .detail-feature-energy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 9px;
  background: var(--energy-color, #6c7a89);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

/* The wrapping chip for the energy feature gets a subtle glow tinted by the energy color */
.detail-features-grid .detail-feature:has(.detail-feature-energy) {
  border-color: color-mix(in srgb, var(--energy-color, #6c7a89) 35%, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--energy-color, #6c7a89) 6%, rgba(255,255,255,0.05));
}


/* ==========================================================================
   12. Description Block
   ========================================================================== */
.detail-description-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 18px 20px;
}

.detail-description {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

/* ==========================================================================
   13. Owner Actions Panel
   ========================================================================== */
.detail-owner-actions {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-status-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* Toggle switch */
.detail-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.detail-switch-track {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  position: relative;
  transition: background 0.2s;
}

.detail-switch[aria-pressed="true"] .detail-switch-track {
  background: #ffb340;
}

.detail-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.detail-switch[aria-pressed="true"] .detail-switch-thumb {
  transform: translateX(20px);
}

.detail-switch-text {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* ==========================================================================
   14. Action Buttons
   ========================================================================== */
.detail-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #f5f5f7;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.detail-action-btn:hover {
  background: rgba(255,255,255,0.12);
}

.detail-action-danger {
  background: rgba(255,59,48,0.1) !important;
  border-color: rgba(255,59,48,0.3) !important;
  color: #ff453a !important;
}

.detail-action-danger:hover {
  background: rgba(255,59,48,0.18) !important;
}

/* Header screening CTA (owner) */
.detail-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; }
.detail-head-text { min-width:0; flex:1 1 320px; }
.detail-screening-cta { display:inline-flex; align-items:center; gap:12px; flex:0 0 auto; text-decoration:none; padding:12px 16px; border-radius:14px; background:linear-gradient(135deg,#ff6b00,#ff8a3d); color:#fff; position:relative; box-shadow:0 6px 20px rgba(255, 107, 0,0.35); transition:filter .15s ease, transform .15s ease; }
.detail-screening-cta:hover { filter:brightness(1.06); transform:translateY(-1px); }
.detail-screening-cta .dsc-ic { display:inline-flex; opacity:0.95; }
.detail-screening-cta .dsc-body { display:flex; flex-direction:column; line-height:1.25; }
.detail-screening-cta .dsc-title { font-weight:700; font-size:0.95rem; }
.detail-screening-cta .dsc-sub { font-size:0.78rem; opacity:0.92; }
.detail-screening-cta .dsc-badge { position:absolute; top:-9px; right:-9px; min-width:22px; height:22px; padding:0 6px; border-radius:11px; background:#ff3b30; color:#fff; font-size:0.72rem; font-weight: 800; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 6px rgba(0,0,0,0.35); }
@media (max-width:640px){ .detail-screening-cta { width:100%; justify-content:flex-start; } }

.detail-action-accent {
  background: linear-gradient(135deg, #ff6b00, #ff8a3d) !important;
  border-color: transparent !important;
  color: #fff !important;
  font-weight: 700 !important;
}
.detail-action-accent:hover {
  filter: brightness(1.06);
}

/* ==========================================================================
   15. Apply Section
   ========================================================================== */
.apply-section {
  background: linear-gradient(135deg, rgba(255, 107, 0,0.14) 0%, rgba(255, 138, 61,0.06) 100%);
  border: 1px solid rgba(255, 107, 0,0.32);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  box-shadow: 0 12px 30px rgba(255, 107, 0, 0.1);
}

.apply-section .apply-btn,
.apply-section .nl-next-btn {
  height: 52px;
  width: 100%;
  padding: 0 24px;
  background: linear-gradient(135deg, #ff6b00 0%, #ff8a3d 100%);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 28px rgba(255, 107, 0, 0.4);
}
.apply-btn,
.nl-next-btn {
  height: 52px;
  padding: 0 32px;
  background: #ff6b00;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: -0.01em;
}

.apply-section .apply-btn:hover,
.apply-section .nl-next-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow: 0 14px 34px rgba(255, 107, 0, 0.48);
}
.apply-btn:hover,
.nl-next-btn:hover {
  background: #0066d6;
  transform: scale(1.02);
}

.apply-hint {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.62);
  margin: 0;
}

/* ==========================================================================
   16. Apply Status (tenant has already applied)
   ========================================================================== */
.apply-status {
  background: rgba(255, 138, 61,0.08);
  border: 1px solid rgba(255, 138, 61,0.2);
  border-radius: 16px;
  padding: 16px 18px;
}

.apply-status-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.apply-status-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.apply-status-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ff8a3d;
  margin: 0;
}

.apply-status-sub {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.62);
  margin: 0;
}

.nl-ghost-btn {
  margin-left: auto;
  flex-shrink: 0;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.nl-ghost-btn:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}

/* ==========================================================================
   17. Applications Panel (owner view)
   ========================================================================== */
.app-panel {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px;
}

.app-panel-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.62);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
}

.app-list {
  display: flex;
  flex-direction: column;
}

.app-empty {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.62);
  text-align: center;
  padding: 20px;
  margin: 0;
}

/* Application card (JS-injected via template#tpl-application-card) */
.app-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.app-card:last-child {
  margin-bottom: 0;
}

.app-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.app-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f5f5f7;
  display: block;
}

.app-household {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.62);
}

.app-score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 107, 0,0.12);
  border: 1px solid rgba(255, 107, 0,0.25);
  border-radius: 10px;
  padding: 6px 10px;
  flex-shrink: 0;
}

.app-score-num {
  font-size: 1rem;
  font-weight: 700;
  color: #ff6b00;
  line-height: 1;
}

.app-score-label {
  font-size: 0.65rem;
  color: rgba(255, 107, 0,0.7);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.app-card-body {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-employment,
.app-income,
.app-date {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.62);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 3px 8px;
}

/* ==========================================================================
   18. Empty State
   ========================================================================== */
.detail-empty {
  text-align: center;
  padding: 100px 20px;
  color: rgba(255,255,255,0.62);
}

.detail-empty h1 {
  font-size: 1.5rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 12px;
}

/* ==========================================================================
   19. Confirm / Success Overlay & Modal
   ========================================================================== */
.detail-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.detail-confirm-panel {
  position: relative;
  z-index: 1;
  background: rgba(18,26,46,0.98);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 32px;
  width: min(440px, 90vw);
  box-shadow: 0 40px 120px rgba(0,0,0,0.8);
}

.detail-success-panel {
  border-color: rgba(255, 138, 61,0.25);
}

.detail-confirm-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f5f5f7;
  margin: 0 0 10px;
}

.detail-confirm-text {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  margin: 0 0 24px;
}

.detail-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.detail-confirm-cancel {
  background: transparent !important;
  color: rgba(255,255,255,0.5) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

/* ==========================================================================
   20. Action Toast
   ========================================================================== */
.detail-action-toast {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 900;
  background: rgba(28,34,52,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 0.875rem;
  color: #f5f5f7;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* ==========================================================================
   21. Responsive Breakpoints
   ========================================================================== */

/* Tablet / narrow desktop: stack to single column */
@media (max-width: 900px) {
  .detail-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "media"
      "content"
      "bottom";
    grid-template-rows: auto auto auto;
  }

  .detail-media-column { order: 1; }
  .detail-content     { order: 2; }

  .detail-main {
    padding: 80px 16px 60px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .detail-metrics {
    gap: 8px;
  }

  .metric {
    padding: 10px 12px;
  }

  .apply-btn {
    width: 100%;
    text-align: center;
  }

  .apply-section {
    padding: 18px;
  }

  .detail-confirm-panel {
    padding: 24px;
  }

  .detail-confirm-actions {
    flex-direction: column-reverse;
  }

  .detail-confirm-actions .detail-action-btn {
    width: 100%;
  }

  .detail-action-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}

/* ════════════════════════════════════════════════════════════════
   Map block moved to the bottom of the listing — full-width row
   ════════════════════════════════════════════════════════════════ */
.detail-bottom-row {
  grid-column: 1 / -1;   /* span all columns in the detail-card grid */
  width: 100%;
  margin-top: 8px;
}
.detail-bottom-row .detail-map-block {
  width: 100%;
}
.detail-bottom-row .detail-map,
.detail-bottom-row .detail-map-wrapper {
  width: 100%;
  height: 360px;
  min-height: 280px;
}
@media (max-width: 900px) {
  .detail-bottom-row .detail-map,
  .detail-bottom-row .detail-map-wrapper { height: 280px; }
}

/* ════════════════════════════════════════════════════════════════
   Custom property pin — clearly visible on dark CARTO tiles
   ════════════════════════════════════════════════════════════════ */
.pd-pin-wrap { background: transparent !important; border: none !important; }
.pd-pin {
  position: relative;
  width: 44px;
  height: 56px;
}
.pd-pin-dot {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b00 0%, #ff8a3d 50%, #ffa766 100%);
  border: 3px solid #fff;
  box-shadow:
    0 4px 16px rgba(255, 107, 0, 0.55),
    0 0 0 2px rgba(0, 0, 0, 0.25);
  z-index: 2;
}
.pd-pin-dot::after {
  /* white inner dot for contrast */
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
}
.pd-pin::after {
  /* pin tip pointing down to the exact coordinates */
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 12px;
  height: 22px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ff8a3d 0%, #ff6b00 100%);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  z-index: 1;
}
.pd-pin-ring {
  /* animated pulse ring */
  position: absolute;
  top: 4px;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 167, 102, 0.7);
  animation: pd-pin-pulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes pd-pin-pulse {
  0%   { transform: translateX(-50%) scale(1);   opacity: 0.7; }
  70%  { transform: translateX(-50%) scale(2.2); opacity: 0; }
  100% { transform: translateX(-50%) scale(2.2); opacity: 0; }
}


/* Vicinanze v2: pannello a fianco della mappa, icone per categoria,
   hover -> marker sulla mappa */
.detail-map-flex { display: flex; gap: 18px; align-items: stretch; }
.detail-map-flex .detail-map-wrapper { flex: 1; min-width: 0; display: flex; height: auto; min-height: 380px; }
.detail-map-flex .detail-map { flex: 1; height: auto; min-height: 380px; }
.detail-poi { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; }
.detail-poi-title { font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(234,246,255,0.85); margin: 2px 0 10px; }
.detail-poi-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.detail-poi-list li > * { pointer-events: none; }
.detail-poi-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: background .18s ease, border-color .18s ease; }
.detail-poi-list li:hover, .detail-poi-list li:focus-visible { background: rgba(255, 167, 102,0.07); border-color: rgba(255, 167, 102,0.25); outline: none; }
.detail-poi-ic { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; }
.detail-poi-ic svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.35)); }
.detail-poi-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.detail-poi-type { font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(234,246,255,0.55); }
.detail-poi-name { font-size: 13.5px; font-weight: 600; color: rgba(234,246,255,0.92); line-height: 1.3; }
.detail-poi-dist { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; color: #ffa766; white-space: nowrap; }
.detail-poi-hint { margin: 10px 2px 0; font-size: 11.5px; color: rgba(234,246,255,0.45); }
/* marker del POI sulla mappa */
.detail-poi-marker-pin { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #fff; padding: 3px; box-shadow: 0 6px 18px rgba(0,0,0,0.45), 0 0 0 1px rgba(0,0,0,0.08); }
.detail-poi-marker-pin svg { width: 100%; height: 100%; }
@media (max-width: 900px) {
  .detail-map-flex { flex-direction: column; }
  .detail-poi { width: 100%; }
  .detail-poi-hint { display: none; }
}
