#dwWebsiteCartTable .dw-cart-website-image {
  display: block;
  width: 150px;
  max-width: none;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center top;
}

#dwWebsiteCartTable .product-name > a {
  color: var(--theme-color-dark);
  font-weight: 800;
}

#dwWebsiteCartTable .variation {
  margin-top: 6px;
}

#dwWebsiteCartTable .dw-cart-quantity {
  color: var(--theme-color-dark);
  font-weight: 800;
}

#dwWebsiteCartTable .dw-cart-empty {
  padding: 45px 20px;
  text-align: center;
}

#dwWebsiteCartTable .dw-cart-empty p {
  margin-bottom: 18px;
}

/* ===========================================================
   Mobile / tablet cart — stacked "card" layout (no x-scroll)
   At <=768px the table stops being a wide table and each item
   becomes a clean card, so there's no horizontal scrolling.
   =========================================================== */
@media (max-width: 768px) {

  /* Stop the Bootstrap .table-responsive wrapper from scrolling */
  .section-content .table-responsive {
    overflow-x: visible;
  }

  /* Turn table parts into block elements */
  #dwWebsiteCartTable,
  #dwWebsiteCartTable tbody,
  #dwWebsiteCartTable tr,
  #dwWebsiteCartTable td {
    display: block;
    width: 100%;
  }

  /* Hide the column header row (labels move into each cell) */
  #dwWebsiteCartTable thead {
    display: none;
  }

  /* Each item = a card */
  #dwWebsiteCartTable tr.cart_item {
    position: relative;
    background: var(--theme-color-white);
    border: 1px solid #e6e9f2;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(var(--theme-color-dark-rgb), 0.07);
    padding: 16px 16px 10px;
    margin-bottom: 18px;
  }

  /* Default cell: label on the left, value on the right */
  #dwWebsiteCartTable tr.cart_item td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border: none;
    border-top: 1px solid #eef1f7;
    text-align: right;
  }

  /* Labels for the value rows */
  #dwWebsiteCartTable tr.cart_item td.product-price::before { content: "Price"; }
  #dwWebsiteCartTable tr.cart_item td.product-quantity::before { content: "Quantity"; }
  #dwWebsiteCartTable tr.cart_item td.product-subtotal::before { content: "Total"; }
  #dwWebsiteCartTable tr.cart_item td.product-price::before,
  #dwWebsiteCartTable tr.cart_item td.product-quantity::before,
  #dwWebsiteCartTable tr.cart_item td.product-subtotal::before {
    font-weight: 700;
    color: var(--theme-color-dark);
    text-align: left;
  }

  /* Website preview on top, full width, no border line above it */
  #dwWebsiteCartTable tr.cart_item td.product-thumbnail {
    justify-content: center;
    border-top: none;
    padding: 4px 0 12px;
  }
  #dwWebsiteCartTable tr.cart_item td.product-thumbnail .dw-cart-website-image,
  #dwWebsiteCartTable tr.cart_item td.product-thumbnail img {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
  }

  /* Product name as a left-aligned block heading */
  #dwWebsiteCartTable tr.cart_item td.product-name {
    display: block;
    text-align: left;
    border-top: none;
    padding: 0 40px 10px 0;
  }

  /* Remove (×) pinned to the top-right corner of the card */
  #dwWebsiteCartTable tr.cart_item td.product-remove {
    position: absolute;
    top: 12px;
    right: 14px;
    width: auto;
    padding: 0;
    border: none;
  }
  #dwWebsiteCartTable tr.cart_item td.product-remove .remove {
    font-size: 22px;
    line-height: 1;
  }

  /* Empty-cart message stays centered */
  #dwWebsiteCartTable .dw-cart-empty {
    display: block;
    text-align: center;
  }
}
