/* ========================================================
   PROPERTY DETAIL — Editorial line
   --------------------------------------------------------
   Detail page for a single listing. Uses base.css tokens
   and reads visually like the rest of the editorial pages:
   Inter throughout, weight + color carry the hierarchy on
   title and price, glass panels on the dark
   surface, no admin-template chrome.
   ======================================================== */

/* ===== Page shell ===== */
.prop-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
  position: relative;
  z-index: 1;
}

/* ===== Breadcrumb ===== */
.prop-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: var(--ed-body);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.25rem 0 1.5rem;
}
.prop-breadcrumb a {
  color: var(--text-secondary);
  transition: color 0.2s;
}
.prop-breadcrumb a:hover { color: var(--primary-light); }
.prop-breadcrumb__sep { color: var(--text-muted); opacity: 0.5; }
.prop-breadcrumb span:last-child { color: var(--text-primary); }

/* ===== Loading state ===== */
.prop-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  color: var(--text-muted);
  font-family: var(--ed-body);
}

/* ===== Two-column grid ===== */
.prop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 2rem;
  align-items: start;
}

.prop-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.prop-aside {
  position: sticky;
  top: 90px;
  align-self: start;
}

/* ===== Editorial header ===== */
.prop-head {
  position: relative;
  padding-bottom: 1.25rem;
  margin-bottom: 0.5rem;
}
.prop-head::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: clamp(160px, 28%, 320px);
  height: 1px;
  background: var(--ed-thread);
}

.property-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--ed-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}
.property-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.property-badge.sale {
  color: var(--primary-light);
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.25);
}

.prop-title {
  font-family: var(--ed-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 3.6vw, 2.85rem);
  line-height: 1.1;
  letter-spacing: -0.032em;
  color: var(--text-primary);
  margin: 0 0 0.85rem;
}

.prop-address {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ed-body);
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}
.prop-address svg { color: var(--primary-light); flex-shrink: 0; }

/* ===== Gallery ===== */
.prop-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.prop-gallery__main {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--ed-rule-soft);
}
.prop-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prop-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-primary);
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 2;
}
.prop-gallery__main:hover .prop-gallery__nav { opacity: 1; }
.prop-gallery__nav:hover {
  background: rgba(124, 58, 237, 0.4);
  border-color: rgba(167, 139, 250, 0.6);
  transform: translateY(-50%) scale(1.08);
}
.prop-gallery__nav.prev { left: 1rem; }
.prop-gallery__nav.next { right: 1rem; }

.prop-gallery__counter {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  padding: 0.35rem 0.8rem;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--ed-rule-mid);
  border-radius: 999px;
  font-family: var(--ed-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  z-index: 2;
}

.gallery-actions {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}
.gallery-action-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--ed-rule-mid);
  border-radius: 999px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s ease;
}
.gallery-action-btn:hover {
  background: rgba(124, 58, 237, 0.35);
  border-color: rgba(167, 139, 250, 0.5);
  transform: translateY(-2px);
}
.gallery-action-btn.favorite.active {
  background: rgba(244, 114, 182, 0.2);
  border-color: rgba(244, 114, 182, 0.5);
}

/* Thumbnails */
.prop-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
}
.gallery-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ed-rule-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.55;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-thumb:hover { opacity: 0.85; transform: translateY(-2px); }
.gallery-thumb.active {
  opacity: 1;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.4);
}

/* Empty gallery */
.no-images {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
}
.no-images-icon { font-size: 2.5rem; opacity: 0.5; }

/* ===== Editorial panels ===== */
.prop-panel {
  background: var(--ed-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--ed-rule-soft);
  border-radius: 18px;
  padding: 1.5rem 1.75rem;
  position: relative;
}

.prop-section-title {
  font-family: var(--ed-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.018em;
  color: var(--text-primary);
  margin: 0 0 1rem;
  position: relative;
  padding-bottom: 0.85rem;
}
.prop-section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 1px;
  background: var(--primary-light);
  opacity: 0.55;
}

/* ===== Price + features ===== */
.prop-panel--summary {
  padding: 1.6rem 1.75rem;
}
.prop-price-block { margin-bottom: 1.5rem; }
.prop-price {
  font-family: var(--ed-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin: 0 0 0.35rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.prop-price span {
  font-family: var(--ed-body);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}
.prop-price-detail {
  font-family: var(--ed-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.prop-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ed-rule-soft);
}
.prop-feature {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}
.prop-feature__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 10px;
  color: var(--primary-light);
  margin-bottom: 0.45rem;
}
.prop-feature__value {
  font-family: var(--ed-display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.022em;
}
.prop-feature__label {
  font-family: var(--ed-body);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ===== Description ===== */
.prop-description {
  font-family: var(--ed-body);
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-line;
  margin: 0;
}

/* ===== Amenities ===== */
.prop-amenities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.7rem;
}
.amenity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--ed-rule-soft);
  border-radius: 10px;
  font-family: var(--ed-body);
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}
.amenity:hover {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(167, 139, 250, 0.25);
  color: var(--text-primary);
}
.amenity-icon { font-size: 1.1rem; line-height: 1; }

/* ===== Map ===== */
.prop-map {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--ed-rule-soft);
  background: rgba(17, 24, 39, 0.5);
}
/* Leaflet's container needs a non-default background to look right on dark theme */
.prop-map .leaflet-container {
  background: rgba(17, 24, 39, 0.8);
  font-family: var(--ed-body);
}
.prop-map .leaflet-control-attribution {
  background: rgba(11, 15, 26, 0.78);
  color: var(--text-muted);
  font-size: 0.66rem;
  padding: 2px 8px;
  border-radius: 8px 0 0 0;
  border: 1px solid var(--ed-rule-soft);
  border-right: 0;
  border-bottom: 0;
  backdrop-filter: blur(8px);
}
.prop-map .leaflet-control-attribution a {
  color: var(--primary-light);
  text-decoration: none;
}
.prop-map .leaflet-control-zoom a {
  background: rgba(17, 24, 39, 0.85);
  color: var(--text-primary);
  border: 1px solid var(--ed-rule-mid);
  backdrop-filter: blur(8px);
}
.prop-map .leaflet-control-zoom a:hover {
  background: rgba(124, 58, 237, 0.25);
  color: #fff;
}
.prop-map-pin { background: transparent; border: 0; }
.prop-map-pin svg {
  filter: drop-shadow(0 6px 14px rgba(124, 58, 237, 0.55))
          drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}
.prop-map-approx {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  z-index: 500;
  padding: 0.35rem 0.7rem;
  background: rgba(11, 15, 26, 0.82);
  border: 1px solid var(--ed-rule-mid);
  border-radius: 999px;
  font-family: var(--ed-body);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.prop-map-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
}
.prop-map-empty svg { color: var(--text-muted); opacity: 0.55; }
.prop-map-empty span { font-size: 2rem; opacity: 0.5; }
.prop-map-address {
  margin: 0.75rem 0 0;
  font-family: var(--ed-body);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Similar properties ===== */
.prop-similar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.similar-card {
  display: block;
  background: rgba(17, 24, 39, 0.55);
  border: 1px solid var(--ed-rule-soft);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}
.similar-card:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 139, 250, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.similar-card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.similar-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.similar-card-badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  padding: 0.25rem 0.65rem;
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--ed-rule-mid);
  border-radius: 999px;
  font-family: var(--ed-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
}
.similar-card-content { padding: 0.85rem 1rem 1rem; }
.similar-card-price {
  font-family: var(--ed-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.022em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.similar-card-title {
  font-family: var(--ed-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.similar-card-features {
  display: flex;
  gap: 0.85rem;
  font-family: var(--ed-body);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== Schedule sidebar (auth-aware) ===== */
.prop-schedule {
  position: relative;
  margin-bottom: 1rem;
  padding: 1.5rem 1.45rem 1.35rem;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(6, 182, 212, 0.06) 60%, transparent),
    var(--ed-card-elevated);
  border: 1px solid var(--ed-rule-mid);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}
.prop-schedule::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -25%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.18), transparent 70%);
  pointer-events: none;
}
.prop-schedule__eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ed-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.prop-schedule__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.6);
}
.prop-schedule__title {
  position: relative;
  font-family: var(--ed-display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
  letter-spacing: -0.022em;
}
.prop-schedule__title em {
  font-style: italic;
  font-weight: 600;
  color: var(--primary-light);
}
.prop-schedule__desc {
  position: relative;
  font-family: var(--ed-body);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 1.1rem;
}
.prop-schedule__cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-family: var(--ed-body);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(124, 58, 237, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.prop-schedule__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.prop-schedule__cta:active { transform: translateY(0); }
.prop-schedule__hint {
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--ed-rule-soft);
  font-family: var(--ed-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.prop-schedule__hint svg { flex-shrink: 0; margin-top: 0.18rem; }
.prop-schedule__hint--guest svg { color: var(--primary-light); }
.prop-schedule__hint--auth  svg { color: #34d399; }
.prop-schedule__hint a {
  color: var(--primary-light);
  font-weight: 600;
  text-decoration: none;
}
.prop-schedule__hint a:hover { text-decoration: underline; }
/* Auth-conditional visibility — controlled by body class set by navbar.js */
.is-guest          .prop-schedule__hint--guest { display: flex; }
.is-authenticated  .prop-schedule__hint--auth  { display: flex; }

/* ===== Error template ===== */
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 5rem 2rem;
  text-align: center;
}
.error-icon { font-size: 3.5rem; opacity: 0.6; }
.error-title {
  font-family: var(--ed-display);
  font-weight: 500;
  font-size: 1.8rem;
  color: var(--text-primary);
}
.error-message {
  font-family: var(--ed-body);
  color: var(--text-muted);
  max-width: 32ch;
  margin-bottom: 0.5rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.85rem 1.4rem;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--ed-rule-mid);
  border-radius: 14px;
  color: var(--text-primary);
  font-family: var(--ed-body);
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.toast.success {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(6, 78, 59, 0.85);
  color: #d1fae5;
}
.toast.error {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(127, 29, 29, 0.85);
  color: #fee2e2;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .prop-grid { grid-template-columns: 1fr; }
  .prop-aside { position: static; }
  .prop-features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .prop-page { padding: 1rem 1rem 3rem; }
  .prop-panel { padding: 1.25rem; }
  .prop-gallery__main { aspect-ratio: 4 / 3; }
  .prop-gallery__thumbs { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
  .prop-features { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
  .prop-feature__value { font-size: 1.2rem; }
  .prop-similar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .prop-similar { grid-template-columns: 1fr; }
  .prop-gallery__nav { width: 36px; height: 36px; font-size: 1.2rem; }
  .gallery-action-btn { width: 36px; height: 36px; }
}
