/**
 * RetailFix Core — "Position your photo" pop-up styles, with image-crop.js.
 *
 * This software was originally conceived, designed, architected, and
 * developed by Jess Maron. The underlying concepts, system structure,
 * functionality, workflows, and custom code represent original creative
 * and technical work by its creator. Attribution to the original creator
 * is intended to remain associated with this work.
 */

/* Above every other pop-up on the Suite and the Studio (the Suite's store
   details sit at 100000); under the Suite's toasts and the confirm dialog. */
.rf-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 27, 27, 0.55);
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.rf-crop-modal {
  width: 100%;
  max-width: 460px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  padding: 26px 24px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  color: #1c1b1b;
}

.rf-crop-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.rf-crop-head-text {
  flex: 1 1 auto;
  min-width: 0;
}
.rf-crop-title {
  font-family: "Dongle", sans-serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 0.7;
  color: #bb0016;
  padding-top: 8px;
  text-wrap: balance;
}
.rf-crop-hint {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #5c3f3d;
}
.rf-crop-step {
  margin-bottom: 6px;
  color: #bb0016;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rf-crop-x {
  flex: none;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #fbe9e5;
  color: #bb0016;
  cursor: pointer;
}

.rf-crop-shapes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.rf-crop-shape {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1.5px solid #e6bdb9;
  border-radius: 999px;
  background: #fff;
  color: #5c3f3d;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.rf-crop-shape-box {
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 3px;
}
.rf-crop-shape.is-on {
  border-color: #bb0016;
  background: #fbe9e5;
  color: #bb0016;
}

.rf-crop-stage {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #1c1b1b;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.rf-crop-stage.is-dragging {
  cursor: grabbing;
}
.rf-crop-stage:focus-visible {
  box-shadow: 0 0 0 3px #fea121;
}
.rf-crop-img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  pointer-events: none;
  -webkit-user-drag: none;
}
.rf-crop-paper {
  position: absolute;
  background: #fff;
  border-radius: 6px;
}
.rf-crop-paper.is-round {
  border-radius: 50%;
}
/* The frame: clear inside, the picture dimmed outside it. */
.rf-crop-frame {
  position: absolute;
  box-sizing: border-box;
  pointer-events: none;
  border: 2px solid #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 2000px rgba(28, 27, 27, 0.62);
}
.rf-crop-frame.is-round {
  border-radius: 50%;
}

.rf-crop-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.rf-crop-zoom-btn {
  flex: none;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #f6f3f2;
  color: #5c3f3d;
  cursor: pointer;
}
/* Rotate: a quarter turn clockwise, at the end of the zoom row. */
.rf-crop-rotate {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1.5px solid #e6bdb9;
  border-radius: 999px;
  background: #fff;
  color: #5c3f3d;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.rf-crop-rotate:hover {
  border-color: #bb0016;
  color: #bb0016;
}
.rf-crop-slider {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  --rf-crop-fill: 0%;
}
.rf-crop-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, #bb0016 var(--rf-crop-fill), #f1e4e1 var(--rf-crop-fill));
}
.rf-crop-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #f1e4e1;
}
.rf-crop-slider::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: #bb0016;
}
.rf-crop-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 3px solid #bb0016;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.rf-crop-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid #bb0016;
  border-radius: 50%;
  background: #fff;
}
.rf-crop-slider:focus-visible {
  outline: 2px solid #fea121;
  outline-offset: 2px;
  border-radius: 999px;
}

.rf-crop-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fbe9e5;
  color: #5c3f3d;
  font-size: 12.5px;
  line-height: 1.45;
}
.rf-crop-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.rf-crop-cancel,
.rf-crop-ok {
  flex: 1 1 0;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.rf-crop-cancel {
  border: 1.5px solid #e6bdb9;
  background: #fff;
  color: #5c3f3d;
}
.rf-crop-ok {
  border: 0;
  background: #bb0016;
  color: #fff;
  box-shadow: 0 6px 16px rgba(187, 0, 22, 0.22);
}
.rf-crop-cancel:focus-visible,
.rf-crop-ok:focus-visible,
.rf-crop-x:focus-visible,
.rf-crop-zoom-btn:focus-visible,
.rf-crop-rotate:focus-visible,
.rf-crop-shape:focus-visible {
  outline: 2px solid #fea121;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .rf-crop-overlay {
    padding: 12px;
  }
  .rf-crop-modal {
    padding: 22px 16px 16px;
    border-radius: 20px;
  }
  .rf-crop-title {
    font-size: 36px;
  }
}

/* Short screens, such as a phone on its side: tighter, and the hint goes. */
@media (max-height: 560px) {
  .rf-crop-overlay {
    padding: 8px;
  }
  .rf-crop-modal {
    padding: 14px 16px 12px;
    max-height: calc(100dvh - 16px);
  }
  .rf-crop-head {
    margin-bottom: 8px;
  }
  .rf-crop-title {
    font-size: 32px;
  }
  .rf-crop-hint {
    display: none;
  }
  .rf-crop-shapes {
    margin-bottom: 8px;
  }
  .rf-crop-shape {
    padding: 5px 10px;
  }
  .rf-crop-zoom {
    margin-top: 8px;
  }
  .rf-crop-note {
    margin-top: 8px;
    padding: 6px 10px;
    font-size: 11.5px;
  }
  .rf-crop-actions {
    margin-top: 10px;
  }
  .rf-crop-cancel,
  .rf-crop-ok {
    min-height: 40px;
    padding: 9px 14px;
  }
}
