/* Ветви ручного местоположения сохраняют обычный порядок полей формы. */
.product-location-form {
  border: 1px solid #d8e1eb;
  border-radius: 10px;
  margin: 16px 0;
  padding: 14px;
  min-width: 0;
}
.product-location-form legend { padding: 0 6px; font-weight: 600; }
.product-location-form > .input-text { margin: 8px 0; }
.product-location-form [hidden] { display: none !important; }
.product-location-form small { display: block; margin-top: 8px; color: #475569; }
.product-location-map { height: 300px; width: 100%; margin: 10px 0; border-radius: 8px; background: #e8eef3; }
.product-location-form .maplibregl-ctrl-attrib { font-size: 10px; }
#elem-location-map-status { font-size: 13px; line-height: 1.5; }
@media (max-width: 600px) { .product-location-map { height: 260px; } }

/* Уведомление относится к сохранению продукта, а не к готовности его полей БД. */
.product-collection-notice { padding: 10px 12px; border-radius: 8px; background: #edf5ff; color: #234268; }
.product-collection-notice[hidden], #elem-location-form[hidden] { display: none !important; }

/* Высокая форма и материалы прокручиваются в пределах экрана, карта не сжимается. */
#modal-add-element .modal-box {
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  box-sizing: border-box;
}
.product-location-manual-entry { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.product-location-manual-entry[hidden] { display: none !important; }
.product-material-dialog {
  width: min(940px, calc(100vw - 28px));
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  box-sizing: border-box;
  border: 1px solid #d8e1eb;
  border-radius: 12px;
  padding: 20px;
}
.product-material-dialog::backdrop { background: rgba(15, 23, 42, .4); }
.product-material-dialog .product-location-map { height: 320px; min-height: 240px; flex-shrink: 0; }
.product-material-dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.product-material-dialog li { overflow-wrap: anywhere; }
.product-material-dialog input[type="number"] { box-sizing: border-box; width: calc(50% - 8px); margin: 4px; padding: 9px; }
@media (max-width: 600px) {
  #modal-add-element .modal-box { width: calc(100% - 16px); padding: 16px; }
  .product-location-manual-entry .btn { width: 100%; white-space: normal; }
  .product-material-dialog { padding: 14px; width: calc(100vw - 16px); }
  .product-material-dialog .product-location-map { height: 260px; }
  .product-material-dialog input[type="number"] { width: calc(100% - 8px); }
}
