dialog {
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  flex-direction: column;
  width: min(480px, 100%);
  max-width: none;
  height: calc(100dvh - 64px);
  max-height: none;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: #fff;
  color: #1B1F1D;
  box-shadow: 0 -10px 40px #0002;
}
dialog[open] {
  display: flex;
}
dialog::backdrop {
  background: #1018157A;
}
.sheet-handle {
  display: flex;
  flex: none;
  justify-content: center;
  padding-top: 8px;
}
.sheet-handle span {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #D1D5D1;
}
.sheet-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 4px 16px;
}
.sheet-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 26px;
}
.sheet-head .button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--muted);
  font-size: 22px;
}
.sheet-content {
  flex: 1;
  min-height: 0;
  padding: 0 16px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #EFEBE4;
}
.line-thumb {
  display: grid;
  flex: none;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #E9EEE7;
  object-fit: cover;
}
.line-thumb.fallback {
  font-size: 22px;
}
.line-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.line-info b {
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.line-price {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
}
.total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 0;
  padding: 12px 0;
  border-top: 1px solid #EFEBE4;
}
.total > span {
  color: var(--muted);
  font-size: 15px;
  line-height: 20px;
}
.total strong {
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  white-space: nowrap;
}
.delivery-heading {
  margin: 16px 0 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
}
#order {
  display: grid;
  gap: 12px;
  margin: 0;
}
form label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}
form input,
form select,
form textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: #1B1F1D;
  font: inherit;
  font-size: 15px;
}
form textarea {
  min-height: 64px;
}
.sheet-footer {
  flex: none;
  padding: 12px 16px calc(16px + max(18px, env(safe-area-inset-bottom, 18px)));
  border-top: 1px solid #EFEBE4;
  background: #fff;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 600 15px/20px system-ui, sans-serif;
}
.button-primary {
  background: var(--teal);
  color: #fff;
}
.button-secondary {
  border-color: var(--border);
  background: #F6F4EF;
  color: #343A37;
}
@media (min-width: 700px) {
  body {
    padding-bottom: 24px;
  }
  main {
    max-width: 900px;
  }
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  dialog {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(480px, calc(100vw - 32px));
    max-height: 90vh;
    height: auto;
    margin: 0;
    border-radius: 20px;
    box-shadow: 0 20px 44px #0002;
    transform: translate(-50%, -50%);
  }
  .sheet-footer {
    padding-bottom: 16px;
  }
}
@media (min-width: 900px) {
  main {
    max-width: 1120px;
  }
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
