/* ToolsEngg Cart Polish 1.0.0 - presentation only. Loaded after the Modern Cart stylesheet. */

/* ---------- Desktop dropdown: a long cart scrolls smoothly inside the box ---------- */
.desktop-header-active #cart div.cart-content .cart-products {
  max-height: min(344px, calc(100vh - 340px));
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b7c2ce transparent;
  scrollbar-gutter: stable;
  /* soft shadows at the top / bottom edge that show there is more to scroll to */
  background:
    linear-gradient(#fff 30%, rgba(255, 255, 255, 0)) center top / 100% 34px no-repeat local,
    linear-gradient(rgba(255, 255, 255, 0), #fff 70%) center bottom / 100% 34px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(14, 30, 52, .16), rgba(14, 30, 52, 0)) center top / 100% 10px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(14, 30, 52, .16), rgba(14, 30, 52, 0)) center bottom / 100% 10px no-repeat scroll;
}
.desktop-header-active #cart div.cart-content .cart-products::-webkit-scrollbar { width: 8px; }
.desktop-header-active #cart div.cart-content .cart-products::-webkit-scrollbar-track { background: transparent; }
.desktop-header-active #cart div.cart-content .cart-products::-webkit-scrollbar-thumb { background: #c3ccd7; border-radius: 8px; border: 2px solid #fff; }
.desktop-header-active #cart div.cart-content .cart-products::-webkit-scrollbar-thumb:hover { background: #9aa8b8; }
/* the heading stays put while the products scroll under it */
.desktop-header-active #cart div.cart-content .cart-products::before {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid #edf0f4;
  padding-bottom: 10px;
}
.desktop-header-active #cart div.cart-content .cart-products tbody > tr:first-child { border-top: 0; }
/* the rows ease out when one is removed */
#cart .cart-products tr, .mobile-cart-content-wrapper .cart-products tr { transition: opacity .2s ease; }
.te-cart-removing { opacity: .35; pointer-events: none; }

/* ---------- Phone / tablet drawer: always slides in from the right, at a comfortable width ---------- */
.mobile-header-active .mobile-container.mobile-cart-content-container {
  left: auto !important;
  right: 0 !important;
  width: min(calc(100vw - 48px), 440px) !important;
  max-width: none;
  will-change: transform;
}
/* the empty dropdown box of the header cart must not open at the left edge of the screen on a phone / tablet (the list lives in the drawer) */
.mobile-header-active .mini-cart #cart > .cart-content { display: none !important; }
/* a finger-sized, instantly responding remove button */
.mobile-cart-content-wrapper .cart-products .td-remove button,
.mobile-cart-content-wrapper .cart-products .td-remove a,
.mobile-cart-content-wrapper .cart-products .td-remove .btn-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: -10px -10px -10px 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mobile-cart-content-wrapper .cart-products { scroll-behavior: smooth; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ---------- Desktop "Added to your cart" popup: many products scroll inside the popup instead of making it taller than the screen ---------- */
@media (min-width: 768px) {
  #advanced_popup_cart .te-cp-items {
    max-height: clamp(250px, calc(100vh - 500px), 560px);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #b9cfc3 transparent;
    padding-right: 6px;
    background:
      linear-gradient(#fff 30%, rgba(255, 255, 255, 0)) center top / 100% 30px no-repeat local,
      linear-gradient(rgba(255, 255, 255, 0), #fff 70%) center bottom / 100% 30px no-repeat local,
      radial-gradient(farthest-side at 50% 0, rgba(8, 30, 20, .16), rgba(8, 30, 20, 0)) center top / 100% 10px no-repeat scroll,
      radial-gradient(farthest-side at 50% 100%, rgba(8, 30, 20, .16), rgba(8, 30, 20, 0)) center bottom / 100% 10px no-repeat scroll;
  }
  #advanced_popup_cart .te-cp-items::-webkit-scrollbar { width: 8px; }
  #advanced_popup_cart .te-cp-items::-webkit-scrollbar-track { background: transparent; }
  #advanced_popup_cart .te-cp-items::-webkit-scrollbar-thumb { background: #c4d6cc; border-radius: 8px; border: 2px solid #fff; }
  #advanced_popup_cart .te-cp-items::-webkit-scrollbar-thumb:hover { background: #9fb9aa; }
}
