/* Location is the focus; the form remains safely behind this dialog. */
.admin-dialog.map-dialog {
  width: min(920px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  border: 1px solid rgba(255, 255, 255, .94);
  border-radius: 20px;
  background: #fcfaff;
  color: #3d304b;
  box-shadow: 0 30px 100px rgba(27, 12, 47, .27), 0 7px 24px rgba(27, 12, 47, .09), inset 0 1px 0 #fff;
}

.map-dialog-layout {
  display: flex;
  min-width: 0;
  max-height: calc(100dvh - 42px);
  flex-direction: column;
}

.map-dialog .map-dialog-header {
  min-height: 82px;
  padding: 19px 24px;
  border-bottom: 1px solid #e9e1f1;
  background: linear-gradient(110deg, #fdfbff, #f4eefb);
}

.map-dialog-heading {
  display: flex;
  min-width: 0;
  gap: 13px;
  align-items: center;
}

.map-heading-icon,
.map-selection-icon,
.map-boot-pin {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(139, 96, 199, .12);
  border-radius: 12px;
  background: #eee6f9;
  box-shadow: inset 0 1px 0 #fff;
  color: #8254b5;
}

.map-heading-icon svg,
.map-selection-icon svg,
.map-boot-pin svg,
.map-loading svg {
  width: 22px;
  height: 22px;
}

.map-dialog .modal-title {
  margin: 0;
  color: #392947;
  font-size: 19px;
  line-height: 1.4;
}

.map-dialog .modal-description {
  margin: 5px 0 0;
  color: #8b7b97;
  font-size: 12px;
  line-height: 1.6;
}

.map-dialog .map-dialog-body {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  overflow: auto;
  padding: 20px 24px;
  background: #fcfaff;
  overscroll-behavior: contain;
}

.map-dialog .alert {
  overflow-wrap: anywhere;
}

.map-boot {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 17px;
  text-align: center;
}

.map-boot strong {
  color: #6d5b7c;
  font-size: 14px;
  font-weight: 500;
}

.map-boot p {
  margin: -6px 0 0;
  color: #9d8fac;
  font-size: 12px;
}

.map-picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px 20px;
  margin-bottom: 13px;
  color: #998ba7;
  font-size: 11px;
}

.map-context-city {
  color: #715583;
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.map-canvas {
  position: relative;
  height: 400px;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid #e6deef;
  border-radius: 12px;
  background: #f0eaf7;
  box-shadow: inset 0 2px 6px rgba(61, 37, 84, .03);
}

.map-picker-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.map-loading {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #f4eff9;
  color: #9a81ae;
  font-size: 13px;
  pointer-events: none;
}

.map-loading strong {
  font-weight: 500;
}

.map-load-note {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3px 14px;
  margin: 10px 0 16px;
  color: #9b8ca7;
  font-size: 11px;
  line-height: 1.7;
}

.map-load-note > div {
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
}

.map-load-note button {
  min-height: 28px;
  margin: -5px 0 0;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: #8057ad;
  font-size: inherit;
}

.map-load-note button:hover {
  color: #5f348e;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.map-load-note button:focus-visible {
  border-radius: 3px;
  outline: 2px solid #a484c7;
  outline-offset: 3px;
}

.map-selection {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid #e8e0f0;
  border-radius: 12px;
  background: linear-gradient(115deg, #fff, #f7f2fc);
  box-shadow: 0 3px 12px rgba(82, 48, 115, .025), inset 0 1px 0 #fff;
}

.map-selection-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.map-selection-icon svg {
  width: 20px;
  height: 20px;
}

.map-selection-content {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.map-selection-content strong {
  display: block;
  color: #63506f;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}

.map-selection-content p {
  margin: 4px 0 0;
  color: #796585;
  font-size: 12px;
  line-height: 1.8;
}

.map-selection-content > span {
  display: block;
  margin-top: 7px;
  color: #a092ab;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
}

.map-selection > .badge-soft {
  flex: 0 0 auto;
  margin-top: 3px;
}

.map-dialog .map-picker-footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 16px 24px;
  border-top: 1px solid #e9e1f1;
  background: #f8f4fc;
}

.map-footer-note {
  color: #a093ab;
  font-size: 11px;
}

.map-footer-actions,
.map-config-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.map-footer-actions .btn {
  min-width: 90px;
}

.map-config-panel {
  width: 460px;
  max-width: 100%;
  margin: 7px auto 14px;
}

.map-config-intro {
  margin-bottom: 28px;
}

.map-config-intro h3 {
  margin: 17px 0 9px;
  color: #5b436a;
  font-size: 21px;
  font-weight: 500;
}

.map-config-intro p,
.map-config-managed p {
  margin: 0;
  color: #94829f;
  font-size: 12px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.map-config-panel fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.map-config-panel .form-label {
  color: #705b7d;
  font-size: 12px;
}

.map-config-panel .form-hint {
  margin-top: 8px;
  color: #a092ab;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.map-config-panel .form-control {
  min-width: 0;
  height: 44px;
  border: 1px solid #e1d8eb;
  background: #fff;
  color: #574064;
  font-size: 13px;
}

.map-config-panel .form-control:focus {
  border-color: #b69ad2;
  box-shadow: 0 0 0 3px rgba(132, 86, 188, .09);
}

.map-config-guide {
  margin: 26px 0 30px;
  padding: 15px 17px;
  border: 1px solid #e9e1f1;
  border-radius: 10px;
  background: #f4eef9;
}

.map-config-guide a {
  color: #7b51a3;
  font-size: 12px;
}

.map-config-guide a > span {
  margin-left: 5px;
}

.map-config-guide p {
  margin: 7px 0 0;
  color: #a18eac;
  font-size: 11px;
  line-height: 1.9;
}

.map-config-managed {
  padding: 19px;
  border: 1px solid #e8e0f0;
  border-radius: 12px;
  background: #f5f0fa;
}

.map-config-managed strong {
  display: block;
  margin-bottom: 12px;
  color: #725487;
  font-size: 14px;
  font-weight: 500;
}

.map-config-managed-actions {
  margin-top: 20px;
}

/* Entry points share the same compact location treatment in both forms. */
.store-address-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.store-address-label label {
  margin: 0;
}

.store-address-label .btn {
  min-height: 38px;
  flex: 0 0 auto;
}

.store-location-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  color: #a293ae;
  font-size: 12px;
  line-height: 1.7;
}

.store-location-summary > svg,
.store-location-summary > span[data-icon],
.store-location-summary > span[data-icon] > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.store-location-summary.has-location {
  color: #5c9a80;
}

#clear-store-location {
  margin-left: auto;
  padding: 3px 0 3px 8px;
  border: 0;
  background: transparent;
  color: #9276ad;
  font-size: 11px;
}

#clear-store-location:hover {
  color: #714b99;
}

.store-coordinate-details {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid #eee7f4;
}

.store-coordinate-details > summary {
  width: fit-content;
  color: #9a88a7;
  font-size: 12px;
  cursor: pointer;
}

.store-coordinate-details[open] > summary {
  margin-bottom: 14px;
}

.store-coordinate-details .row {
  row-gap: 12px;
}

.card.map-config-card {
  margin-top: 22px;
}

.map-config-card .card-body.map-config-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.map-config-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(139, 96, 199, .08);
  border-radius: 13px;
  background: #eee6f9;
  color: #906bc0;
  box-shadow: inset 0 1px 0 #fff;
}

.map-config-icon svg {
  width: 23px;
  height: 23px;
}

.map-config-copy {
  min-width: 0;
  flex: 1;
}

.map-config-copy h3 {
  margin: 0 0 7px;
  color: #6d537f;
  font-size: 15px;
  font-weight: 500;
}

.map-config-copy p {
  margin: 0;
  color: #a08ead;
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .admin-dialog.map-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
  }
  .map-dialog-layout { max-height: calc(100dvh - 26px); }
  .map-dialog .map-dialog-header { gap: 12px; min-height: 74px; padding: 16px; }
  .map-dialog-heading { gap: 10px; }
  .map-heading-icon { width: 34px; height: 34px; border-radius: 10px; }
  .map-heading-icon svg { width: 20px; height: 20px; }
  .map-dialog .modal-title { font-size: 17px; }
  .map-dialog .modal-description { font-size: 10px; }
  .map-dialog .map-dialog-body { padding: 16px; }
  .map-picker-toolbar { align-items: flex-start; flex-direction: column; gap: 5px; }
  .map-picker-toolbar > span:last-child { font-size: 10px; }
  .map-canvas { height: 48dvh; min-height: 250px; border-radius: 10px; }
  .map-load-note { margin-bottom: 13px; font-size: 10px; }
  .map-selection { gap: 10px; padding: 13px 11px; border-radius: 10px; }
  .map-selection-icon { width: 31px; height: 31px; border-radius: 8px; }
  .map-selection-icon svg { width: 18px; height: 18px; }
  .map-selection-content strong { font-size: 12px; }
  .map-selection-content p { font-size: 11px; }
  .map-selection-content > span { font-size: 9px; }
  .map-selection > .badge-soft { display: none; }
  .map-dialog .map-picker-footer { gap: 8px; padding: 13px 16px; }
  .map-footer-note { width: 100%; font-size: 10px; }
  .map-footer-actions { width: 100%; }
  .map-footer-actions .btn { flex: 1; min-width: 0; }
  .map-config-panel { margin-top: 2px; }
  .map-config-intro { margin-bottom: 23px; }
  .map-config-intro h3 { font-size: 19px; }
  .map-config-intro p { font-size: 11px; }
  .map-config-guide { margin: 23px 0; padding: 12px; }
  .map-config-guide p { font-size: 10px; }
  .map-config-actions .btn { min-width: 0; font-size: 12px; }
  .map-config-card .card-body.map-config-card-body { flex-wrap: wrap; gap: 13px; }
  .map-config-card-body > .btn { margin-left: 57px; }
  .map-config-copy { flex-basis: calc(100% - 57px); }
  .map-config-copy h3 { font-size: 14px; }
  .map-config-copy p { font-size: 11px; }
  .store-location-summary { font-size: 11px; }
}

@media (max-height: 700px) and (min-width: 701px) {
  .map-canvas { height: 290px; }
}
