/* GALERIA MODAL DETALHES */
.detalhes-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  animation: fadeIn 0.3s;
  overflow-y: auto;
  padding: 20px;
}

.detalhes-modal.active { display: flex; align-items: flex-start; justify-content: center; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.detalhes-container {
  position: relative;
  background: #fff;
  border-radius: 8px;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.detalhes-header {
  position: relative;
  height: 400px;
  overflow: hidden;
  background: #f0ece4;
}

.detalhes-gallery {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease-in-out;
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  opacity: 0.15;
}

.gallery-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s;
  border: 1.5px solid transparent;
}

.gallery-dot.active {
  background: #C9A96E;
  width: 24px;
  border-radius: 4px;
}

.gallery-prev, .gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(0,0,0,0.3);
  color: #fff;
  transition: all 0.2s;
  opacity: 0;
}

.detalhes-header:hover .gallery-prev,
.detalhes-header:hover .gallery-next {
  opacity: 1;
}

.gallery-prev:hover, .gallery-next:hover {
  background: rgba(0,0,0,0.6);
}

.gallery-prev { left: 20px; }
.gallery-next { right: 20px; }

/* BOTÃO FECHAR MODAL */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-weight: 300;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.15);
}

.modal-close:active {
  transform: scale(0.95);
}

@media (max-width: 900px) {
  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 24px;
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 600px) {
  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 24px;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
  }
}

.detalhes-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 20;
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.3);
  border: none;
  border-radius: 2px;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.detalhes-close:hover {
  background: rgba(0,0,0,0.6);
  transform: scale(1.1);
}

/* GALERIA DE THUMBNAILS */
.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 0.5px solid #f0ece4;
}

.thumbnail {
  aspect-ratio: 1;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail:hover {
  border-color: #C9A96E;
  transform: scale(1.05);
}

.thumbnail.active {
  border-color: #C9A96E;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.2);
}

/* LIGHTBOX - VISUALIZAÇÃO EM TELA CHEIA */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 400;
  animation: fadeIn 0.3s;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  animation: zoomIn 0.3s;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  z-index: 10;
}

.lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev { left: -70px; }
.lightbox-next { right: -70px; }

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 32px;
  width: 50px;
  height: 50px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 16px;
  border-radius: 4px;
}

/* BREADCRUMB */
.detalhes-breadcrumb {
  padding: 20px 40px;
  border-bottom: 0.5px solid #f0ece4;
  font-size: 12px;
  color: #8A8A7A;
  letter-spacing: 0.1em;
}

.detalhes-breadcrumb a {
  color: #C9A96E;
  text-decoration: none;
  cursor: pointer;
}

.detalhes-breadcrumb a:hover {
  text-decoration: underline;
}

/* CONTEÚDO */
.detalhes-content {
  padding: 40px;
}

.detalhes-titulo-section {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 0.5px solid #f0ece4;
}

.detalhes-tipo {
  display: inline-block;
  background: #C9A96E;
  color: #fff;
  padding: 6px 14px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.detalhes-nome {
  font-family: 'Cormorant Garamond', serif;
  font-size: 42px;
  font-weight: 300;
  color: #2C2C28;
  margin-bottom: 12px;
  line-height: 1.1;
}

.detalhes-localizacao {
  font-size: 16px;
  color: #8A8A7A;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.detalhes-preco {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
  color: #C9A96E;
}

/* GRID DE CARACTERÍSTICAS */
.detalhes-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 40px 0;
  padding: 32px 0;
  border-top: 0.5px solid #f0ece4;
  border-bottom: 0.5px solid #f0ece4;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.feature-value {
  font-size: 18px;
  font-weight: 600;
  color: #2C2C28;
  margin-bottom: 4px;
}

.feature-label {
  font-size: 12px;
  color: #8A8A7A;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* DESCRIÇÃO */
.detalhes-desc {
  margin: 40px 0;
}

.detalhes-desc h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 400;
  color: #2C2C28;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detalhes-desc p {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
  margin: 16px 0;
}

.detalhes-diferenciais {
  margin: 40px 0;
}

.detalhes-diferenciais h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 400;
  color: #2C2C28;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.diferenciais-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.diferencial-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(201,169,110,0.05);
  border-radius: 4px;
  border-left: 3px solid #C9A96E;
}

.diferencial-icon {
  font-size: 20px;
}

.diferencial-text {
  font-size: 14px;
  color: #2C2C28;
  font-weight: 500;
}

/* FOOTER DETALHES */
.detalhes-footer {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 0.5px solid #f0ece4;
}

.detalhes-btn {
  flex: 1;
  padding: 16px 24px;
  border: none;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
}

.btn-interesse-detalhes {
  background: #0F0F0E;
  color: #fff;
}

.btn-interesse-detalhes:hover {
  background: #C9A96E;
  color: #0F0F0E;
}

.btn-wpp-detalhes {
  background: #25D366;
  color: #fff;
  flex: 0.3;
}

.btn-wpp-detalhes:hover {
  background: #1db954;
  transform: translateY(-2px);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .detalhes-container {
    border-radius: 12px;
  }

  .detalhes-header {
    height: 280px;
  }

  .detalhes-content {
    padding: 28px;
  }

  .detalhes-nome {
    font-size: 28px;
  }

  .detalhes-features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 28px 0;
    padding: 24px 0;
  }

  .feature-icon {
    font-size: 24px;
  }

  .feature-value {
    font-size: 16px;
  }

  .diferenciais-list {
    grid-template-columns: 1fr;
  }

  .detalhes-footer {
    flex-direction: column;
  }

  .btn-wpp-detalhes {
    flex: 1;
  }

  .gallery-prev, .gallery-next {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

@media (max-width: 600px) {
  .detalhes-modal {
    padding: 0;
  }

  .detalhes-container {
    max-height: 100vh;
    border-radius: 0;
  }

  .detalhes-header {
    height: 200px;
  }

  .detalhes-content {
    padding: 20px;
  }

  .detalhes-nome {
    font-size: 22px;
  }

  .detalhes-preco {
    font-size: 24px;
  }

  .detalhes-features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
    padding: 16px 0;
  }

  .feature-icon {
    font-size: 20px;
  }

  .feature-value {
    font-size: 14px;
  }

  .detalhes-desc h3 {
    font-size: 18px;
  }

  .detalhes-diferenciais h3 {
    font-size: 18px;
  }

  /* RESPONSIVE THUMBNAILS */
  .gallery-thumbnails {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
  }

  .thumbnail {
    border-radius: 2px;
  }

  /* RESPONSIVE LIGHTBOX */
  .lightbox-content {
    width: 95%;
  }

  .lightbox-prev, .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .lightbox-counter {
    font-size: 12px;
    padding: 8px 12px;
    bottom: 10px;
  }
  
}

/* ════════════════════════════════════════════════ */
/* CRECI COMPLIANCE - NOVOS ELEMENTOS */
/* ════════════════════════════════════════════════ */

/* Container Principal de Conteúdo */
.detalhes-content {
  padding: 40px;
  background: #fff;
}

/* Seções Gerais */
.modal-section {
  margin: 32px 0;
}

.modal-section h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 400;
  color: #2C2C28;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-section p {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
}

/* CRECI Info Section */
.creci-info {
  background: linear-gradient(135deg, #EDE7D9 0%, #F5F0E8 100%);
  padding: 20px;
  border-radius: 8px;
  margin: 24px 0;
  border-left: 4px solid #C9A96E;
}

.creci-info h3 {
  color: #2C2C28;
  margin-top: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #E8D5B0;
  transition: all 0.2s;
}

.info-item:hover {
  box-shadow: 0 2px 8px rgba(201, 169, 110, 0.15);
  border-color: #C9A96E;
}

.info-item .label {
  font-weight: 600;
  color: #2C2C28;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.info-item .value {
  color: #2C2C28;
  font-size: 0.95rem;
  word-break: break-word;
  font-weight: 500;
}

/* Modal Header */
.modal-header {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0ece4;
}

.modal-type {
  display: inline-block;
  background: #C9A96E;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 400;
  color: #2C2C28;
  margin: 12px 0;
}

.modal-location {
  font-size: 15px;
  color: #666;
  margin: 8px 0;
}

/* Modal Price */
.modal-price {
  font-size: 28px;
  font-weight: 600;
  color: #C9A96E;
  margin: 16px 0 24px 0;
  padding: 12px 0;
  border-top: 1px solid #f0ece4;
  border-bottom: 1px solid #f0ece4;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0;
  padding: 24px;
  background: #f9f7f3;
  border-radius: 8px;
}

.feature {
  text-align: center;
  padding: 12px;
}

.feature strong {
  display: block;
  font-size: 20px;
  color: #2C2C28;
  margin-bottom: 4px;
}

.feature span {
  display: block;
  font-size: 12px;
  color: #8A8A7A;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Disclaimer CRECI */
.modal-disclaimer {
  background: linear-gradient(135deg, #EDE7D9 0%, #E8D5B0 100%);
  border: 2px solid #C9A96E;
  border-radius: 8px;
  padding: 20px;
  margin: 28px 0;
  font-size: 0.9rem;
  color: #2C2C28;
  line-height: 1.8;
}

.modal-disclaimer p {
  margin: 10px 0;
  font-size: 0.9rem;
}

.modal-disclaimer p:first-child {
  margin-top: 0;
}

.modal-disclaimer p:last-child {
  margin-bottom: 0;
}

.modal-disclaimer strong {
  color: #0F0F0E;
}



/* Gallery Thumbnails */
.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin: 20px 0;
  padding: 16px 0;
  border-top: 1px solid #f0ece4;
  border-bottom: 1px solid #f0ece4;
}

.thumbnail {
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.2s;
  aspect-ratio: 1;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail.active {
  border-color: #C9A96E;
  box-shadow: 0 0 8px rgba(201, 169, 110, 0.3);
}

.thumbnail:hover {
  border-color: #C9A96E;
  opacity: 0.8;
}

/* ════════════════════════════════════════════════ */
/* RESPONSIVIDADE - CRECI ELEMENTS */
/* ════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .detalhes-content {
    padding: 28px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .modal-title {
    font-size: 26px;
  }

  .modal-price {
    font-size: 24px;
  }

  .modal-section h3 {
    font-size: 18px;
  }
}

@media (max-width: 600px) {
  .detalhes-content {
    padding: 16px;
  }

  .creci-info {
    padding: 16px;
    margin: 16px 0;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .info-item {
    padding: 10px;
  }

  .info-item .label {
    font-size: 0.75rem;
  }

  .info-item .value {
    font-size: 0.9rem;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
    margin: 16px 0;
  }

  .feature {
    padding: 8px;
  }

  .feature strong {
    font-size: 18px;
  }

  .feature span {
    font-size: 11px;
  }

  .modal-title {
    font-size: 22px;
  }

  .modal-price {
    font-size: 20px;
  }

  .modal-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  .modal-disclaimer {
    padding: 12px;
    margin: 16px 0;
    font-size: 0.85rem;
  }

  .modal-disclaimer p {
    margin: 6px 0;
    font-size: 0.85rem;
  }

  .modal-section h3 {
    font-size: 16px;
  }

  .modal-section p {
    font-size: 0.9rem;
  }

  .gallery-thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 4px;
    margin: 16px 0;
    padding: 12px 0;
  }

  .diferenciais-list {
    grid-template-columns: 1fr;
  }
}

/* ===================================== */
/*   MOBILE */
/* ===================================== */

@media (max-width: 900px) {
  /* Remove dependência de hover (não existe no mobile) */
  .gallery-prev,
  .gallery-next {
    opacity: 1 !important;
  }

  /* Evita botão ficar fora da tela */
  .gallery-prev { left: 10px; }
  .gallery-next { right: 10px; }

  /* Corrige scroll interno bugado */
  .detalhes-container {
    max-height: none;
  }

  .detalhes-header {
    height: 280px;
  }
}

@media (max-width: 600px) {
  /* Modal ocupa tela inteira corretamente */
  .detalhes-modal {
    padding: 0;
    align-items: stretch;
  }

  .detalhes-container {
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    max-width: 100%;
  }

  /* Garante que header não fique desproporcional */
  .detalhes-header {
    height: 220px;
  }

  /* Thumbnails não esmagarem */
  .gallery-thumbnails {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  }

  .detalhes-content {
    padding: 16px;
  }
}

