:root {
  --accent: #df1f5f;
  --accent-dark: #bd174d;
  --ink: #15151d;
  --muted: #69707f;
  --line: #d8dce5;
  --panel: #ffffff;
  --soft: #f4f5f7;
  --shadow: 0 18px 55px rgba(35, 35, 50, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: #eef1f5;
}

body.modal-open {
  overflow: hidden;
}

.shell {
  display: grid;
  grid-template-columns: minmax(760px, 820px) 1fr;
  min-height: 100vh;
}

.panel {
  z-index: 2;
  padding: 32px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel__head {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.field {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 16px;
  outline: none;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 86px;
  font-family: inherit;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(223, 31, 95, 0.14);
}

.form-section {
  margin-top: 24px;
}

.form-section h2,
.order-summary h2 {
  margin: 0 0 14px;
  font-size: 21px;
  line-height: 1.2;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
}

.check-row input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.recipient-fields input:disabled {
  color: #8c93a1;
  background: #f3f4f6;
}

button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  background: var(--accent);
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.secondary {
  width: 100%;
  margin-bottom: 18px;
  color: var(--ink);
  background: var(--soft);
}

.secondary:hover {
  background: #e9ebef;
}

.search-row {
  display: block;
}

body.clarify-address-mode #addressSearch {
  display: none !important;
}

body.same-recipient-mode .recipient-fields {
  display: none !important;
}

.recipient-fields[hidden] {
  display: none !important;
}

.delivery-address-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.delivery-address-head p {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.info-mark {
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.clarify-address {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  margin: 0 0 22px;
  padding: 0 28px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  background: var(--soft);
  cursor: pointer;
}

.clarify-address input {
  width: 22px;
  min-height: 22px;
  margin: 0;
  accent-color: var(--accent);
}

#orderSchedule[hidden] {
  display: none;
}

.address-box {
  position: relative;
}

.suggestions {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  z-index: 30;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 14px 24px rgba(20, 24, 35, 0.1);
}

.suggestion {
  width: 100%;
  min-height: 42px;
  padding: 7px 12px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.25;
  text-align: left;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion:hover,
.suggestion:focus {
  color: var(--ink);
  background: #ffeca2;
}

.suggestion strong {
  font-weight: 700;
}

.suggestion--message {
  color: var(--muted);
  cursor: default;
}

.suggestion--message:hover {
  background: #fff;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 6px;
  border-radius: 999px;
  background: var(--soft);
}

.mode-button {
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
}

.mode-button:hover {
  color: var(--ink);
  background: #e9ebef;
}

.mode-button.is-active {
  color: #fff;
  background: var(--accent);
}

.pickup-list {
  display: grid;
  gap: 10px;
}

.pickup-option {
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 400;
  text-align: left;
  background: #fff;
}

.pickup-option:hover {
  color: var(--ink);
  background: #f7f8fa;
}

.pickup-option.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(223, 31, 95, 0.08);
}

.date-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.date-tab,
.interval {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 500;
  background: var(--soft);
}

.date-tab:hover,
.interval:hover {
  color: var(--ink);
  background: #e9ebef;
}

.date-tab.is-active,
.interval.is-active {
  color: #fff;
  background: var(--accent);
}

.intervals {
  display: grid;
  gap: 14px;
  padding-bottom: 4px;
  border-bottom: 5px solid #817b9e;
}

.interval-row {
  display: grid;
  gap: 10px;
}

.interval-row--main {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.interval-row--extra {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.interval {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 62px;
  padding: 8px 10px;
  line-height: 1.05;
  text-align: center;
}

.interval b {
  display: block;
  font-size: 17px;
  font-weight: 500;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.interval span {
  display: block;
  color: inherit;
  font-size: 15px;
  opacity: 0.92;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.interval--main {
  width: auto;
}

.interval--extra {
  min-width: 0;
  min-height: 56px;
}

.interval--other {
  min-width: 0;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: #fff;
}

.interval[disabled] {
  color: #b6bbc5;
  background: #f1f2f4;
  cursor: not-allowed;
  opacity: 0.72;
}

.interval[disabled] b,
.interval[disabled] span {
  color: inherit;
}

.pickup-time-select {
  width: min(220px, 100%);
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font-size: 22px;
  background: #fff;
}

.result {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.result [hidden] {
  display: none !important;
}

.submit-order {
  width: 100%;
  min-height: 58px;
  margin-top: 6px;
  font-size: 18px;
}

.submit-status {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.35;
}

.submit-status--error {
  color: #9b123d;
  background: #fde8f0;
}

.submit-status--success {
  color: #166534;
  background: #e7f7ed;
}

.order-summary {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summary-grid {
  display: grid;
  gap: 10px;
}

.summary-row {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eceef3;
}

.summary-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.summary-row span {
  color: var(--muted);
  font-size: 13px;
}

.summary-row strong {
  font-size: 16px;
  line-height: 1.3;
}

.result div {
  display: grid;
  gap: 3px;
}

.result span {
  color: var(--muted);
  font-size: 13px;
}

.result strong {
  font-size: 17px;
  line-height: 1.25;
}

.clarify-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.map-wrap {
  position: relative;
  min-height: 100vh;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 100vh;
}

.map-status {
  position: absolute;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100% - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 35px rgba(15, 20, 30, 0.18);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 28, 0.68);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 28px 30px 30px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 48px;
  min-height: 48px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  font-size: 28px;
  font-weight: 400;
  background: var(--soft);
}

.modal__close:hover {
  color: var(--ink);
  background: #e9ebef;
}

.modal h2 {
  margin: 0 56px 10px 0;
  font-size: 28px;
  line-height: 1.15;
}

.modal__hint {
  margin: 0 0 22px;
  font-size: 20px;
  line-height: 1.35;
}

.other-time-groups {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.other-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.other-tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  background: var(--soft);
}

.other-tab.is-active {
  color: #fff;
  background: var(--accent);
}

.other-time-group {
  min-width: 0;
}

.other-time-group h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.other-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.other-time-option {
  display: grid;
  min-width: 0;
  min-height: 64px;
  align-content: center;
  padding: 8px 14px;
  color: var(--ink);
  line-height: 1.15;
  background: var(--soft);
  overflow: visible;
}

.other-time-option b,
.other-time-option span {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.other-time-option b {
  font-size: 18px;
  font-weight: 500;
}

.other-time-option span {
  color: inherit;
  font-size: 14px;
  opacity: 0.78;
}

.other-time-option.is-active {
  color: #fff;
  background: var(--accent);
}

.modal__choice {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: center;
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #f4f5f7;
}

.modal__choice span {
  color: var(--muted);
  font-size: 14px;
}

.modal__choice strong {
  font-size: 18px;
  font-weight: 600;
}

.modal__choice em {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--accent);
  font-size: 18px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.modal__submit {
  width: 100%;
  margin-top: 14px;
}

.modal__submit:disabled {
  color: #9ea4af;
  background: #eef0f3;
  cursor: not-allowed;
}

.modal__empty {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 20px 16px 18px;
    box-shadow: none;
  }

  .map-wrap,
  #map {
    min-height: 42vh;
  }

  .map-status {
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
  }

  .panel__head {
    margin-bottom: 22px;
  }

  .form-section {
    margin-top: 20px;
  }

  .grid {
    gap: 10px;
  }

  .date-tabs {
    gap: 6px;
  }

  .date-tab,
  .interval,
  .pickup-option,
  .clarify-address {
    min-height: 46px;
    font-size: 15px;
  }

  .interval {
    min-height: 58px;
    padding: 8px 8px;
  }

  .interval b {
    font-size: 15px;
  }

  .interval span {
    font-size: 13px;
  }

  .pickup-time-select {
    min-height: 50px;
    font-size: 18px;
  }

  .modal__panel {
    max-height: calc(100vh - 24px);
  }
}

@media (max-width: 520px) {
  body {
    overflow-x: hidden;
  }

  .shell {
    min-height: auto;
  }

  .panel {
    padding: 18px 14px 16px;
  }

  h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  .eyebrow {
    font-size: 12px;
  }

  label {
    font-size: 13px;
  }

  input,
  textarea {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 15px;
  }

  textarea {
    min-height: 104px;
  }

  button {
    min-height: 46px;
    padding: 0 14px;
    font-size: 15px;
  }

  .secondary {
    margin-bottom: 14px;
  }

  .delivery-address-head {
    margin-bottom: 12px;
  }

  .delivery-address-head p {
    font-size: 15px;
  }

  .search-row,
  .grid {
    grid-template-columns: 1fr;
  }

  .mode-switch,
  .date-tabs {
    gap: 6px;
  }

  .mode-button,
  .date-tab {
    min-height: 46px;
    font-size: 15px;
  }

  .interval-row--main,
  .interval-row--extra {
    position: relative;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 28px 6px 0;
    scroll-snap-type: x proximity;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .interval-row--main::-webkit-scrollbar,
  .interval-row--extra::-webkit-scrollbar {
    display: none;
  }

  .interval-row--main::after,
  .interval-row--extra::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 6px;
    width: 28px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96));
    pointer-events: none;
  }

  .interval-row--main .interval,
  .interval-row--extra .interval {
    flex: 0 0 30vw;
    min-width: 96px;
    min-height: 52px;
    padding: 6px 6px;
    scroll-snap-align: start;
  }

  .interval b {
    font-size: 14px;
  }

  .interval span {
    font-size: 12px;
  }

  .clarify-address {
    min-height: 50px;
    padding: 0 18px;
    font-size: 15px;
  }

  .result,
  .order-summary {
    padding: 14px;
  }

  .result strong,
  .summary-row strong {
    font-size: 15px;
  }

  .map-wrap,
  #map {
    min-height: 38vh;
  }

  .map-status {
    right: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    font-size: 13px;
    padding: 10px 12px;
  }

  .other-time-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }

  .other-time-grid .other-time-option {
    width: 100%;
    min-width: 0;
    min-height: 56px;
    padding: 8px 10px;
    text-align: center;
  }

  .other-time-option b,
  .other-time-option span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  .other-time-option b {
    font-size: 15px;
  }

  .other-time-option span {
    font-size: 12px;
  }

}

@media (max-width: 380px) {
  .interval-row--main .interval,
  .interval-row--extra .interval,
  .other-time-grid .other-time-option {
    min-height: 54px;
  }

  .other-time-grid {
    gap: 6px;
  }

  .date-tabs,
  .mode-switch {
    gap: 4px;
  }
}
