/* Keep the order total present on phones without turning it into a second panel. */
@media (max-width: 850px) {
  .checkout-v2 .checkout-grid:not(.is-payment-step) {
    padding-bottom: calc(180px + env(safe-area-inset-bottom, 0px));
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary {
    box-sizing: border-box;
    position: sticky;
    z-index: 20;
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(116px, .65fr);
    grid-template-rows: auto auto auto;
    align-items: center;
    gap: 0 12px;
    width: 100%;
    max-height: none;
    margin: 0 auto;
    padding: 9px 13px;
    overflow: visible;
    border: 1px solid #777;
    border-radius: 14px;
    background: linear-gradient(145deg, rgb(35 35 35 / 97%), rgb(12 12 12 / 98%));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%), 0 8px 28px rgb(0 0 0 / 48%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary .pay-summary-heading,
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary .pay-provider-status,
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary .pay-methods-heading,
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary .pay-card-brands,
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary #order-summary-items,
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary #tier-pricing-note,
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary #price-summary-details {
    display: none;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary .pay-price-main > span:first-child {
    grid-column: 1;
    grid-row: 1;
    color: #c8c8c8;
    font-size: 10px !important;
    font-weight: 800;
    letter-spacing: .07em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary .pay-price-main > strong {
    grid-column: 1;
    grid-row: 2;
    color: #fff;
    font-size: clamp(22px, 6vw, 27px);
    font-weight: 850;
    line-height: 1.08;
    letter-spacing: -.04em;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary .pay-price-main > strong.is-empty {
    font-size: 14px !important;
    letter-spacing: 0;
    line-height: 1.2;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary .summary-expand {
    display: block;
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    min-height: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #c8c8c8;
    font: inherit;
    font-size: 11px !important;
    line-height: 1.3;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary #checkout-submit {
    grid-column: 2;
    grid-row: 1 / span 3;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 12px !important;
    line-height: 1.25;
    white-space: normal;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary .pay-status:not(.is-error) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary .pay-status.is-error {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 3px;
    padding: 5px 0 0;
    border: 0;
    border-top: 1px solid #4a4540;
    border-radius: 0;
    background: transparent;
    color: #f0c3a5;
    font-size: 11px !important;
    line-height: 1.25;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary .quote-retry:not([hidden]) {
    grid-column: 1 / -1;
    grid-row: 5;
    justify-self: start;
    margin: 7px 0 0;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary.is-expanded {
    max-height: min(70dvh, 620px);
    padding-bottom: calc(13px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    align-items: start;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary.is-expanded #price-due-note {
    display: block;
    grid-column: 1 / -1;
    grid-row: 4;
    margin: 4px 0 0;
    color: #dedede;
    font-size: 11px;
    line-height: 1.4;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary.is-expanded #order-summary-items,
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary.is-expanded #tier-pricing-note,
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary.is-expanded #price-summary-details {
    display: grid;
    grid-column: 1 / -1;
  }

  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary.is-expanded #order-summary-items { grid-row: 6; }
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary.is-expanded #tier-pricing-note { grid-row: 7; }
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary.is-expanded #price-summary-details { grid-row: 8; }
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary.is-expanded .pay-summary-details { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 850px) {
  .checkout-v2 .checkout-grid:not(.is-payment-step) > .pay-summary {
    transition: box-shadow .18s ease, border-color .18s ease;
  }
}
