/*
 * Little Italy mobile cart – the page's sticky header is z-index:25,
 * whereas the old modal was only z-index:10. Keep the overlay above it.
 * Fit the basket to iPhone dynamic viewport and scroll INSIDE the basket.
 * CSS only: never changes customer data, prices or order handling.
 */
#modal.modal {
  z-index: 10000 !important;
  box-sizing: border-box;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px
           calc(env(safe-area-inset-bottom, 0px) + 10px);
  overflow: hidden;
  overscroll-behavior: contain;
}
#modal.modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}
#modal > .sheet {
  box-sizing: border-box;
  position: relative;
  width: min(570px, 100%);
  min-width: 0;
  max-width: 100%;
  max-height: calc(100vh - 24px);
  max-height: calc(
    100dvh - env(safe-area-inset-top, 0px)
    - env(safe-area-inset-bottom, 0px) - 20px
  );
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 16px 20px;
  scroll-padding-top: 74px;
}
#modal .sheethead {
  position: sticky;
  top: 0;
  z-index: 3;
  box-sizing: border-box;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -16px 14px;
  padding: 12px 16px;
  background: #17272d;
  border-bottom: 1px solid #587072;
}
#modal .sheethead h2 {
  margin: 0;
  font-size: clamp(19px, 5vw, 25px);
  line-height: 1.2;
  min-width: 0;
}
#modal #liCloseCart {
  position: static !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: 2px solid #e5c7a0;
  border-radius: 50%;
  background: #2e1e18;
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  opacity: 1;
  visibility: visible;
  cursor: pointer;
  touch-action: manipulation;
}
#modal #liCloseCart:focus-visible {
  outline: 3px solid #ffb36a;
  outline-offset: 2px;
}
@media (max-width: 640px) {
  #modal.modal {
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px
             calc(env(safe-area-inset-bottom, 0px) + 8px);
  }
  #modal > .sheet {
    width: 100%;
    max-height: calc(
      100dvh - env(safe-area-inset-top, 0px)
      - env(safe-area-inset-bottom, 0px) - 16px
    );
    border-radius: 16px;
    padding: 0 14px 16px;
  }
  #modal .sheethead {
    min-height: 64px;
    margin: 0 -14px 12px;
    padding: 10px 14px;
  }
  #modal #liCloseCart {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-basis: 44px;
    font-size: 29px;
  }
}
