/* Shared chat attachment lightbox — admin inbox + user widget */

.chat-attachment-img {
  display: block;
  cursor: zoom-in;
  border-radius: 10px;
  transition: opacity 0.15s ease;
}

.chat-attachment-img:hover {
  opacity: 0.92;
}

.chat-popup .chat-attachment-img,
.chat-popup .chat-message__text .chat-attachment-img {
  max-width: 160px;
  max-height: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.chat-messages-page .message-bubble .chat-attachment-img {
  max-width: 240px;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.chat-image-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.88);
}

.chat-image-lightbox.is-open {
  display: flex;
}

.chat-image-lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chat-image-lightbox__close:hover,
.chat-image-lightbox__close:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.chat-image-lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(92vw, 1200px);
  max-height: min(88vh, 900px);
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.chat-image-lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(92vw, 1200px);
  max-height: min(88vh, 900px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  cursor: zoom-out;
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.chat-image-lightbox__img.is-loading {
  opacity: 0;
}

@media (max-width: 767px) {
  .chat-image-lightbox {
    padding: 12px;
  }

  .chat-image-lightbox__close {
    top: 10px;
    right: 10px;
  }
}
