/* FlexLast calendar-first date and time picker. */

body.home-page:not(.order-focus-page) #dateModal.modal-overlay {
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 0 0 var(--date-panel-left, max(18px, calc(50vw + 180px)));
}

#dateModal .date-modal-content--calendar {
  width: min(490px, calc(100vw - 32px));
  max-width: 490px;
  height: auto !important;
  max-height: calc(100dvh - 18px) !important;
  min-height: 0 !important;
  position: relative;
  inset: auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 26px;
  box-shadow: 0 22px 56px rgba(13, 18, 27, 0.18);
  transform-origin: center bottom;
  animation: paymentMethodSoftPopupIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#dateModal .date-schedule-shell {
  width: 100%;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: #121722;
}

#dateModal .date-schedule-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 0;
}

#dateModal .date-schedule-heading {
  min-width: 0;
}

#dateModal .date-schedule-heading h2 {
  margin: 0;
  color: #111827;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

#dateModal .date-schedule-close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f2f4f6;
  color: #1f2937;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

#dateModal .date-schedule-close:hover {
  background: #e8ebef;
}

#dateModal .date-schedule-close:active {
  transform: scale(0.96);
}

#dateModal .date-schedule-close .material-icons-round {
  font-size: 22px;
}

#dateModal .date-schedule-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 26px 0;
  scrollbar-width: thin;
}

#dateModal .date-schedule-price-carousel {
  position: relative;
  display: block;
  margin-bottom: 16px;
}

#dateModal .date-schedule-price-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e2e5e8;
  border-radius: 50%;
  background: #fff;
  color: #27303d;
  cursor: pointer;
  transform: translateY(-50%);
  transition: border-color 150ms ease, background-color 150ms ease, opacity 150ms ease;
}

#dateModal .date-schedule-price-nav:first-child {
  left: 0;
}

#dateModal .date-schedule-price-nav:last-child {
  right: 0;
}

#dateModal .date-schedule-price-nav:hover:not(:disabled) {
  border-color: #c9ced4;
  background: #f5f6f7;
}

#dateModal .date-schedule-price-nav:disabled {
  opacity: 0;
  pointer-events: none;
  cursor: default;
}

#dateModal .date-schedule-price-nav .material-icons-round {
  font-size: 18px;
}

#dateModal .date-schedule-price-hints {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 44px;
  padding-inline: 44px;
  scrollbar-width: none;
}

#dateModal .date-schedule-price-hints::-webkit-scrollbar {
  display: none;
}

#dateModal .date-schedule-price-hint {
  position: relative;
  flex: 0 0 154px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid #e7eaed;
  border-radius: 13px;
  background: #f7f8f9;
  scroll-snap-align: start;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

#dateModal .date-schedule-price-hint span {
  overflow: hidden;
  color: #747b86;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dateModal .date-schedule-price-hint strong {
  display: block;
  margin-top: 4px;
  color: #242b36;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

#dateModal .date-schedule-price-hint.is-active::after {
  content: '✓';
  position: absolute;
  top: 7px;
  right: 7px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

#dateModal .date-schedule-price-hint--discount.is-active {
  border-color: #acdcb6;
  background: #eff9f1;
  box-shadow: 0 4px 12px rgba(38, 123, 59, 0.08);
}

#dateModal .date-schedule-price-hint--discount.is-active span,
#dateModal .date-schedule-price-hint--discount.is-active strong {
  color: #267b3b;
}

#dateModal .date-schedule-price-hint--discount.is-active::after {
  background: #2b8a43;
}

#dateModal .date-schedule-price-hint--sunday.is-active,
#dateModal .date-schedule-price-hint--night.is-active {
  border-color: #efb6ad;
  background: #fff3f1;
  box-shadow: 0 4px 12px rgba(190, 58, 47, 0.08);
}

#dateModal .date-schedule-price-hint--sunday.is-active span,
#dateModal .date-schedule-price-hint--sunday.is-active strong,
#dateModal .date-schedule-price-hint--night.is-active span,
#dateModal .date-schedule-price-hint--night.is-active strong {
  color: #bd4438;
}

#dateModal .date-schedule-price-hint--sunday.is-active::after,
#dateModal .date-schedule-price-hint--night.is-active::after {
  background: #d24c40;
}

#dateModal .date-schedule-monthbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}

#dateModal .date-schedule-monthbar h3 {
  margin: 0;
  color: #151b26;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

#dateModal .date-schedule-month-actions {
  display: flex;
  gap: 7px;
}

#dateModal .date-schedule-month-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e1e4e8;
  border-radius: 12px;
  background: #fff;
  color: #202938;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

#dateModal .date-schedule-month-btn:hover:not(:disabled) {
  border-color: #c8cdd4;
  background: #f7f8f9;
}

#dateModal .date-schedule-month-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

#dateModal .date-schedule-month-btn .material-icons-round {
  font-size: 21px;
}

#dateModal .date-schedule-weekdays,
#dateModal .date-schedule-calendar-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}

#dateModal .date-schedule-weekdays {
  margin-bottom: 4px;
  color: #9298a2;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

#dateModal .date-schedule-calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#dateModal .date-schedule-calendar-grid .calendar-day-cell {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  justify-self: center;
  margin: 0;
}

#dateModal .date-schedule-calendar-grid .calendar-day-empty,
#dateModal .date-schedule-calendar-grid .calendar-day-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
}

#dateModal .date-schedule-calendar-grid .calendar-day-btn {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #151b26;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

#dateModal .date-schedule-calendar-grid .calendar-day-btn:hover:not(:disabled):not(.active) {
  background: #f0f2f4;
}

#dateModal .date-schedule-calendar-grid .calendar-day-btn:active:not(:disabled) {
  transform: scale(0.94);
}

#dateModal .date-schedule-calendar-grid .calendar-day-btn.active {
  background: #161b25;
  color: #fff;
  box-shadow: 0 5px 12px rgba(17, 24, 39, 0.19);
}

#dateModal .date-schedule-weekdays span:last-child,
#dateModal .date-schedule-calendar-grid .calendar-day-btn.is-sunday:not(.active):not(:disabled) {
  color: #d64545;
}

#dateModal .date-schedule-calendar-grid .calendar-day-btn.is-sunday:disabled,
#dateModal .date-schedule-calendar-grid .calendar-day-btn.is-sunday.disabled {
  color: #e5a4a4;
}

#dateModal .date-schedule-calendar-grid .calendar-day-btn:disabled,
#dateModal .date-schedule-calendar-grid .calendar-day-btn.disabled {
  background: transparent;
  color: #c4c8ce;
  box-shadow: none;
  cursor: default;
}

#dateModal .date-schedule-divider {
  height: 1px;
  margin: 15px 0 14px;
  background: #e8eaed;
}

#dateModal .date-schedule-time {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
}

#dateModal .date-schedule-time-copy {
  min-width: 0;
}

#dateModal .date-schedule-time-copy h3 {
  margin: 0;
  color: #151b26;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

#dateModal .date-schedule-selected-date {
  display: block;
  margin-top: 4px;
  color: #747b86;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

#dateModal .date-schedule-time-control {
  width: 132px;
  min-width: 132px;
  height: 52px;
  display: block;
  align-items: center;
  padding: 5px;
  border: 1px solid #dfe2e6;
  border-radius: 16px;
  background: #f7f8f9;
}

#dateModal .date-schedule-time-value {
  width: 100%;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #111827;
  cursor: pointer;
}

#dateModal .date-schedule-time-value:hover {
  background: #eef0f2;
}

#dateModal .date-schedule-time-value[aria-expanded='true'] {
  background: #e9ecef;
}

#dateModal .date-schedule-time-value .material-icons-round {
  color: #727986;
  font-size: 17px;
  transition: transform 160ms ease;
}

#dateModal .date-schedule-time-value[aria-expanded='true'] .material-icons-round {
  transform: rotate(180deg);
}

#dateModal .date-schedule-time-value output {
  color: #111827;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.015em;
  font-variant-numeric: tabular-nums;
}

#dateModal .date-schedule-time-picker {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 8;
  width: 264px;
  padding: 14px;
  border: 1px solid #dfe3e7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
}

#dateModal .date-schedule-time-picker[hidden] {
  display: none;
}

#dateModal .date-schedule-time-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#dateModal .date-schedule-time-picker-header strong {
  color: #1a2130;
  font-size: 14px;
  font-weight: 800;
}

#dateModal .date-schedule-time-picker-header button {
  min-width: 52px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: #eef7f0;
  color: #23833c;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

#dateModal .date-schedule-time-wheels {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: end;
  gap: 4px;
}

#dateModal .date-schedule-time-wheels::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 44px;
  left: 0;
  height: 40px;
  border: 1px solid #e2e5e8;
  border-radius: 11px;
  background: #f4f6f7;
  pointer-events: none;
}

#dateModal .date-schedule-time-wheel-group {
  min-width: 0;
}

#dateModal .date-schedule-time-wheel-group > span {
  display: block;
  margin-bottom: 5px;
  color: #838a95;
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

#dateModal .date-schedule-time-wheel {
  position: relative;
  z-index: 1;
  height: 128px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

#dateModal .date-schedule-time-wheel::-webkit-scrollbar {
  display: none;
}

#dateModal .date-schedule-time-wheel::before,
#dateModal .date-schedule-time-wheel::after {
  content: '';
  display: block;
  height: 44px;
}

#dateModal .date-schedule-time-option {
  width: 100%;
  height: 40px;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8a919c;
  font-size: 15px;
  font-weight: 700;
  line-height: 40px;
  text-align: center;
  scroll-snap-align: center;
  cursor: pointer;
}

#dateModal .date-schedule-time-option.is-selected {
  color: #111827;
  font-size: 18px;
  font-weight: 850;
}

#dateModal .date-schedule-time-option:disabled {
  opacity: 0.25;
  cursor: default;
}

#dateModal .date-schedule-time-colon {
  position: relative;
  z-index: 2;
  height: 84px;
  color: #111827;
  font-size: 19px;
  font-weight: 850;
  line-height: 40px;
  text-align: center;
}

#dateModal .date-schedule-time-picker-hint {
  display: block;
  margin-top: 8px;
  color: #7b828d;
  font-size: 10px;
  font-weight: 650;
  text-align: center;
}

#dateModal button {
  touch-action: manipulation;
}

#dateModal .date-schedule-footer {
  flex: 0 0 auto;
  padding: 10px 26px 22px;
  border-top: 0;
  background: rgba(255, 255, 255, 0.97);
}

#dateModal .date-schedule-context {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  color: #b25c18;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

#dateModal .date-schedule-context[hidden] {
  display: none;
}

#dateModal .date-schedule-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#dateModal .date-schedule-context.is-discount {
  color: #25873c;
}

#dateModal .date-schedule-context.is-error {
  color: #b42318;
}

#dateModal .date-schedule-confirm.date-confirm-btn {
  width: 100%;
  height: 54px;
  display: block;
  padding: 0 22px;
  border: 0;
  border-radius: 15px;
  background: #2aaa4b;
  color: #fff;
  box-shadow: 0 7px 17px rgba(42, 170, 75, 0.17);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

#dateModal .date-schedule-confirm.date-confirm-btn:hover:not(:disabled) {
  background: #249b43;
  box-shadow: 0 12px 25px rgba(42, 170, 75, 0.25);
}

#dateModal .date-schedule-confirm.date-confirm-btn:active:not(:disabled) {
  transform: translateY(1px);
}

#dateModal .date-schedule-confirm.date-confirm-btn:disabled {
  background: #cbd1d7;
  box-shadow: none;
  cursor: not-allowed;
}

#dateModal .date-schedule-close:focus-visible,
#dateModal .date-schedule-price-nav:focus-visible,
#dateModal .date-schedule-price-hints:focus-visible,
#dateModal .date-schedule-month-btn:focus-visible,
#dateModal .date-schedule-calendar-grid .calendar-day-btn:focus-visible,
#dateModal .date-schedule-time-value:focus-visible,
#dateModal .date-schedule-time-picker-header button:focus-visible,
#dateModal .date-schedule-time-wheel:focus-visible,
#dateModal .date-schedule-time-option:focus-visible,
#dateModal .date-schedule-confirm:focus-visible {
  outline: 3px solid rgba(42, 170, 75, 0.34);
  outline-offset: 2px;
}

@media (min-width: 561px) {
  #dateModal .date-schedule-price-nav {
    display: none;
  }

  #dateModal .date-schedule-price-hints {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding-inline: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  #dateModal .date-schedule-price-hint {
    min-width: 0;
    min-height: 54px;
    padding-right: 25px;
  }
}

@media (max-width: 560px) {
  #dateModal.modal-overlay,
  body.home-page:not(.order-focus-page) #dateModal.modal-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 8px 8px 0 !important;
    background: rgba(15, 23, 42, 0.46) !important;
  }

  #dateModal .date-modal-content--calendar {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    height: auto !important;
    max-height: calc(100dvh - 12px) !important;
    min-height: 0;
    margin: 0;
    border-radius: 28px 28px 0 0 !important;
  }

  #dateModal .date-schedule-header {
    padding: 22px 20px 0;
  }

  #dateModal .date-schedule-heading h2 {
    font-size: 26px;
  }

  #dateModal .date-schedule-main {
    padding: 17px 20px 0;
  }

  #dateModal .date-schedule-price-carousel {
    margin-bottom: 14px;
  }

  #dateModal .date-schedule-price-nav {
    width: 40px;
    height: 40px;
  }

  #dateModal .date-schedule-price-hints {
    gap: 7px;
    padding-left: 0;
    padding-right: 42px;
    scroll-padding-left: 0;
    scroll-padding-right: 42px;
  }

  #dateModal .date-schedule-price-hint {
    flex-basis: 142px;
    min-height: 50px;
    padding: 7px 9px;
  }

  #dateModal .date-schedule-price-hint strong {
    font-size: 10.5px;
  }

  #dateModal .date-schedule-month-btn,
  #dateModal .date-schedule-calendar-grid .calendar-day-cell,
  #dateModal .date-schedule-calendar-grid .calendar-day-btn,
  #dateModal .date-schedule-calendar-grid .calendar-day-empty {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  #dateModal .date-schedule-divider {
    margin: 14px 0 13px;
  }

  #dateModal .date-schedule-time {
    align-items: center;
    flex-direction: row;
    gap: 12px;
    padding-bottom: 15px;
  }

  #dateModal .date-schedule-time-control {
    width: 140px;
    min-width: 140px;
  }

  #dateModal .date-schedule-footer {
    padding: 9px 20px 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #dateModal .date-modal-content--calendar,
  #dateModal .date-modal-content--calendar * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 561px) and (max-width: 979px) {
  #dateModal.modal-overlay,
  body.home-page:not(.order-focus-page) #dateModal.modal-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  #dateModal .date-modal-content--calendar {
    width: min(490px, calc(100vw - 24px));
    max-width: min(490px, calc(100vw - 24px));
    border-radius: 28px 28px 0 0;
  }
}

@media (min-width: 980px) {
  body.home-page:not(.order-focus-page) #dateModal.modal-overlay.is-widget-popover {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  body.home-page:not(.order-focus-page) #dateModal.is-widget-popover .date-modal-content--calendar {
    position: fixed;
    top: var(--widget-dropdown-top, 16px);
    left: var(--widget-dropdown-left, 16px);
    right: auto;
    bottom: auto;
    width: min(var(--widget-dropdown-panel-width, 490px), calc(100vw - 32px));
    max-width: min(var(--widget-dropdown-panel-width, 490px), calc(100vw - 32px));
    height: auto !important;
    max-height: calc(100dvh - 32px) !important;
    min-height: 0 !important;
    margin: 0;
    z-index: 1002;
    animation: widgetPopoverRevealFromPanel 190ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  body.home-page:not(.order-focus-page) #dateModal.is-widget-popover.is-widget-popover-closing .date-modal-content--calendar {
    pointer-events: none;
    animation: widgetPopoverConcealToPanel 150ms cubic-bezier(0.4, 0, 0.2, 1) both;
  }
}

@media (max-height: 700px) {
  #dateModal .date-schedule-header {
    padding-top: 22px;
  }

  #dateModal .date-schedule-main {
    padding-top: 20px;
  }

  #dateModal .date-schedule-calendar-grid .calendar-day-cell,
  #dateModal .date-schedule-calendar-grid .calendar-day-btn,
  #dateModal .date-schedule-calendar-grid .calendar-day-empty {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
}
