.shop_table.woocommerce-cart-form__contents {
  border: none !important;

  thead tr {
    background-color: var(--color-brand-black);
    color: var(--color-brand-white);

    th {
      &:first-child {
        border-left: 1px solid var(--color-brand-black);
      }
      &:last-child {
        border-right: 1px solid var(--color-brand-black);
      }
    }
  }

  tbody tr {
    &:not(:last-child) {
      border-inline: 1px solid var(--color-ui-02);
    }

    &:nth-child(2n):not(:last-child) {
      background-color: var(--color-ui-01);
    }

    &:last-child {
      td {
        &,
        &:first-child,
        &:last-child {
          border: none;
          padding-inline: 0;
          padding-block: var(--space-md) 0;
        }
      }
    }

    .product-thumbnail img {
      border: 1px solid var(--color-ui-02);
    }
  }

  #coupon_code,
  button[name="apply_coupon"],
  button[name="update_cart"] {
    margin: 0 !important;
    height: 48px;
  }
}

.woocommerce-cart .cart-collaterals .cart_totals {
  border: none;
  padding: 0;

  h2 {
    margin: 0;
    background-color: transparent;
    padding: 0;
    padding-bottom: var(--space-md);
    border: none;
  }

  table.shop_table {
    border: 1px solid var(--color-ui-02);

    th,
    td {
      border-bottom: 1px solid var(--color-ui-02);
    }

    th {
      font-weight: var(--font-weight-bold);
    }

    tr:last-child {
      th,
      td {
        border-bottom: none;
      }
    }
  }
}

@media (width < 768px) {
  .woocommerce .shop_table.woocommerce-cart-form__contents,
  .woocommerce-page .shop_table.woocommerce-cart-form__contents {
    tbody tr {
      .coupon {
        padding-bottom: var(--space-xl) !important;
        flex-direction: column;
        gap: var(--space-base);

        &::before,
        &::after {
          display: none;
        }

        > * {
          width: 100% !important;
        }
      }
    }
  }
}

@media (width < 1024px) {
  .woocommerce .shop_table.woocommerce-cart-form__contents,
  .woocommerce-page .shop_table.woocommerce-cart-form__contents {
    thead {
      display: block;

      tr > th {
        display: none !important;

        &.product-name {
          display: block !important;

          &::after {
            content: ' Details';
          }
        }
      }
    }

    tbody tr {
      display: grid;
      grid-template-columns: max-content 1fr;

      &:not(:last-child) {
        border-bottom: 1px solid var(--color-ui-02);
      }
  
      > td {
        grid-column: 2;
        border: none;
  
        &.product-remove {
          grid-column: 1 / -1;
        }
  
        &.product-thumbnail {
          grid-column: 1;
          grid-row: 2 / 6;
        }
      }
    }

    .quantity {
      justify-self: flex-end;
    }
  }
}

@media (min-width: 1024px) {
  .shop_table.woocommerce-cart-form__contents {
    tbody tr {
      td {
        border-top: 1px solid var(--color-ui-02) !important;

        &:first-child {
          border-left: 1px solid var(--color-ui-02);
        }
        &:last-child {
          border-right: 1px solid var(--color-ui-02);
        }
      }
    }
  }

  /* Cart Collaterals Two-Column Layout */
  .woocommerce .cart-collaterals-wrapper {
    display: flex;
    gap: var(--space-lg, 2rem);
    align-items: flex-start;

    .cart-collaterals {
      flex: 1;
      min-width: 0;
    }

    .cart-sidebar {
      flex: 1;
      min-width: 0;
    }

    .cart-collaterals,
    .cart-collaterals .cart_totals,
    .cart-sidebar {
      width: 100%;
    }

    @media (max-width: 768px) {
      flex-direction: column;
    }
  }
}