.comment-form-kcm-media {
  margin-top: 14px;
}

.comment-form-kcm-media label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.kcm-dropzone {
  position: relative;
  border: 2px dashed rgba(0,0,0,0.14);
  border-radius: 12px;
  background: #fafafa;
  padding: 18px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.kcm-dropzone:hover,
.kcm-dropzone.is-dragover {
  border-color: #2271b1;
  background: #f6fbff;
}

.kcm-dropzone-inner {
  text-align: center;
}

.kcm-dropzone-inner strong,
.kcm-dropzone-inner span {
  display: block;
}

.kcm-dropzone-inner strong {
  font-size: 15px;
  margin-bottom: 6px;
}

.kcm-dropzone-inner span {
  font-size: 13px;
  opacity: .8;
}

.kcm-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.kcm-upload-note {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.8;
}

.kcm-form-status {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.kcm-form-status.is-error,
.kcm-form-status.is-success,
.kcm-form-status.is-pending,
.kcm-form-status.is-loading {
  display: block;
}

.kcm-form-status.is-error { background: #fff1f0; color: #a8071a; }
.kcm-form-status.is-success { background: #f6ffed; color: #237804; }
.kcm-form-status.is-pending { background: #fffbe6; color: #ad6800; }
.kcm-form-status.is-loading { background: #e6f4ff; color: #0958d9; }

.kcm-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 140px));
  gap: 12px;
  margin-top: 12px;
}

.kcm-preview-item,
.kcm-comment-media-item {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.kcm-preview-item {
  position: relative;
}

.kcm-preview-thumb,
.kcm-comment-media-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 140px;
  background: #f6f7f7;
  overflow: hidden;
}

.kcm-preview-thumb img,
.kcm-comment-media-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kcm-preview-video-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #1f2937;
  color: #fff;
  font-size: 30px;
}

.kcm-preview-meta,
.kcm-comment-media-meta {
  display: block;
  padding: 8px;
}

.kcm-comment-media-meta {
  display: none !important;
}

.kcm-preview-meta strong,
.kcm-preview-meta small,
.kcm-comment-media-meta strong,
.kcm-comment-media-meta small {
  display: block;
}

.kcm-preview-meta strong,
.kcm-comment-media-meta strong {
  font-size: 13px;
  margin-bottom: 4px;
}

.kcm-preview-meta small,
.kcm-comment-media-meta small {
  font-size: 12px;
  color: #666;
  word-break: break-word;
}

.kcm-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}

.kcm-preview-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff1f0;
  color: #a8071a;
  font-size: 13px;
}

.kcm-comment-media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 300px));
  gap: 14px;
  margin-top: 14px;
}

.kcm-comment-media-item.kcm-is-image {
  width: 300px;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
}

.kcm-comment-media-item.kcm-is-image .kcm-comment-media-thumb {
  width: 300px;
  max-width: 100%;
  height: 300px;
}

.kcm-comment-media-item.kcm-is-video {
  width: 300px;
  max-width: 100%;
  padding: 0;
}

.kcm-comment-media-item.kcm-is-video .wp-video,
.kcm-comment-media-item.kcm-is-video video,
.kcm-comment-media-item.kcm-is-video .mejs-container,
.kcm-comment-media-item.kcm-is-video .mejs-inner,
.kcm-comment-media-item.kcm-is-video .mejs-mediaelement {
  width: 300px !important;
  max-width: 100% !important;
}

.kcm-comment-media-item.kcm-is-video video {
  display: block;
  height: 300px !important;
  object-fit: cover;
  background: #000;
}

@media (max-width: 480px) {
  .kcm-comment-media-gallery {
    grid-template-columns: 1fr;
  }

  .kcm-comment-media-item.kcm-is-image,
  .kcm-comment-media-item.kcm-is-image .kcm-comment-media-thumb,
  .kcm-comment-media-item.kcm-is-video,
  .kcm-comment-media-item.kcm-is-video .wp-video,
  .kcm-comment-media-item.kcm-is-video video,
  .kcm-comment-media-item.kcm-is-video .mejs-container,
  .kcm-comment-media-item.kcm-is-video .mejs-inner,
  .kcm-comment-media-item.kcm-is-video .mejs-mediaelement {
    width: 100% !important;
  }
}

/* Traveler review compatibility */
.booking-item-review-more-content.kcm-force-visible {
  display: block !important;
  opacity: 1 !important;
  max-height: none !important;
  overflow: visible !important;
  margin-top: 14px;
}

.booking-item-review-more-content .kcm-comment-media-gallery {
  display: grid !important;
}
