/**
 * HlModal — Estilos de modal custom
 * Reemplazo de Bootstrap .modal
 * v7.0.0
 */

.hl-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.hl-modal.hl-modal-open {
  display: flex;
}

.hl-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  animation: hl-fade-in 0.15s ease-out;
}

.hl-modal-content {
  box-sizing: border-box;
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1051;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  animation: hl-slide-up 0.2s ease-out;
}

/* Tamaños variantes */
.hl-modal-sm .hl-modal-content { max-width: 400px; }
.hl-modal-lg .hl-modal-content { max-width: 800px; }
.hl-modal-xl .hl-modal-content { max-width: 1000px; }

.hl-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.hl-modal-header h5,
.hl-modal-header .hl-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.hl-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
}

.hl-modal-close:hover {
  color: #111827;
}

.hl-modal-body {
  padding: 1.25rem;
  overflow-x: hidden;
}

.hl-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e5e7eb;
}

/* Mobile: fullscreen */
@media (max-width: 576px) {
  .hl-modal {
    padding: 0;
  }
  .hl-modal-content {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}

/* Animaciones */
@keyframes hl-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hl-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
