body.cartPopupOpen {
  overflow: hidden;
}

#cartPopup {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#cartPopup.isOpen {
  display: flex;
}

.cartPopupBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 15, 17, 0.72);
  backdrop-filter: blur(2px);
}

.cartPopupDialog {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  max-height: min(88vh, 820px);
  overflow: hidden;
  border-top: 4px solid #ff9601;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.cartPopupContent {
  max-height: calc(88vh - 4px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cartPopupClose {
  position: absolute;
  z-index: 3;
  top: 15px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #f4f4f4;
  color: #252525;
  font: 30px/38px Arial, sans-serif;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.cartPopupClose:hover {
  color: #fff;
  background: #ff9601;
  transform: rotate(90deg);
}

.cartPopupHeader {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 72px 18px 26px;
  border-bottom: 1px solid #ececec;
}

.cartPopupHeader h2 {
  margin: 0 0 4px;
  color: #171717;
  font-family: 'robotobold', Arial, sans-serif;
  font-size: 25px;
  line-height: 1.2;
}

.cartPopupHeader p {
  margin: 0;
  color: #777;
  font-size: 14px;
}

.cartPopupCheck {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #ff9601;
  color: #fff;
  font: bold 23px/1 Arial, sans-serif;
}

.cartPopupItems {
  padding: 0 26px;
}

.cartPopupItem {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 165px;
  gap: 18px;
  align-items: center;
  min-height: 138px;
  padding: 18px 0;
  border-bottom: 1px solid #ececec;
}

.cartPopupPicture {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #fafafa;
}

.cartPopupPicture img {
  max-width: 94%;
  max-height: 94%;
}

.cartPopupName {
  display: block;
  margin-bottom: 7px;
  color: #181818;
  font-family: 'robotobold', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  text-decoration: none;
}

.cartPopupName:hover {
  color: #ff9601;
}

.cartPopupSku {
  display: block;
  margin-bottom: 14px;
  color: #929292;
  font-size: 13px;
}

.cartPopupQuantity {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #dedede;
  border-radius: 6px;
}

.cartPopupQuantity button,
.cartPopupQty {
  width: 38px;
  height: 36px;
  box-sizing: border-box;
  border: 0;
  background: #fff;
  color: #222;
  text-align: center;
  font-size: 17px;
}

.cartPopupQuantity button {
  background: #f4f4f4;
  cursor: pointer;
}

.cartPopupQuantity button:hover {
  color: #fff;
  background: #ff9601;
}

.cartPopupQty {
  border-right: 1px solid #dedede;
  border-left: 1px solid #dedede;
  outline: none;
}

.cartPopupPriceBlock {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding-top: 22px;
  text-align: right;
}

.cartPopupLinePrice {
  margin-bottom: 5px;
  color: #171717;
  font-family: 'robotobold', Arial, sans-serif;
  font-size: 19px;
}

.cartPopupPriceBlock > span {
  color: #8a8a8a;
  font-size: 12px;
}

.cartPopupRemove {
  position: absolute;
  top: 0;
  right: 0;
  border: 0;
  background: transparent;
  color: #b3b3b3;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.cartPopupRemove:hover {
  color: #e04747;
}

.cartPopupSummary {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 14px;
  padding: 20px 26px 10px;
  color: #555;
  font-size: 17px;
}

.cartPopupSummary strong {
  color: #171717;
  font-family: 'robotobold', Arial, sans-serif;
  font-size: 28px;
}

.cartPopupActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px 26px 26px;
}

.cartPopupContinue,
.cartPopupCheckout {
  box-sizing: border-box;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 5px;
  font-family: 'robotobold', Arial, sans-serif;
  font-size: 15px;
  line-height: 52px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.cartPopupContinue {
  border: 1px solid #d5d5d5;
  background: #fff;
  color: #333;
}

.cartPopupContinue:hover {
  border-color: #999;
  background: #f5f5f5;
}

.cartPopupCheckout {
  border: 1px solid #ff9601;
  background: #ff9601;
  color: #fff;
}

.cartPopupCheckout:hover {
  border-color: #ffa800;
  background: #ffa800;
}

.cartPopupEmpty {
  padding: 38px 26px 28px;
  text-align: center;
}

.cartPopupEmpty p {
  margin: 0 0 22px;
  font-size: 18px;
}

#cartPopup.isLoading .cartPopupDialog::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(255, 255, 255, .62);
  cursor: wait;
}

@media (max-width: 700px) {
  #cartPopup {
    align-items: flex-end;
    padding: 0;
  }

  .cartPopupDialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 10px 10px 0 0;
  }

  .cartPopupContent {
    max-height: calc(92vh - 4px);
  }

  .cartPopupHeader {
    padding: 18px 62px 15px 16px;
  }

  .cartPopupHeader h2 {
    font-size: 21px;
  }

  .cartPopupCheck {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .cartPopupItems {
    padding: 0 16px;
  }

  .cartPopupItem {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
  }

  .cartPopupPicture {
    width: 82px;
    height: 82px;
  }

  .cartPopupPriceBlock {
    grid-column: 2;
    align-items: flex-start;
    padding-top: 0;
    text-align: left;
  }

  .cartPopupRemove {
    top: auto;
    right: 0;
    bottom: 2px;
  }

  .cartPopupSummary {
    justify-content: space-between;
    padding: 18px 16px 6px;
  }

  .cartPopupSummary strong {
    font-size: 23px;
  }

  .cartPopupActions {
    grid-template-columns: 1fr;
    padding: 14px 16px 20px;
  }
}
