/* Окно "Хотите добавить фотографии?" на странице /заявка и окно выбора участка фотографии (рамка 5:4) */

.ph-back { align-items: center; background: rgba(20,12,10,.6); display: flex; inset: 0; justify-content: center; padding: 18px; position: fixed; z-index: 2000; }
.ph-back[hidden] { display: none; }
.ph-modal { background: #fff; border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.4); box-sizing: border-box; max-height: 100%; max-width: 640px; overflow: auto; padding: 26px 28px 24px; position: relative; width: 100%; }
.ph-modal h3 { font-size: 22px; margin: 0 34px 8px 0; text-align: left; }
.ph-sub { color: #7d726d; font-size: 14px; line-height: 1.55; margin: 0 0 16px; text-align: left; }
.ph-sub b { color: #251f1d; font-weight: 600; }
.ph-x { background: none; border: 0; color: #9a8c86; cursor: pointer; font-size: 28px; height: 36px; line-height: 1; position: absolute; right: 14px; top: 12px; width: 36px; }
.ph-x:hover { color: #251f1d; }
.ph-drop { align-items: center; background: #faf6f4; border: 2px dashed #dccbc5; border-radius: 14px; box-sizing: border-box; color: #7d726d; cursor: pointer; display: flex; flex-direction: column; gap: 4px; padding: 20px 16px; text-align: center; transition: background .15s ease, border-color .15s ease; }
.ph-drop:hover, .ph-drop.over { background: #fbeae7; border-color: #cd4436; color: #a8362a; }
.ph-drop svg { color: #cd4436; height: 28px; width: 28px; }
.ph-drop b { color: #251f1d; font-size: 15px; }
.ph-drop span { font-size: 13px; }
.ph-drop.full { cursor: default; opacity: .55; }
.ph-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); margin-top: 14px; }
.ph-list:empty { display: none; }
.ph-item { aspect-ratio: 5 / 4; background: #1f1816; border-radius: 10px; overflow: hidden; position: relative; }
.ph-item img { display: block; height: 100%; object-fit: cover; width: 100%; }
.ph-item button { background: rgba(20,12,10,.72); border: 0; border-radius: 50%; color: #fff; cursor: pointer; font-size: 17px; height: 26px; line-height: 1; position: absolute; right: 6px; top: 6px; width: 26px; }
.ph-item button:hover { background: #cd4436; }
.ph-count { color: #7d726d; font-size: 13px; margin-top: 10px; min-height: 18px; text-align: left; }
.ph-msg { background: #fdf3df; border-radius: 10px; color: #8a5a0a; font-size: 13px; margin-top: 10px; padding: 8px 12px; text-align: left; }
.ph-msg[hidden] { display: none; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.ph-btn, .crop-modal .btn { background: #fff; border: 1px solid #dccbc5; border-radius: 10px; box-shadow: none; box-sizing: border-box; color: #251f1d; cursor: pointer; display: inline-block; font-size: 15px; font-weight: 700; padding: 12px 18px; text-align: center; text-decoration: none; width: auto; }
.ph-btn:hover, .crop-modal .btn:hover { background: #f6efec; box-shadow: none; }
.ph-btn.ph-save, .crop-modal .btn-primary { background: #cd4436; border-color: #cd4436; color: #fff; }
.ph-btn.ph-save:hover, .crop-modal .btn-primary:hover { background: #a8362a; border-color: #a8362a; }
.ph-btn:disabled, .ph-btn[disabled] { cursor: not-allowed; opacity: .5; }
@media (max-width: 640px) {
  .ph-back { padding: 10px; }
  .ph-modal { padding: 20px 16px 16px; }
  .ph-modal h3 { font-size: 19px; }
  .ph-actions { flex-direction: column-reverse; }
  .ph-btn { width: 100%; }
}

/* окно выбора участка фотографии (рамка 5:4) */
body.crop-open { overflow: hidden; }
.crop-back { align-items: center; background: rgba(20,12,10,.62); display: flex; inset: 0; justify-content: center; padding: 18px; position: fixed; z-index: 2100; }
.crop-modal { background: #fff; border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.4); display: flex; flex-direction: column; max-height: 100%; max-width: 860px; padding: 22px 24px 20px; width: 100%; }
.crop-head h3 { font-size: 20px; margin: 0 0 6px; }
.crop-head p { color: #7d726d; font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; }
.crop-stage { align-items: center; background: #1f1816; border-radius: 12px; display: flex; flex: 1 1 auto; height: min(58vh, 520px); justify-content: center; min-height: 180px; overflow: hidden; }
.crop-wrap { flex: 0 0 auto; position: relative; touch-action: none; user-select: none; -webkit-user-select: none; }
.crop-img { display: block; height: 100%; left: 0; pointer-events: none; position: absolute; top: 0; user-select: none; width: 100%; }
.crop-box { border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(15,9,8,.62); cursor: move; position: absolute; touch-action: none; }
.crop-box:before { background:
    linear-gradient(to right, transparent calc(33.333% - .5px), rgba(255,255,255,.45) calc(33.333% - .5px), rgba(255,255,255,.45) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255,255,255,.45) calc(66.666% - .5px), rgba(255,255,255,.45) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
    linear-gradient(to bottom, transparent calc(33.333% - .5px), rgba(255,255,255,.45) calc(33.333% - .5px), rgba(255,255,255,.45) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255,255,255,.45) calc(66.666% - .5px), rgba(255,255,255,.45) calc(66.666% + .5px), transparent calc(66.666% + .5px));
  content: ""; inset: 0; pointer-events: none; position: absolute; }
.crop-h { background: #fff; border: 2px solid #cd4436; border-radius: 4px; height: 16px; position: absolute; width: 16px; }
.crop-h:after { content: ""; inset: -10px; position: absolute; }
.crop-h.nw { cursor: nwse-resize; left: -9px; top: -9px; }
.crop-h.ne { cursor: nesw-resize; right: -9px; top: -9px; }
.crop-h.sw { bottom: -9px; cursor: nesw-resize; left: -9px; }
.crop-h.se { bottom: -9px; cursor: nwse-resize; right: -9px; }
.crop-zoom { align-items: center; color: #7d726d; display: flex; font-size: 13px; gap: 12px; margin-top: 14px; }
.crop-zoom input[type=range] { accent-color: #cd4436; flex: 1 1 auto; min-width: 0; }
.crop-zoom b { color: #251f1d; font-weight: 600; min-width: 96px; text-align: right; }
.crop-warn { background: #fdf3df; border-radius: 10px; color: #8a5a0a; font-size: 13px; margin-top: 12px; padding: 9px 12px; }
.crop-warn[hidden] { display: none; }
.crop-foot { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 16px; }
.crop-count { align-items: baseline; display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.crop-count b { font-size: 15px; }
.crop-name { color: #7d726d; font-size: 12.5px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crop-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 640px) {
  .crop-back { padding: 10px; }
  .crop-modal { padding: 16px 14px 14px; }
  .crop-head h3 { font-size: 18px; }
  .crop-head p { font-size: 12.5px; margin-bottom: 10px; }
  .crop-stage { height: min(46vh, 420px); }
  .crop-zoom b { min-width: 84px; }
  .crop-foot { align-items: stretch; flex-direction: column; }
  .crop-actions .btn { flex: 1 1 0; justify-content: center; }
}

/* общие стили сайта (p выровнен по ширине, h3 по центру) внутри окон нам не нужны */
.crop-head h3 { text-align: left; }
.crop-head p, .crop-warn { text-align: left; }
.crop-foot, .crop-zoom, .crop-count { text-align: left; }
body.ph-open { overflow: hidden; }
