/* Éditeur de photo (rotation / recadrage) — voir assets/js/photo-editor.js */
html.mkd-pe-lock, html.mkd-pe-lock body { overflow: hidden; }

.mkd-pe { display: none; position: fixed; inset: 0; z-index: 20000;
          background: rgba(0,0,0,.65); align-items: center; justify-content: center; padding: 12px; }
.mkd-pe.mkd-pe-open { display: flex; }

.mkd-pe-dialog { background: #fff; border-radius: 10px; width: 100%; max-width: 720px;
                 max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.mkd-pe-head { padding: 12px 16px; font-weight: 600; font-size: 1.05rem; border-bottom: 1px solid #e5e5e5; }
.mkd-pe-body { display: block; padding: 12px 16px; overflow: auto; flex: 1 1 auto; }
.mkd-pe-stage { height: 56vh; max-height: 560px; background: #f1f1f1; border-radius: 6px; overflow: hidden; }
.mkd-pe-stage img { display: block; max-width: 100%; }

.mkd-pe-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mkd-pe-tools button, .mkd-pe-foot button {
    border: 1px solid #bbb; background: #f6f6f6; border-radius: 6px;
    padding: 8px 12px; font-size: .9rem; cursor: pointer; }
.mkd-pe-tools button:hover, .mkd-pe-foot button:hover { background: #ececec; }

.mkd-pe-side { flex: 0 0 200px; }
.mkd-pe-side-title { font-weight: 600; margin-bottom: 8px; }
.mkd-pe-previews { display: flex; flex-direction: column; gap: 10px; }
.mkd-pe-pv { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: #555; }
.mkd-pe-pv canvas { width: 150px; border: 1px solid #ccc; background: #fff; }
.mkd-pe-info { margin: 10px 0 0; font-size: .9rem; color: #555; }
.mkd-pe-legend { font-size: .78rem; color: #666; margin: 0; }
.mkd-pe-hatch { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; border: 1px solid #888;
    background: repeating-linear-gradient(45deg, rgba(0,0,0,.55) 0 3px, rgba(255,255,255,.4) 3px 6px); }

.mkd-pe-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
               padding: 12px 16px; border-top: 1px solid #e5e5e5; }
.mkd-pe-foot .mkd-pe-ok { background: #f0ad00; border-color: #d99a00; font-weight: 600; }

/* Bandes hachurées = parties coupées par le recadrage 4:3 du serveur */
.mkd-pe-loss-wrap { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mkd-pe-loss { position: absolute;
    background: repeating-linear-gradient(45deg, rgba(0,0,0,.6) 0 5px, rgba(255,255,255,.25) 5px 10px); }

@media (max-width: 720px) {
    .mkd-pe { padding: 0; }
    .mkd-pe-dialog { border-radius: 0; height: 100%; }
    .mkd-pe-body { flex-direction: column; }
    .mkd-pe-side { flex: 0 0 auto; }
    .mkd-pe-previews { flex-direction: row; flex-wrap: wrap; }
    .mkd-pe-stage { height: 46vh; }
}

/* Bouton « Modifier » (crayon) sur chaque photo déjà présente dans l'annonce :
   empilé au-dessus de la croix de suppression, même taille */
.mkd-col { display: flex !important; flex-direction: column; align-items: flex-end; gap: 6px; }
.mkd-crop-btn { display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; min-height: 30px; padding: 0 8px; border: 0; border-radius: 4px;
    background: rgba(40,40,40,.85); color: #fff; font-size: .9rem; line-height: 1; cursor: pointer; }
.mkd-crop-btn:hover { background: #000; }
.mkd-crop-btn:disabled { opacity: .7; cursor: wait; }
.mkd-crop-float { position: absolute; top: 6px; left: 6px; z-index: 11; }

/* Poignées de coin bien visibles (rangées À L'INTÉRIEUR du cadre pour ne pas être rognées) */
.mkd-pe .cropper-point.point-n, .mkd-pe .cropper-point.point-s,
.mkd-pe .cropper-point.point-e, .mkd-pe .cropper-point.point-w { display: none; }
.mkd-pe .cropper-point.point-nw, .mkd-pe .cropper-point.point-ne,
.mkd-pe .cropper-point.point-sw, .mkd-pe .cropper-point.point-se {
    width: 18px; height: 18px; opacity: 1; background: #fff;
    border: 2px solid #0d6efd; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.mkd-pe .cropper-point.point-nw { top: 0;    left: 0; }
.mkd-pe .cropper-point.point-ne { top: 0;    right: 0; left: auto; }
.mkd-pe .cropper-point.point-sw { bottom: 0; left: 0;  top: auto; }
.mkd-pe .cropper-point.point-se { bottom: 0; right: 0; top: auto; left: auto; }
@media (pointer: coarse) {
    .mkd-pe .cropper-point.point-nw, .mkd-pe .cropper-point.point-ne,
    .mkd-pe .cropper-point.point-sw, .mkd-pe .cropper-point.point-se { width: 26px; height: 26px; }
}

/* Zone hors cadre : voile clair (et non noir) */
.mkd-pe .cropper-modal { background: #fff; opacity: .6; }
