/* Sectioned variant of the shared editor modal. */
.modal.sectioned-entry {
  --entry-inset: 24px;
  --entry-gap: 16px;
  width: min(640px, 100%);
  max-height: calc(100dvh - 48px);
}
.modal.sectioned-entry-wide {
  width: min(1060px, calc(100vw - 48px));
}
.sectioned-entry .modal-head {
  align-items: center;
  padding: 16px var(--entry-inset);
}
.sectioned-entry .modal-head h2 { letter-spacing: 0; }
.sectioned-entry .modal-head .icon-button { margin: -4px -4px -4px 0; }
.sectioned-entry form > .modal-body {
  box-sizing: border-box;
  min-width: 0;
  padding: 0 var(--entry-inset) 20px;
  scroll-padding-block: 14px;
  overscroll-behavior: contain;
}
.sectioned-entry .modal-body.pc-form-fields { display: block; }
.entry-group, .entry-subheading {
  min-width: 0;
  padding-block: var(--entry-gap);
  border-bottom: 1px solid var(--line);
}
.entry-group:last-child { border-bottom: 0; padding-bottom: 0; }
.entry-subheading { border-bottom: 0; padding-bottom: 10px; }
.entry-group-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
}
.entry-subheading .entry-group-title { margin: 0; }
.sectioned-entry .entry-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px var(--entry-gap);
  align-items: start;
}
.sectioned-entry .entry-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sectioned-entry .entry-grid-order { grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); }
.sectioned-entry .entry-grid-delivery { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); }
.sectioned-entry .entry-grid > .span-2 { grid-column: 1 / -1; }
.sectioned-entry .entry-grid > .field { min-width: 0; gap: 5px; margin: 0; }
.sectioned-entry .entry-grid > .field > span { min-height: 20px; line-height: 20px; }
.sectioned-entry .entry-grid > .field > :is(input, select, textarea) { box-sizing: border-box; width: 100%; min-width: 0; }
.sectioned-entry .entry-grid > .field > :is(input, select) { height: 44px; min-height: 44px; }
.sectioned-entry .entry-grid > .field > :is(input, select, textarea):focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.sectioned-entry .purchase-form .entry-total-bar {
  flex: none;
  align-items: center;
  padding: 8px var(--entry-inset);
  background: var(--surface-subtle);
}
.sectioned-entry .purchase-form .entry-total-bar strong { color: var(--ink); }
.sectioned-entry form > .modal-footer {
  position: static;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 10px var(--entry-inset) max(10px, env(safe-area-inset-bottom));
}
.sectioned-entry form > .modal-footer > div {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: auto;
  margin-left: auto;
  gap: 8px;
}
.sectioned-entry form > .modal-footer .btn {
  width: auto;
  min-height: 44px;
  white-space: nowrap;
}
/* Keep dismissible notifications away from the editor's title and close control. */
body:has(.modal.sectioned-entry) .toasts {
  top: auto;
  bottom: max(92px, calc(env(safe-area-inset-bottom) + 82px));
  right: var(--entry-toast-inset, 24px);
  max-height: min(38dvh, 18rem);
  overflow: auto;
}
.sectioned-entry .purchase-form > .form-error {
  flex: 0 0 auto;
  max-height: 20dvh;
  overflow: auto;
  margin: 6px var(--entry-inset) 8px;
}
@media (width <= 767px) {
  .modal.sectioned-entry, .modal.sectioned-entry-wide {
    --entry-inset: 16px;
    --entry-gap: 14px;
    width: 100%;
    max-height: calc(100dvh - 24px);
  }
  .sectioned-entry .modal-head { padding-block: 12px; }
  .sectioned-entry .modal-body { padding-bottom: 16px; }
  .sectioned-entry .entry-grid-three, .sectioned-entry .entry-grid-delivery { grid-template-columns: minmax(0, 1fr); }
  .sectioned-entry .entry-grid-order { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .sectioned-entry .entry-grid-order .entry-leading { grid-column: 1 / -1; }
  .sectioned-entry .purchase-form > .modal-footer > div { flex: 1; }
  .sectioned-entry .purchase-form > .modal-footer > div > .btn { flex: 1 1 0; justify-content: center; }
  .sectioned-entry .purchase-form > .modal-footer > .btn { flex: 0 0 auto; }
}
@media (width <= 350px) {
  .modal.sectioned-entry, .modal.sectioned-entry-wide { --entry-inset: 12px; }
  .sectioned-entry .purchase-form > .modal-footer .btn { padding-inline: 8px; gap: 5px; }
  .sectioned-entry .purchase-form > .modal-footer .btn > svg { display: none; }
}
