/* ==========================================================================
   MODAL STYLES — IMÓVEL IDEAL
   Ficha técnica do imóvel com galeria HD, simulador interativo e WhatsApp VIP
   ========================================================================== */

.detail-dialog {
  width: calc(100% - 24px);
  max-width: 900px;
  max-height: 92vh;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0;
  color: var(--text-main);
  background: var(--surface);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.detail-dialog::backdrop {
  background: rgba(14, 41, 39, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.detail-dialog[open] {
  animation: modalFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header do Modal */
.detail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.detail-header-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.detail-type-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-accent);
}

.detail-header-info h2 {
  font-size: 20px;
  font-family: var(--font-family);
  font-weight: 800;
  color: var(--brand-primary);
  margin: 0;
  line-height: 1.25;
}

.detail-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  font-size: 16px;
}

.detail-close-btn:hover {
  background: var(--border);
  color: var(--brand-primary);
  transform: scale(1.08);
}

/* Corpo Rolável do Modal */
.detail-modal-body {
  padding: 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Galeria de Fotos */
.gallery-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-alt);
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 0;
  color: var(--brand-primary);
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  transition: all var(--transition-fast);
  z-index: 2;
}

.gallery-nav-btn:hover {
  background: #FFFFFF;
  transform: translateY(-50%) scale(1.08);
}

.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }

.gallery-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.gallery-thumb {
  width: 88px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.65;
  transition: all var(--transition-fast);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb.active {
  border-color: var(--brand-accent);
  opacity: 1;
}

.gallery-thumb:hover {
  opacity: 0.95;
}

/* Banner de Leilão e Desconto */
.auction-banner {
  background: linear-gradient(135deg, var(--brand-primary) 0%, #16564E 100%);
  color: #FFFFFF;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(195, 164, 107, 0.4);
  box-shadow: 0 4px 18px rgba(23, 61, 58, 0.18);
}

@media (min-width: 600px) {
  .auction-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.auction-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auction-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(195, 164, 107, 0.22);
  color: var(--brand-gold);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.auction-text h4 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 750;
  color: var(--brand-gold);
}

.auction-text p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: #D6E4E1;
}

.auction-banner-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auction-discount-tag {
  background: #BE2828;
  color: #FFFFFF;
  font-weight: 850;
  font-size: 13.5px;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  box-shadow: 0 2px 8px rgba(190, 40, 40, 0.3);
}

/* Bloco de Preços e Valores */
.detail-pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  background: var(--bg-main);
  padding: 18px 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

@media (min-width: 600px) {
  .detail-pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pricing-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pricing-item .price-label {
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 750;
  letter-spacing: 0.05em;
}

.pricing-item .price-val {
  font-family: var(--font-family);
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-primary);
}

.pricing-item .price-val.original {
  text-decoration: line-through;
  color: #8C9C96;
  font-size: 18px;
}

.pricing-item .price-val.downpayment {
  color: var(--brand-accent);
  font-size: 19px;
}

/* Especificações Rápidas */
.detail-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
}

.detail-spec-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: border-color var(--transition-fast);
}

.detail-spec-box:hover {
  border-color: var(--brand-accent);
}

.detail-spec-box svg {
  width: 22px;
  height: 22px;
  color: var(--brand-accent);
}

.detail-spec-box .spec-val {
  font-size: 14.5px;
  font-weight: 750;
  color: var(--text-main);
}

.detail-spec-box .spec-tit {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Descrição e Diferenciais */
.detail-section-title {
  font-family: var(--font-family);
  font-size: 17px;
  font-weight: 750;
  color: var(--brand-primary);
  margin: 0 0 10px 0;
}

.detail-description {
  font-size: 14px;
  line-height: 1.68;
  color: var(--text-main);
  margin: 0;
}

.detail-features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-accent-light);
  border: 1px solid #C4EAE4;
  color: var(--brand-accent);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

/* Simulador de Financiamento */
.simulator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.simulator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.simulator-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-primary);
}

.simulator-badge {
  background: var(--brand-accent-light);
  color: var(--brand-accent);
  font-size: 11.5px;
  font-weight: 750;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.simulator-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .simulator-controls {
    grid-template-columns: 1fr 1fr;
  }
}

.sim-field label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.sim-field input[type="range"] {
  width: 100%;
  accent-color: var(--brand-accent);
  cursor: pointer;
}

.sim-field select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: var(--surface-alt);
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 600;
}

.sim-result-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sim-result-box .sim-res-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.sim-result-box .sim-res-value {
  font-family: var(--font-family);
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-primary);
}

/* Footer do Modal */
.detail-modal-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

@media (min-width: 600px) {
  .detail-modal-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.btn-whatsapp-large {
  flex: 1;
  min-height: 48px;
  background: var(--whatsapp);
  color: #FFFFFF;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.28);
  transition: all var(--transition-fast);
}

.btn-whatsapp-large:hover {
  background: var(--whatsapp-hover);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.38);
  transform: translateY(-2px);
}

.btn-whatsapp-large svg {
  width: 20px;
  height: 20px;
}
