/* AONE review 04: cart and checkout; review 05-06: optional cart navigation. */
body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .cart-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
}

.aone-commerce-review .cart-product-info {
  min-width: 0;
}

.aone-commerce-review .cart-product-info h3 {
  overflow-wrap: anywhere;
}

.aone-commerce-review .cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .cart-row form {
  width: auto;
  margin: 0;
  flex-wrap: nowrap;
  gap: 8px;
}

.aone-commerce-review .cart-quantity-form label {
  font-size: 14px;
  white-space: nowrap;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .cart-row input {
  width: 64px;
  min-width: 0;
  flex: 0 0 64px;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .cart-row button {
  width: auto;
  min-width: 52px;
  padding: 0 12px;
  border: 1px solid var(--rd-gray-30, #d9dde3);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  white-space: nowrap;
}

.aone-commerce-review .cart-row button:hover {
  background: #f3f6ff;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .cart-line-total {
  grid-column: 2;
  justify-self: end;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .order-summary > .button {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: calc(100% - 48px);
  max-width: calc(100% - 48px);
  min-width: 0;
  min-height: 52px;
  margin: 10px 24px 0;
  padding: 12px 16px;
  border-radius: 999px;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .commerce-continue {
  border: 1px solid var(--rd-gray-30, #d9dde3);
  background: #fff;
  color: var(--rd-gray-90, #202124);
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .commerce-continue:hover {
  border-color: var(--rd-primary-60, #104ff3);
  background: #f3f6ff;
  color: var(--rd-primary-60, #104ff3);
}

.aone-commerce-review .order-summary > small {
  text-align: center;
  line-height: 1.7;
}

.aone-commerce-review .order-summary dd {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .commerce-browse {
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 28px;
  border: 1px solid var(--rd-primary-60, #104ff3);
  border-radius: 999px;
  background: var(--rd-primary-60, #104ff3);
  color: #fff;
  text-decoration: none;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .commerce-browse:hover {
  border-color: #0a38ad;
  background: #0a38ad;
  color: #fff;
  text-decoration: none;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .checkout-payment {
  display: block;
  margin: 24px 28px 0;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .checkout-payment select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 12px 44px 12px 16px;
}

.commerce-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .checkout-item {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 40%);
  gap: 20px;
}

.aone-commerce-review .checkout-product-info {
  min-width: 0;
}

.aone-commerce-review .checkout-product-info b {
  display: block;
  margin-top: 6px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.aone-commerce-review .checkout-item-pricing {
  display: grid;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.aone-commerce-review .checkout-item-pricing > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.aone-commerce-review .checkout-item-pricing dt {
  color: var(--rd-gray-60, #667085);
}

.aone-commerce-review .checkout-item-pricing dd {
  margin: 0;
  white-space: nowrap;
}

.aone-commerce-review .checkout-line-total {
  padding-top: 8px;
  border-top: 1px solid var(--rd-gray-20, #e5e7eb);
  font-size: 16px;
  font-weight: 700;
}

/* A native dialog keeps keyboard focus within the two post-add choices. */
.aone-cart-dialog {
  box-sizing: border-box;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 32px 24px 24px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #fff;
  color: #202124;
  text-align: center;
  box-shadow: 0 24px 80px #172b4d33;
}

.aone-cart-dialog::backdrop {
  background: #10203366;
}

.aone-cart-dialog h2 {
  margin: 0 0 12px;
  font-size: 23px;
  line-height: 1.45;
}

.aone-cart-dialog p {
  margin: 0;
  color: #667085;
  font-size: 15px;
  line-height: 1.6;
}

.aone-cart-dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-cart-dialog .button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #104ff3;
  border-radius: 12px;
  background: #104ff3;
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-cart-dialog .button.outline {
  background: #fff;
  color: #104ff3;
}

body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-cart-dialog .button:hover {
  border-color: #0a38ad;
  background: #0a38ad;
  color: #fff;
}

.aone-cart-feedback {
  margin: 12px 0 0;
  color: #b42318;
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 760px) {
  body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .cart-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .aone-commerce-review .cart-item-controls {
    justify-content: flex-start;
  }

  body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .cart-line-total {
    grid-column: 1;
  }

  body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .checkout-item {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
    gap: 16px;
  }

  body:not(.kcbt-body):not(.ebook-reader-workspace) .aone-commerce-review .checkout-payment {
    margin-right: 20px;
    margin-left: 20px;
  }
}

@media (max-width: 360px) {
  .aone-cart-dialog-actions {
    flex-direction: column;
  }
}
