/* ===== MODAL DE DETALLE - VERSIÓN SIN ACENTOS Y RESPONSIVE ===== */
/* Asegurar que el botón de cierre sea siempre clickeable */
.close-button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.close-button:active {
  transform: scale(0.95);
}
/* Overlay del modal */
.detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 20000;
  display: none;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

.detail-overlay.active {
  display: flex;
}

/* Contenedor principal del modal */
.detail-container {
  background: white;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  position: relative;
  z-index: 20001;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header del modal */
.detail-header {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  padding: 1.5rem 2rem;
  border-radius: 24px 24px 0 0;
  z-index: 20002;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Botón de cierre */
.close-button {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 20003;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.close-button:hover {
  background: white;
  color: var(--primary-color);
  transform: scale(1.1);
}

.close-button:active {
  transform: scale(0.95);
}

/* Título del modal */
.detail-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-right: 3rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  word-break: break-word;
}

/* Meta información (categoría, alcaldía) */
.detail-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--font-text);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.detail-meta span {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.3rem 1rem;
  border-radius: 30px;
  backdrop-filter: blur(4px);
}

/* Fila principal del modal */
.detail-main-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
}

/* Contenedor del carrusel */
.detail-carousel-container {
  background: #f8f5f3;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  min-height: 414px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Carrusel */
.detail-carousel {
  width: 100%;
  height: 100%;
  position: relative;
}

.detail-carousel-images {
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.detail-carousel-slide {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f5f3;
  min-height: 414px;
}

.detail-carousel-slide img {
  max-width: 100%;
  max-height: 414px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Botones del carrusel */
.detail-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: none;
  color: var(--primary-color);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 20004;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.detail-carousel-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.detail-carousel-btn.prev {
  left: 10px;
}

.detail-carousel-btn.next {
  right: 10px;
}

/* Indicadores del carrusel */
.detail-carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 20004;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 12px;
  border-radius: 30px;
  backdrop-filter: blur(4px);
}

.detail-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s;
}

.detail-indicator.active {
  background: white;
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.detail-indicator:hover {
  background: white;
  transform: scale(1.2);
}

/* Contador de imágenes */
.detail-image-counter {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-family: var(--font-text);
  z-index: 20004;
  backdrop-filter: blur(4px);
}

/* Placeholder de imagen */
.detail-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 1.2rem;
  font-family: var(--font-text);
  background: #f8f5f3;
  min-height: 414px;
  text-align: center;
  padding: 2rem;
}

/* Contenedor de descripción */
.detail-description-container {
  background: #f8f5f3;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.detail-description-container h3 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-description-content {
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.6;
  color: #2b1d24;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.detail-description-content::-webkit-scrollbar {
  width: 6px;
}

.detail-description-content::-webkit-scrollbar-track {
  background: rgba(215, 47, 137, 0.1);
  border-radius: 10px;
}

.detail-description-content::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

/* Sección de campos adicionales */
.detail-fields-section {
  padding: 0 2rem 2rem;
}

.detail-fields-section h3 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.detail-item {
  background: #f8f5f3;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

.detail-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.detail-item-label {
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
}

.detail-item-value {
  font-family: var(--font-text);
  font-size: 0.95rem;
  color: #2b1d24;
  line-height: 1.5;
  word-break: break-word;
}

/* Contenedor del mapa */
.detail-map-container {
  padding: 0 2rem 2rem;
}

.detail-map-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-map {
  width: 100%;
  height: 400px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  z-index: 20005;
}

/* ===== RESPONSIVE PARA MODAL ===== */

@media screen and (max-width: 768px) {
  .detail-overlay {
    padding: 0;
    align-items: flex-start;
  }
  
  .detail-container {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    margin: 0;
    width: 100%;
  }
  
  .detail-header {
    position: sticky;
    top: 0;
    padding: 0.8rem 1rem;
    z-index: 20010;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }
  
  .detail-title {
    font-size: 1.1rem;
    padding-right: 2.5rem;
    margin-bottom: 0.3rem;
  }
  
  .detail-meta {
    font-size: 0.75rem;
    gap: 0.3rem;
  }
  
  .detail-meta span {
    padding: 0.15rem 0.5rem;
  }
  
  .close-button {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    top: 0.6rem;
    right: 0.8rem;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid white;
    z-index: 20020;
  }
  
  .close-button:hover {
    background: white;
    color: var(--primary-color);
  }
  
  .detail-main-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .detail-carousel-container {
    min-height: 200px;
    max-height: 250px;
  }
  
  .detail-carousel-slide {
    min-height: 200px;
  }
  
  .detail-carousel-slide img {
    max-height: 200px;
  }
  
  .detail-carousel-btn {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  
  .detail-carousel-indicators {
    padding: 4px 8px;
    gap: 4px;
    bottom: 10px;
  }
  
  .detail-indicator {
    width: 8px;
    height: 8px;
  }
  
  .detail-image-counter {
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    top: 8px;
    right: 8px;
  }
  
  .detail-description-container {
    padding: 0.8rem;
  }
  
  .detail-description-container h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .detail-description-content {
    font-size: 0.85rem;
    max-height: 150px;
  }
  
  .detail-fields-section {
    padding: 0 1rem 1rem;
  }
  
  .detail-fields-section h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .detail-item {
    padding: 0.6rem;
  }
  
  .detail-item-label {
    font-size: 0.65rem;
  }
  
  .detail-item-value {
    font-size: 0.75rem;
  }
  
  .detail-map-container {
    padding: 0 1rem 1rem;
  }
  
  .detail-map-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .detail-map {
    height: 200px;
  }
}

@media screen and (max-width: 480px) {
  .detail-header {
    padding: 0.6rem 0.8rem;
  }
  
  .detail-title {
    font-size: 1rem;
    padding-right: 2rem;
  }
  
  .close-button {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    top: 0.5rem;
    right: 0.6rem;
  }
  
  .detail-main-row {
    padding: 0.8rem;
    gap: 0.8rem;
  }
  
  .detail-carousel-container {
    min-height: 180px;
  }
  
  .detail-carousel-slide {
    min-height: 180px;
  }
  
  .detail-carousel-slide img {
    max-height: 180px;
  }
  
  .detail-carousel-btn {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
  
  .detail-description-content {
    max-height: 120px;
    font-size: 0.8rem;
  }
  
  .detail-item {
    padding: 0.5rem;
  }
  
  .detail-map {
    height: 180px;
  }
}

.detail-overlay {
  overflow-x: hidden;
}

.detail-container {
  overflow-x: hidden;
  width: 100%;
}

.detail-carousel-slide img {
  max-width: 100%;
  height: auto;
}