#MainContent:has(cart-items) {
  --cart-column-gap: calc(var(--gutter) * 2.5);
  --cart-image-width: 6.5rem;
  --cart-control-radius: 3em;
  --cart-surface: rgba(var(--color-button), .08);
  --cart-rule: rgba(var(--color-foreground), .15);

  &:has(cart-items:not(.is-empty)) {
    display: grid;
    grid-template-columns:
      var(--gutter2) minmax(0, 1fr) var(--cart-column-gap)
      minmax(22rem, 28rem) var(--gutter2);
    grid-template-areas:
      'breadcrumbs breadcrumbs breadcrumbs breadcrumbs breadcrumbs'
      '. items gap footer .';
    row-gap: 0;
    align-items: start;
    width: 100%;
    padding-block: 0 var(--pad-b4);

    > .siteBreadcrumbs {
      grid-area: breadcrumbs;
    }

    &:has(> .section-page-header) {
      grid-template-areas:
        'breadcrumbs breadcrumbs breadcrumbs breadcrumbs breadcrumbs'
        'header header header header header'
        '. items gap footer .';
    }

    > .section-page-header {
      grid-area: header;
      min-width: 0;
    }

    > .shopify-section:has(> cart-items:not(.is-empty)),
    > .shopify-section:has(> cart-items:not(.is-empty)) > cart-items,
    > .shopify-section:has(> cart-items:not(.is-empty)) > cart-items > .page-width {
      display: contents;
    }

    .cart__contents {
      grid-area: items;
      margin-block-start: var(--pad-b4);
    }

    > .cart__footer-wrapper {
      grid-area: footer;
      margin-block-start: var(--pad-b4);
    }
  }

  .cart__contents {
    min-width: 0;
    width: 100%;

    .cart__items {
      padding: 0;
      border: 0;
    }

    .cart-items {
      width: 100%;

      th {
        padding-block-end: 1rem;
        border-bottom: 1px solid var(--cart-rule);
      }

      td {
        padding-block: 1.5rem;
        border-bottom: 1px solid var(--cart-rule);
        vertical-align: middle;
      }

      thead th:first-child {
        width: auto;
      }

      .cart-items__heading--quantity{
      
      }
    }

    .cart-item {
      > td + td {
        padding-inline-start: 1.5rem;
      }

      .cart-item__media {
        width: var(--cart-image-width);
      }

      .cart-item__image {
        width: var(--cart-image-width);
        max-width: var(--cart-image-width);
      }

      .cart-item__details {
        width: auto;
        min-width: 0;
      }

      .cart-item__totals {
        width: 8rem;
      }

      .cart-item__quantity-wrapper {
        justify-content: flex-start;
        gap: .5rem;
      }

      quantity-popover {
        min-width: 0;
      }

      .quantity-popover-container {
        padding: 0;
      }

      quantity-input.quantity {
        width: 100%;
        padding-block: .5rem;
        border-radius: var(--cart-control-radius);

        .quantity__button {
          width: 2.5rem;
        }
      }

      cart-remove-button {
        margin: 0;

        .button {
          min-width: 0;
          min-height: 0;
          padding: .5rem;
          border: 0;
          box-shadow: none;
        }
      }
    }
  }

  > .cart__footer-wrapper {
    min-width: 0;
    width: 100%;

    #main-cart-footer:not(.is-empty) {
      width: 100%;
      background: transparent;

      > .page-width {
        width: 100%;
        max-width: none;
        padding: 0;
      }

      .cart__footer {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        padding: 1rem !important;
        border-radius: var(--common-radius);
        background: var(--cart-surface);

        > * {
          width: 100%;
        }

        > * + * {
          margin: 0;
        }
      }

      .cart__note {
        display: block;
        margin: 0;
        padding: 1rem;
        border: 0;
        border-radius: var(--common-radius);
        background: rgb(var(--color-background));

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

        label {
          position: static;
          height: auto;
          margin-block-end: .5rem;
          color: currentColor;
          font-weight: var(--bold);
          -webkit-text-stroke: var(--sans-fatten) currentColor;
          paint-order: stroke fill;
        }

        .field__input {
          min-height: 6rem;
          padding: .75rem 1rem;
          border: 1px solid var(--cart-rule);
          border-radius: var(--common-radius);
          background: var(--cart-surface);
        }
      }

      .cart__blocks {
        display: grid;
        gap: .75rem;

        > * + * {
          margin: 0;
        }

        > .shopify-app-block,
        > .js-contents {
          min-width: 0;
          padding: 1rem;
          border-radius: var(--common-radius);
          background: rgb(var(--color-background));
        }

        .shopify-app-block {
          font-size: 1em;

          * {
            min-width: 0;
          }

          [style*='font-size'] {
            font-size: .9em !important;
          }

          [style*='margin'][style*='px'] {
            margin: 0 !important;
          }

          [style*='color'] {
            color: currentColor !important;
          }

          [style*='fill'] {
            fill: currentColor !important;
          }

          input,
          select,
          textarea {
            width: 100%;
            max-width: 100%;
            font: inherit;
            color: currentColor;
          }
        }

        #delivery-datetime--isRender {
          max-width: 100% !important;
          margin: 0 !important;
        }

        .delivery-container {
          width: 100%;
          max-width: 100%;
          color: currentColor;
          font-size: 1em !important;

          .delivery_box {
            display: grid;
            grid-template-columns: 1fr;
            gap: 0 1rem;
            align-items: start;

            > .title-border {
              display: block;
              grid-column: 1 / -1;
              padding: 0 0 .5em;
              font-weight: var(--bold);
              -webkit-text-stroke: var(--sans-fatten) currentColor;
              paint-order: stroke fill;
            }
          }

          .delivery-mindate-caution {
            color: currentColor !important;
            text-align: start !important;
          }
        }
      }

      .totals {
        justify-content: space-between;
        align-items: center;
        gap: 1rem;

        > * + * {
          margin: 0;
        }

        .totals__total {
          font-size: 1em;
        }

        .totals__total-value {
          font-size: 1.3em;
        }
      }

      .tax-note {
        margin: .5rem 0 0;
        text-align: center;
        font-size: .8em;
        opacity: .75;
      }

      .cart__ctas {
        display: block;

        .cart__checkout-button {
          width: 100%;
          max-width: none;
          padding: 1rem;
          --btn-edge: rgb(var(--color-button));
          border-radius: var(--cart-control-radius);
          background: rgb(var(--color-button));
          color: rgb(var(--color-button-text));

          &:hover {
            --btn-edge: rgb(var(--theme-accent));
            background: rgb(var(--theme-accent));
            color: rgb(var(--theme-body));
          }
        }
      }

      .cart__dynamic-checkout-buttons {
        max-width: none;
        margin: 0;

        shopify-accelerated-checkout-cart {
          --shopify-accelerated-checkout-button-border-radius: var(--cart-control-radius);
        }
      }
    }
  }

  @media screen and (max-width: 1024px) {
    &:has(cart-items:not(.is-empty)) {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      width: 100%;
      padding-block: 0 var(--pad-b4);

      .cart__contents,
      > .cart__footer-wrapper {
        width: auto;
        max-width: 100%;
        margin-inline: var(--inner-start);
      }
    }

    .cart__contents {
      .cart-items {
        .cart-items__heading--quantity {
        
        }
      }

      .cart-item {
        > td + td {
          padding-inline-start: 1rem;
        }
      }
    }
  }

  @media screen and (max-width: 749px) {
    .cart__contents {
      .cart-items {
        display: block;

        thead {
          display: none;
        }

        tbody {
          display: block;
          width: 100%;
        }
      }

      .cart-item {
        display: grid;
        grid-template-columns: var(--cart-image-width) minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        gap: 0 1rem;
        margin: 0;
        padding-block: 1rem;
        border-bottom: 1px solid var(--cart-rule);

        > td {
          padding: 0;
          border: 0;
        }

        > td + td {
          padding: 0;
        }

        .cart-item__media {
          grid-column: 1;
          grid-row: 1 / 4;
          width: var(--cart-image-width);
        }

        .cart-item__details {
          grid-column: 2;
          grid-row: 1;
        }

        .cart-item__quantity {
          grid-column: 2;
          grid-row: 2;
          width: auto;
        }

        .cart-item__totals {
          grid-column: 2;
          grid-row: 3;
          justify-self: end;
          width: auto;
          align-items: center;
        }

        .cart-item__quantity-wrapper {
          flex-wrap: nowrap;
        }
      }
    }

    > .cart__footer-wrapper {
      #main-cart-footer {
        .cart__blocks {
          .delivery-container {
            .delivery_box {
              display: block;

              > * + * {
                margin-block-start: .5rem;
              }
            }
          }
        }
      }
    }
  }
}
