/*
 * Editor fotky (pokyn #256) — assets/js/components/rb-photo-editor.js.
 * Velký dialog: vlevo fotka s výřezem, vpravo nástroje; do 767 px nástroje
 * pod fotkou. Barvy z proměnných webu, se záložními hodnotami pro wp-admin.
 */
.rb-pe {
  --pe-ink: var(--rb--purple-900, #280014);
  --pe-line: var(--rb--purple-700-15, rgba(74, 9, 48, .15));
  --pe-soft: var(--basic--100, #f5f4f0);
  --pe-accent: var(--rb--orange, #f7a723);
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
  height: min(860px, calc(100dvh - 32px));
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: var(--pe-ink);
  box-shadow: 0 20px 60px rgba(40, 0, 20, .35);
  font-family: inherit;
  overflow: hidden;
}
.rb-pe::backdrop { background: rgba(40, 0, 20, .6); }
.rb-pe *, .rb-pe *::before, .rb-pe *::after { box-sizing: border-box; }
.rb-pe-card { display: flex; flex-direction: column; height: 100%; margin: 0; }
.rb-pe-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--pe-line); }
.rb-pe-head h4 { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 800; color: var(--pe-ink); }
.rb-pe-x { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--pe-soft); color: var(--pe-ink); cursor: pointer; }
.rb-pe-x:hover { background: var(--pe-line); }
.rb-pe-main { flex: 1 1 auto; display: flex; min-height: 0; }
.rb-pe-stage { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; background: #1e0b16; }
.rb-pe-stage > img { display: block; max-width: 100%; opacity: 0; }
.rb-pe-stage .cropper-container { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; }
.rb-pe-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; background: #1e0b16; }
.rb-pe-loading[hidden] { display: none; }
.rb-pe-side { flex: 0 0 300px; display: flex; flex-direction: column; gap: 22px; padding: 20px; overflow-y: auto; border-left: 1px solid var(--pe-line); }
.rb-pe-group { display: flex; flex-direction: column; gap: 10px; }
.rb-pe-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.rb-pe-chips, .rb-pe-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.rb-pe-chip, .rb-pe-tool, .rb-pe-reset, .rb-pe-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border: 1px solid var(--pe-line); border-radius: 40px;
  background: var(--pe-soft); color: var(--pe-ink); font: inherit; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer;
}
.rb-pe-chip:hover, .rb-pe-tool:hover, .rb-pe-reset:hover, .rb-pe-btn:hover { border-color: var(--pe-ink); }
.rb-pe-chip[aria-pressed="true"] { background: var(--pe-ink); border-color: var(--pe-ink); color: #fff; }
.rb-pe-tool { flex: 1 1 0; padding: 0 10px; }
.rb-pe-reset { align-self: flex-start; background: transparent; }
.rb-pe-slider { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.rb-pe-slider-top { display: flex; justify-content: space-between; }
.rb-pe-slider output { font-weight: 400; opacity: .7; font-variant-numeric: tabular-nums; }
.rb-pe-slider input[type="range"] { width: 100%; margin: 0; accent-color: var(--pe-accent); }
.rb-pe-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--pe-line); }
.rb-pe-btn { min-height: 46px; padding: 0 22px; font-size: 16px; }
.rb-pe-primary { background: var(--pe-accent); border-color: var(--pe-accent); color: var(--pe-ink); font-weight: 700; }
.rb-pe-primary:hover { border-color: var(--pe-ink); }
.rb-pe-btn:disabled { opacity: .5; cursor: progress; }
.rb-pe button:focus-visible, .rb-pe input:focus-visible { outline: 2px solid var(--pe-accent); outline-offset: 2px; }

@media screen and (max-width: 767px) {
  .rb-pe { width: 100vw; height: 100dvh; border-radius: 0; }
  .rb-pe-head { padding: 10px 14px; }
  .rb-pe-head h4 { font-size: 18px; }
  .rb-pe-main { flex-direction: column; }
  .rb-pe-stage { flex: 1 1 55%; }
  .rb-pe-side { flex: 0 1 auto; max-height: 45%; gap: 14px; padding: 14px; border-left: 0; border-top: 1px solid var(--pe-line); }
  .rb-pe-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .rb-pe-btn { flex: 1 1 0; }
}

/* Náhled fotky v recenzi: tlačítko „Upravit" (reviews-upload.js). */
.rb-review-edit-btn {
  position: absolute; left: 6px; bottom: 6px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 9px;
  border: 0; border-radius: 20px; background: rgba(40, 0, 20, .78); color: #fff;
  font: inherit; font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer;
}
.rb-review-edit-btn:hover { background: var(--rb--purple-900, #280014); }
.upload-image-wrapper { position: relative; }
