.commerce-page {
  overflow-x: clip;
  background: var(--ivory);
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr);
  gap: 2rem;
  align-items: start;
}

#msOrder {
  margin-top: 0 !important;
}

@media (min-width: 992px) {
  .checkout-side-column {
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    align-self: start;
    z-index: 2;
  }

  .checkout-side-column .order-summary {
    position: static;
  }
}

.checkout-panel,
.order-summary,
.cart-item-copy,
.summary-item > span { min-width: 0; }

.checkout-subsection {
  margin-top: 1.8rem;
  padding: 1.4rem 0 0;
  border: 0;
  border-top: 1px solid #e3ddd2;
  min-inline-size: 0;
  min-width: 0;
}

.checkout-subsection legend {
  float: none;
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.checkout-choice {
  margin-bottom: .75rem;
}

.checkout-choice:last-of-type { margin-bottom: 0; }

.checkout-choice b {
  color: var(--green-800);
  text-align: right;
  white-space: nowrap;
}

.checkout-panel .payment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
}

.payment-option {
  display: block;
  min-width: 0;
}

.payment-option > span {
  box-sizing: border-box;
  width: 100%;
  min-height: 108px;
  padding: 1.05rem .9rem;
  gap: .35rem;
}

.payment-option strong {
  display: block;
  font-size: .95rem;
}

.payment-option small {
  display: block;
  max-width: 14ch;
  color: #65716b;
  font-size: .75rem;
  line-height: 1.35;
}

.checkout-consent {
  margin-top: 1.5rem;
}

.coupon-feedback { min-height: 1.4em; margin-top: .35rem; font-size: .82rem; }
.coupon-feedback.success { color: var(--green-700); }
.coupon-feedback.error { color: #a13c3c; }

.cart-clear {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: 1.2rem;
  padding: 0;
  color: #8a3e3e;
  background: transparent;
  border: 0;
  font-weight: 700;
}

.summary-back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .9rem;
  color: var(--green-700);
  font-weight: 700;
}

.summary-back-link:hover,
.summary-back-link:focus-visible { color: var(--green-900); }

.order-summary .btn.disabled { pointer-events: none; opacity: .55; }
.order-summary .summary-items {
  max-height: none;
  overflow: visible;
}
.order-summary .summary-totals {
  margin-top: 1.4rem;
  padding-top: 0;
  border-top: 0;
}
.order-summary .summary-totals > .summary-total:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.order-summary .summary-totals > :not(.summary-total) + .summary-total {
  margin-top: .45rem;
  padding-top: .9rem;
  border-top: 1px solid #d7d0c4;
}

.summary-item-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  padding: .35rem;
  box-sizing: border-box;
  overflow: hidden;
  color: var(--green-700);
  background: #eee8df;
  font-size: 1.5rem;
}

.order-summary .summary-item-media img,
.order-summary .summary-item img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
}

.order-summary .summary-item {
  grid-template-columns: 88px minmax(0, 1fr) auto;
}

.cart-item-image {
  display: grid;
  width: 128px;
  min-height: 128px;
  height: 100%;
  align-self: stretch;
  place-items: center;
  overflow: hidden;
  color: var(--green-700);
  font-size: 2.3rem;
  background: #eee8df;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.cart-item {
  display: grid !important;
  grid-template-columns: 128px minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  gap: 1.2rem !important;
  padding: 1.2rem 0;
  border-bottom: 1px solid #e8e2d8;
}

.cart-item-copy {
  min-width: 0;
}

.cart-item-copy h3 {
  margin: .15rem 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.cart-item-copy h3 a {
  color: var(--ink);
}

.cart-item-copy h3,
.cart-item-copy small { overflow-wrap: anywhere; }

.cart-item-options {
  display: grid;
  gap: .2rem;
  margin: .35rem 0 0;
  padding: 0;
  list-style: none;
  color: #67726c;
  font-size: .82rem;
}

.cart-item-options li span {
  color: #8a938e;
  font-weight: 700;
}

.summary-item .cart-item-options {
  margin: .25rem 0 .35rem;
  font-size: .78rem;
}

.cart-quantity {
  display: grid;
  grid-template-columns: 38px 48px 38px;
  align-items: center;
  overflow: hidden;
  width: max-content;
  border: 1px solid #c8cfc9;
  border-radius: .2rem;
  background: #fff;
}

.cart-quantity button,
.cart-quantity input {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0;
  color: var(--ink);
  text-align: center;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  appearance: none;
  -moz-appearance: textfield;
}

.cart-quantity button {
  color: var(--green-900);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.cart-quantity button:hover {
  background: #f3efe7;
}

.cart-quantity button:focus-visible,
.cart-quantity input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  z-index: 1;
}

.cart-quantity input {
  min-height: 40px;
  border-left: 1px solid #d9dedb;
  border-right: 1px solid #d9dedb;
  font-size: .95rem;
  font-weight: 700;
}

.cart-quantity input::-webkit-outer-spin-button,
.cart-quantity input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.cart-line-price {
  justify-self: end;
  color: var(--green-900);
  font-size: 1.1rem;
  white-space: nowrap;
}

.cart-item-copy .cart-remove {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .65rem;
  padding: 0;
  color: #8a3e3e;
  background: transparent;
  border: 0;
  font-size: .82rem;
}

.cart-item-copy .cart-remove:hover {
  color: #6d2c2c;
}

.checkout-order-summary .cart-empty {
  padding: 2rem .5rem 0;
  border-top: 1px solid #e5ded3;
}

.mobile-summary-toggle { display: none; }

.compatibility-panel { max-width: 760px; padding: clamp(1.5rem, 5vw, 3rem); }
.compatibility-panel h2 {
  margin: .6rem 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
}
.compatibility-icon { color: var(--gold-dark); font-size: 3rem; }

.success-card {
  max-width: 850px;
  margin: 0 auto;
  padding: clamp(1.5rem, 6vw, 4rem);
  text-align: center;
  background: #fff;
  border: 0;
  border-top: 5px solid var(--gold);
  box-shadow: none;
}

.success-icon {
  display: grid;
  width: 76px;
  height: 76px;
  margin: 0 auto 1.5rem;
  place-items: center;
  color: #fff;
  background: var(--green-700);
  border-radius: 50%;
  font-size: 2.2rem;
}

.success-number {
  display: inline-block;
  margin: 1rem 0;
  padding: .7rem 1rem;
  color: var(--green-900);
  background: var(--sand);
  font-weight: 800;
  letter-spacing: .05em;
}

.success-order-items {
  max-width: 560px;
  margin: 1.5rem auto;
  text-align: left;
}

.success-order-items .summary-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: start;
  gap: .85rem;
  margin: 0;
  padding: .85rem 0;
  border: 0;
  border-bottom: 1px solid #e8e2d8;
}

.success-order-items .summary-item:last-child {
  border-bottom: 0;
}

.success-order-items .summary-item-media {
  width: 88px;
  height: 88px;
}

.success-order-items .summary-item-media img,
.success-order-items .summary-item img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
}

.success-order-items .summary-item-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.success-order-items .summary-item .cart-item-options {
  margin: .3rem 0 .35rem;
}

.success-order-items .summary-item b {
  color: var(--green-900);
  white-space: nowrap;
}

.success-summary-totals {
  max-width: 420px;
  margin: 1.2rem auto 0;
  text-align: left;
  border-top: 0;
  padding-top: 0;
}

.success-summary-totals > .summary-total:first-child {
  margin-top: 0;
  padding-top: .9rem;
  border-top: 1px solid #d7d0c4;
}

.success-summary-totals > :not(.summary-total) + .summary-total {
  margin-top: .45rem;
  padding-top: .9rem;
  border-top: 1px solid #d7d0c4;
}

.success-card .success-help a,
.success-card a:not(.btn) {
  color: var(--green-900);
  text-decoration: none;
}

.success-card .success-help a:hover,
.success-card a:not(.btn):hover {
  color: var(--gold-dark);
  text-decoration: underline;
}

.success-card hr {
  margin: 2rem auto 1.25rem;
  max-width: 420px;
  border: 0;
  border-top: 1px solid #e5ded3;
  opacity: 1;
}

.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1199.98px) {
  .wishlist-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-order-summary { order: -1; }
  .wishlist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .mobile-summary-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: .65rem;
    margin: 0;
    padding: 0 0 1rem;
    color: var(--green-900);
    background: transparent;
    border: 0;
    border-bottom: 1px solid #e5ded3;
    text-align: left;
    font-weight: 800;
  }

  .mobile-summary-toggle strong { color: var(--green-900); }
  .mobile-summary-toggle i { transition: transform .2s ease; }
  .mobile-summary-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
  .checkout-order-summary #checkoutSummary { padding-top: 1rem; }
}

@media (min-width: 992px) {
  .checkout-order-summary #checkoutSummary { display: block !important; }
}

@media (max-width: 767.98px) {
  .checkout-panel .payment-grid { grid-template-columns: 1fr; }
  .checkout-choice { grid-template-columns: 44px minmax(0, 1fr); }
  .checkout-choice b {
    grid-column: 2;
    margin-top: .15rem;
    text-align: left;
    white-space: normal;
  }
  .payment-option > span { min-height: 92px; }
  .payment-option small { max-width: none; }

  .cart-item {
    grid-template-columns: 120px minmax(0, 1fr) auto !important;
    grid-template-areas:
      "image copy copy"
      "image qty price";
    align-items: start !important;
    gap: .85rem 1rem !important;
  }

  .cart-item-image {
    grid-area: image;
    width: 120px;
    min-height: 100%;
    align-self: stretch;
  }

  .cart-item-copy {
    grid-area: copy;
  }

  .cart-quantity {
    grid-area: qty;
    justify-self: start;
  }

  .cart-line-price {
    grid-area: price;
    min-width: 0;
    margin: 0;
    text-align: right;
    align-self: center;
  }
}

@media (max-width: 575.98px) {
  .checkout-section { padding-top: 1.5rem; }
  .checkout-progress { margin-bottom: 1.5rem; }
  .checkout-progress strong { font-size: .7rem; }
  .checkout-progress > div::after { left: 65%; width: 70%; }
  .order-summary { padding: 1rem; }
  .cart-extra { margin-top: 1rem; }
  .cart-help-card { min-width: 0; }
  .cart-help-card a { overflow-wrap: anywhere; }
  .cart-item {
    grid-template-columns: 112px minmax(0, 1fr) !important;
    gap: .9rem !important;
  }
  .cart-item-image {
    width: 112px;
  }
  .cart-item-copy h3 { font-size: 1.2rem; }
  .cart-line-price { min-width: 0; }
  .summary-item { grid-template-columns: 64px minmax(0, 1fr); }
  .summary-item-media { width: 64px; height: 64px; }
  .summary-item b { grid-column: 2; }
  .wishlist-grid { grid-template-columns: 1fr; }
  .checkout-subsection { margin-top: 1.4rem; padding-top: 1.15rem; }
}
