/* bf-cropper — modal crop & frame widget. Self-contained, no theme deps. */

.bf-crop-overlay {
  position: fixed; inset: 0;
  background: rgba(13, 31, 54, .62);
  backdrop-filter: blur(3px);
  z-index: 5000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: bfCropFadeIn .18s ease-out;
}
@keyframes bfCropFadeIn { from { opacity: 0; } to { opacity: 1; } }

.bf-crop-modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .30);
  width: 100%;
  max-width: 780px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  display: flex; flex-direction: column;
  animation: bfCropSlideIn .22s ease-out;
}
@keyframes bfCropSlideIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.bf-crop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #eef1f4;
}
.bf-crop-title {
  font-size: 14px; font-weight: 800; color: #0d1f36;
  display: flex; align-items: center; gap: 8px;
}
.bf-crop-title i { color: #c0392b; font-size: 15px; }

.bf-crop-close {
  background: transparent; border: none;
  width: 32px; height: 32px; border-radius: 8px;
  color: #6b6b6b; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.bf-crop-close:hover { background: #f4f4f2; color: #0d1f36; }

.bf-crop-stage-wrap {
  padding: 22px 22px 12px;
  display: flex; justify-content: center;
  background: linear-gradient(180deg, #fafaf9 0%, #f4f4f2 100%);
}

.bf-crop-stage {
  position: relative;
  background: #0d1f36;
  border: 1px solid #d6e2ee;
  border-radius: 10px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .5), 0 8px 24px rgba(0, 0, 0, .18);
}
.bf-crop-stage:active { cursor: grabbing; }
.bf-crop-stage.round { border-radius: 50%; }

.bf-crop-canvas {
  display: block;
  width: 100%; height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.bf-crop-ctrls {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px 6px;
}

.bf-crop-cbtn {
  background: #fff; border: 1px solid #e6e8ea;
  width: 34px; height: 34px; border-radius: 8px;
  color: #4a4a4a; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .12s, color .12s, background .12s;
  flex-shrink: 0;
}
.bf-crop-cbtn:hover { border-color: #0d1f36; color: #0d1f36; background: #fafaf9; }

.bf-crop-zoom {
  flex: 1;
  accent-color: #c0392b;
  height: 4px;
}

.bf-crop-hint {
  font-size: 11.5px;
  color: #7a7a7a;
  padding: 4px 22px 0;
  text-align: center;
}

.bf-crop-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 22px 20px;
  border-top: 1px solid #eef1f4;
  margin-top: 12px;
}

.bf-crop-btn {
  font-size: 12.5px; font-weight: 700;
  padding: 9px 18px; border-radius: 8px;
  cursor: pointer; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .12s, border-color .12s, color .12s;
}
.bf-crop-btn.ghost   { background: #fff; color: #4a4a4a; border-color: #e6e8ea; }
.bf-crop-btn.ghost:hover { border-color: #0d1f36; color: #0d1f36; }
.bf-crop-btn.primary { background: #c0392b; color: #fff; }
.bf-crop-btn.primary:hover { background: #a93123; }
.bf-crop-btn.primary i { font-size: 14px; }

@media (max-width: 520px) {
  .bf-crop-modal { border-radius: 12px; }
  .bf-crop-head, .bf-crop-ctrls, .bf-crop-foot, .bf-crop-hint { padding-left: 16px; padding-right: 16px; }
  .bf-crop-stage-wrap { padding: 16px 12px 8px; }
}
