/* First cart step only. Keep native Shoptet item-removal behavior. */
html body.id--9 .cart-table tr.removeable .remove-item {
  opacity: 1 !important;
  visibility: visible !important;
}

html body.id--9 .cart-table .remove-item:focus-visible {
  outline: 2px solid #8c4f1f;
  outline-offset: 3px;
}

/* The checkout stylesheet otherwise overrides the cart's narrower sidebar.
   Stack before the table's intrinsic width can extend behind the sidebar. */
@media (max-width: 1279px) {
  html body.id--9.ordering-process .cart-row {
    display: block !important;
  }

  html body.id--9.ordering-process .cart-row > .col-md-8,
  html body.id--9.ordering-process .cart-row > .sidebar-in-cart {
    width: 100% !important;
    min-width: 0;
    float: none !important;
    grid-column: auto;
    grid-row: auto;
  }

  html body.id--9.ordering-process .sidebar-in-cart {
    position: static !important;
    margin-top: 18px;
  }
}

@media (max-width: 767px) {
  html body.id--9 .cart-table tr.removeable .remove-item {
    width: 44px;
    height: 44px;
    top: 8px;
    right: 8px;
  }

  html body.id--9 .cart-table tr.removeable .p-name {
    padding-right: 46px !important;
  }
}

/* Keep the added-to-cart dialog inside the current viewport, even after resize. */
@media (max-width: 1279px) {
  html body #colorbox.shoptet-modal-lg:has(.advanced-order) {
    position: fixed !important;
    top: 12px !important;
    left: 50% !important;
    transform: translateX(-50%);
    width: calc(100vw - 24px) !important;
    max-width: 760px !important;
    height: auto !important;
    max-height: calc(100dvh - 24px) !important;
    overflow: hidden !important;
  }
  html body #colorbox.shoptet-modal-lg:has(.advanced-order) #cboxWrapper {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
  }
  html body #colorbox.shoptet-modal-lg:has(.advanced-order) #cboxContent {
    float: none !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
  }
  html body #colorbox.shoptet-modal-lg:has(.advanced-order) #cboxLoadedContent {
    width: 100% !important;
    height: auto !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 0 !important;
    overflow: auto !important;
    overscroll-behavior: contain;
  }
  html body #colorbox.shoptet-modal-lg:has(.advanced-order) .colorbox-html-content {
    max-height: none !important;
  }
  html body #colorbox.shoptet-modal-lg:has(.advanced-order) [id^="cboxTop"],
  html body #colorbox.shoptet-modal-lg:has(.advanced-order) [id^="cboxBottom"],
  html body #colorbox.shoptet-modal-lg:has(.advanced-order) #cboxMiddleLeft,
  html body #colorbox.shoptet-modal-lg:has(.advanced-order) #cboxMiddleRight {
    display: none !important;
  }
  html body #colorbox.shoptet-modal-lg:has(.advanced-order) #cboxClose {
    top: 8px !important;
    right: 8px !important;
    width: 44px !important;
    height: 44px !important;
    z-index: 5;
  }
  html body #colorbox .advanced-order > .h1:first-child {
    padding-right: 32px;
  }
  html body.id--9 .cart-content > .summary-wrapper.ch-cart-summary-inline {
    padding: 0 !important;
    margin: 20px 0 24px !important;
    width: 100% !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  html body.id--9 .ch-cart-summary-inline .box {
    padding: 22px !important;
  }
}
