/* D&Y public property cards - final visual layer */
.properties-list .property-card,
.property-card {
  --dy-card-blue: #2563eb;
  --dy-card-text: #111827;
  --dy-card-muted: #64748b;
  --dy-card-line: #e3ebf6;
  --dy-card-soft: #f7faff;
  width: 100%;
  min-width: 0;
  border-radius: 18px !important;
  border: 1px solid var(--dy-card-line) !important;
  background: #fff !important;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08) !important;
  overflow: hidden !important;
  transform: none !important;
}

.property-card:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(37, 99, 235, 0.24) !important;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12) !important;
}

.property-card .card-media {
  height: 224px !important;
  border-radius: 0 !important;
  background: #e8eef7 !important;
}

.property-card .card-media::after {
  height: 86px !important;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.42), rgba(15, 23, 42, 0.05), transparent) !important;
}

.property-card .card-media img,
.property-card .ccr-slide {
  object-fit: cover !important;
  filter: saturate(1.02) contrast(1.01) !important;
}

.property-card:hover .card-media img {
  transform: scale(1.025) !important;
}

.property-card .dy-card-photo-brand {
  left: 14px !important;
  bottom: 12px !important;
  min-height: 34px !important;
  padding: 5px 11px 5px 6px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #172033 !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18) !important;
}

.property-card .dy-card-photo-brand strong {
  width: 26px !important;
  height: 26px !important;
  font-size: 0.68rem !important;
  border-radius: 999px !important;
  background: #172033 !important;
  color: #fff !important;
}

.property-card .dy-card-photo-brand span {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.property-card .new-badge {
  top: 14px !important;
  left: 14px !important;
  min-height: 30px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  background: #10b981 !important;
  color: #fff !important;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.26) !important;
}

.property-card .dy-card-tools {
  top: 12px !important;
  right: 12px !important;
  display: inline-flex !important;
  gap: 8px !important;
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}

.property-card .card-compare-btn {
  display: none !important;
}

.property-card .card-fav-btn {
  position: static !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 999px !important;
  background: rgba(17, 24, 39, 0.58) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.38) !important;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.22) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.property-card .card-fav-btn svg {
  width: 18px !important;
  height: 18px !important;
}

.property-card .card-fav-btn:hover {
  background: #fff !important;
  color: #111827 !important;
}

.property-card .ccr-dots {
  bottom: 12px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  gap: 5px !important;
  padding: 0 !important;
  background: transparent !important;
}

.property-card .ccr-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.62) !important;
  border: 0 !important;
}

.property-card .ccr-dot.active {
  width: 18px !important;
  background: #fff !important;
}

.property-card .ccr-counter,
.property-card .ccr-arrow {
  display: none !important;
}

.property-card .card-body {
  padding: 17px 18px 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.property-card .card-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 12px !important;
}

.property-card .dy-card-kicker {
  margin: 0 0 4px !important;
  color: var(--dy-card-muted) !important;
  font-size: 0.66rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.07em !important;
}

.property-card .price {
  color: var(--dy-card-text) !important;
  font-size: 1.65rem !important;
  line-height: 1.02 !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.property-card .price span,
.property-card .price::after {
  color: var(--dy-card-muted) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.property-card .dy-card-status {
  height: 30px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  color: #1d4ed8 !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.property-card .dy-card-status span {
  width: 7px !important;
  height: 7px !important;
  background: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.property-card .card-location {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  background: var(--dy-card-soft) !important;
  border: 1px solid var(--dy-card-line) !important;
  color: var(--dy-card-muted) !important;
}

.property-card .card-location-pin {
  grid-row: 1 / span 2 !important;
  width: 17px !important;
  height: 17px !important;
  color: var(--dy-card-blue) !important;
}

.property-card .card-location-street,
.property-card .card-location-city {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.property-card .card-location-street {
  color: var(--dy-card-text) !important;
  font-size: 0.88rem !important;
  font-weight: 750 !important;
}

.property-card .card-location-city {
  color: var(--dy-card-muted) !important;
  font-size: 0.8rem !important;
  font-weight: 650 !important;
}

.property-card .meta {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.property-card .meta .meta-item {
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 0 9px !important;
  border-radius: 12px !important;
  background: #fff !important;
  border: 1px solid var(--dy-card-line) !important;
  color: var(--dy-card-text) !important;
  font-size: 0.78rem !important;
  font-weight: 750 !important;
  justify-content: center !important;
  gap: 7px !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02) !important;
}

.property-card .meta .meta-item span,
.property-card .features .feature-tag span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.property-card .dy-card-spec-icon,
.property-card .meta svg,
.property-card .features .feature-tag svg {
  width: 15px !important;
  height: 15px !important;
  color: var(--dy-card-blue) !important;
  flex: 0 0 auto !important;
}

.property-card .features {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
}

.property-card .features .feature-tag {
  max-width: 100% !important;
  min-height: 34px !important;
  padding: 0 10px !important;
  border-radius: 10px !important;
  background: #f8fbff !important;
  border: 1px solid var(--dy-card-line) !important;
  color: var(--dy-card-text) !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  gap: 7px !important;
  letter-spacing: 0 !important;
}

.property-card .card-actions {
  margin-top: 2px !important;
  padding-top: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
}

.property-card .action-btn.details {
  min-height: 48px !important;
  width: 100% !important;
  border-radius: 12px !important;
  background: #2563eb !important;
  color: #fff !important;
  border: 1px solid #2563eb !important;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.20) !important;
  font-size: 0.88rem !important;
  font-weight: 750 !important;
}

.property-card .action-btn.details:hover {
  background: #1d4ed8 !important;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.26) !important;
}

[data-theme="dark"] .property-card,
body.dark .property-card {
  --dy-card-text: #f8fafc;
  --dy-card-muted: #aebed3;
  --dy-card-line: rgba(148, 163, 184, 0.18);
  --dy-card-soft: rgba(96, 165, 250, 0.08);
  background: #101a2e !important;
  border-color: var(--dy-card-line) !important;
}

[data-theme="dark"] .property-card .card-location,
body.dark .property-card .card-location,
[data-theme="dark"] .property-card .meta .meta-item,
body.dark .property-card .meta .meta-item,
[data-theme="dark"] .property-card .features .feature-tag,
body.dark .property-card .features .feature-tag {
  background: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
  color: var(--dy-card-text) !important;
}

@media (max-width: 640px) {
  .properties-list { gap: 18px !important; }
  .properties-list .property-card,
  .property-card {
    border-radius: 16px !important;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.09) !important;
  }
  .property-card .card-media { height: 190px !important; }
  .property-card .card-body { padding: 15px !important; gap: 10px !important; }
  .property-card .dy-card-kicker { display: none !important; }
  .property-card .price { font-size: 1.45rem !important; }
  .property-card .dy-card-status { height: 28px !important; font-size: 0.68rem !important; padding: 0 9px !important; }
  .property-card .card-location { min-height: 40px !important; padding: 9px 10px !important; }
  .property-card .meta { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .property-card .meta .meta-item:nth-child(3) { grid-column: 1 / -1 !important; }
  .property-card .features .feature-tag:nth-child(n+5) { display: none !important; }
  .property-card .action-btn.details { min-height: 46px !important; }
}

@media (max-width: 390px) {
  .property-card .card-media { height: 170px !important; }
  .property-card .features .feature-tag:nth-child(n+4) { display: none !important; }
}

/* Desktop detail modal sizing */
@media (min-width: 900px) {
  #propertyPreviewModal .modal-content.preview-content {
    width: calc(100vw - 28px) !important;
    height: calc(100dvh - 28px) !important;
    max-width: 1560px !important;
    max-height: calc(100dvh - 28px) !important;
  }

  #propertyPreviewModal .modal-top {
    grid-template-columns: minmax(520px, 46%) minmax(0, 54%) !important;
  }

  #propertyPreviewModal .main-col {
    padding: 42px 48px 28px !important;
  }

  #propertyPreviewModal .side-col {
    padding-left: 48px !important;
    padding-right: 48px !important;
  }

  #propertyPreviewModal .preview-description .desc {
    max-height: 88px !important;
    -webkit-line-clamp: 4 !important;
  }
}

/* Keep secondary modal actions above the large detail modal */
#rentCalcModal,
#interestModal,
#savedSearchModal {
  z-index: 100040 !important;
}

#photoFullscreen,
.all-photos-gallery {
  z-index: 100050 !important;
}

/* Schedule visit modal refresh */
#scheduleModal {
  background: rgba(15, 23, 42, 0.52) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  backdrop-filter: blur(16px) !important;
  padding: 18px !important;
}

#scheduleModal .schedule-modal-content {
  width: min(620px, calc(100vw - 28px)) !important;
  max-width: 620px !important;
  max-height: calc(100dvh - 36px) !important;
  margin: auto !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  border: 1px solid rgba(203, 213, 225, 0.9) !important;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.26) !important;
  overflow: hidden auto !important;
}

#scheduleModal .schedule-modal-content > .close {
  top: 16px !important;
  right: 16px !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  border: 1px solid rgba(203, 213, 225, 0.95) !important;
  color: #475569 !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10) !important;
}

#scheduleModal .schedule-modal-content > .close:hover {
  background: #ffffff !important;
  color: #0f172a !important;
  transform: none !important;
}

#scheduleModal .schedule-banner {
  padding: 28px 32px 24px !important;
  background:
    radial-gradient(circle at 16% 18%, rgba(37, 99, 235, 0.13), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 100%) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

#scheduleModal .schedule-banner-bg {
  display: none !important;
}

#scheduleModal .schedule-banner-content {
  text-align: left !important;
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) !important;
  gap: 14px !important;
  align-items: center !important;
  padding-right: 44px !important;
}

#scheduleModal .schedule-banner-icon {
  width: 46px !important;
  height: 46px !important;
  margin: 0 !important;
  border-radius: 12px !important;
  background: #eaf2ff !important;
  color: #2563eb !important;
  border: 1px solid #d8e6ff !important;
  box-shadow: none !important;
}

#scheduleModal .schedule-banner-icon svg {
  width: 22px !important;
  height: 22px !important;
  color: #2563eb !important;
}

#scheduleModal #schedule-title {
  margin: 0 !important;
  color: #0f172a !important;
  font-size: 1.24rem !important;
  line-height: 1.1 !important;
  font-weight: 820 !important;
  letter-spacing: 0 !important;
}

#scheduleModal .schedule-property-badge {
  grid-column: 2 !important;
  justify-self: start !important;
  max-width: 100% !important;
  margin: 6px 0 0 !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  background: #f1f5f9 !important;
  border: 1px solid #dbe4f0 !important;
  color: #475569 !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
}

#scheduleModal .schedule-steps {
  padding: 16px 32px 0 !important;
  justify-content: stretch !important;
}

#scheduleModal .schedule-step {
  flex: 0 0 auto !important;
  gap: 8px !important;
  color: #64748b !important;
  font-size: 0.78rem !important;
  font-weight: 760 !important;
}

#scheduleModal .step-dot {
  width: 28px !important;
  height: 28px !important;
  border-radius: 10px !important;
  border: 1px solid #dbe4f0 !important;
  background: #f8fafc !important;
  color: #64748b !important;
  box-shadow: none !important;
}

#scheduleModal .schedule-step.active {
  color: #2563eb !important;
}

#scheduleModal .schedule-step.active .step-dot {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22) !important;
  transform: none !important;
}

#scheduleModal .schedule-step.completed .step-dot {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #bbf7d0 !important;
}

#scheduleModal .schedule-step.completed .step-dot::after {
  content: "" !important;
}

#scheduleModal .step-line {
  flex: 1 1 auto !important;
  min-width: 24px !important;
  height: 1px !important;
  margin: 0 12px !important;
  background: #dbe4f0 !important;
}

#scheduleModal .step-line.completed {
  background: #86efac !important;
  box-shadow: none !important;
}

#scheduleModal .schedule-form {
  padding: 24px 32px 30px !important;
}

#scheduleModal .form-section {
  margin-bottom: 18px !important;
}

#scheduleModal .form-section-label {
  gap: 8px !important;
  margin-bottom: 10px !important;
  color: #64748b !important;
  font-size: 0.74rem !important;
  font-weight: 820 !important;
  letter-spacing: 0.06em !important;
}

#scheduleModal .form-section-label svg {
  color: #2563eb !important;
}

#scheduleModal .input-with-icon {
  margin-bottom: 10px !important;
}

#scheduleModal .input-with-icon input,
#scheduleModal .input-with-icon textarea,
#scheduleModal .sched-time-sel {
  min-height: 48px !important;
  border-radius: 11px !important;
  border: 1px solid #dbe4f0 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02) !important;
  font-size: 0.92rem !important;
}

#scheduleModal .input-with-icon input:focus,
#scheduleModal .input-with-icon textarea:focus,
#scheduleModal .sched-time-sel:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
  background: #ffffff !important;
}

#scheduleModal .input-with-icon svg.icon-svg,
#scheduleModal .input-with-icon > svg:first-child {
  color: #94a3b8 !important;
}

#scheduleModal .date-time {
  gap: 10px !important;
}

#scheduleModal .sched-time-group {
  min-height: 48px !important;
  border-radius: 11px !important;
}

#scheduleModal .sched-time-sel {
  min-width: 50px !important;
  padding: 8px 7px !important;
}

#scheduleModal .sched-ampm-sel {
  color: #2563eb !important;
  background: #f1f6ff !important;
  border-color: #d8e6ff !important;
}

#scheduleModal .schedule-step-actions {
  justify-content: flex-end !important;
  gap: 10px !important;
  margin-top: 18px !important;
}

#scheduleModal .schedule-step-actions .btn-secondary,
#scheduleModal .schedule-step-actions .btn-primary {
  min-height: 46px !important;
  border-radius: 11px !important;
  padding: 0 20px !important;
  font-size: 0.9rem !important;
  font-weight: 780 !important;
  box-shadow: none !important;
}

#scheduleModal .schedule-step-actions .btn-secondary {
  background: #ffffff !important;
  border: 1px solid #dbe4f0 !important;
  color: #475569 !important;
}

#scheduleModal .schedule-step-actions .btn-primary {
  background: #2563eb !important;
  border: 1px solid #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.20) !important;
}

#scheduleModal .schedule-summary,
#scheduleModal .schedule-note {
  border-radius: 12px !important;
  border: 1px solid #dbe4f0 !important;
  background: #f8fbff !important;
  box-shadow: none !important;
}

#scheduleModal .schedule-summary-row {
  gap: 12px !important;
}

#scheduleModal .schedule-summary-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  background: #eaf2ff !important;
  color: #2563eb !important;
}

#scheduleModal .schedule-summary-title,
#scheduleModal .schedule-summary-value {
  color: #0f172a !important;
}

@media (max-width: 640px) {
  #scheduleModal {
    padding: 10px !important;
    align-items: flex-end !important;
  }

  #scheduleModal .schedule-modal-content {
    width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: 18px !important;
  }

  #scheduleModal .schedule-banner {
    padding: 22px 20px 18px !important;
  }

  #scheduleModal .schedule-banner-content {
    grid-template-columns: 40px minmax(0, 1fr) !important;
    gap: 12px !important;
    padding-right: 42px !important;
  }

  #scheduleModal .schedule-banner-icon {
    width: 40px !important;
    height: 40px !important;
  }

  #scheduleModal #schedule-title {
    font-size: 1.08rem !important;
  }

  #scheduleModal .schedule-steps {
    padding: 14px 20px 0 !important;
  }

  #scheduleModal .schedule-step span {
    display: none !important;
  }

  #scheduleModal .step-line {
    margin: 0 8px !important;
  }

  #scheduleModal .schedule-form {
    padding: 20px !important;
  }

  #scheduleModal .date-time {
    flex-direction: column !important;
  }

  #scheduleModal .schedule-step-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }

  #scheduleModal .schedule-step-actions .btn-secondary,
  #scheduleModal .schedule-step-actions .btn-primary {
    width: 100% !important;
    padding: 0 14px !important;
  }
}

/* Compact desktop action bar inside the detail modal */
@media (min-width: 900px) {
  #propertyPreviewModal .content-grid .side-col .action-box {
    grid-template-columns: minmax(220px, 1fr) max-content max-content max-content !important;
    grid-template-rows: 46px !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    align-items: center !important;
    justify-content: stretch !important;
  }

  #propertyPreviewModal .content-grid .side-col .action-box > .btn-apply,
  #propertyPreviewModal .content-grid .side-col .action-box > .btn-ghost,
  #propertyPreviewModal .content-grid .side-col .action-box > .btn-call-agent {
    min-height: 46px !important;
    height: 46px !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    padding: 0 18px !important;
    border-radius: 10px !important;
    font-size: 0.82rem !important;
    font-weight: 760 !important;
    justify-content: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  #propertyPreviewModal .action-box .btn-ghost span,
  #propertyPreviewModal .action-box .btn-call-agent span,
  #propertyPreviewModal .action-box .btn-apply span {
    display: inline !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  #propertyPreviewModal .action-box .cta-icon {
    width: 15px !important;
    height: 15px !important;
  }
}
