.rich-text .rich-text__layout--normal-width {
  max-width: 920px;
}

.rich-text__wrapper--center {
  text-align: center;
}

.rich-text__wrapper--left {
  text-align: left;
}

.rich-text__wrapper--right {
  text-align: right;
}

.rich-text__blocks > * {
  margin-top: 0;
  margin-bottom: 0;
}

.rich-text__blocks > * + * {
  margin-top: 30px;
}

.rich-text .rich-text__buttons {
  display: flex;
  justify-content: center;
}

.rich-text .rich-text__buttons > *:first-child {
  margin-right: 20px;
}

@media screen and (max-width: 959px) {
  .rich-text .rich-text__layout--normal-width {
    max-width: 100%;
  }

  .rich-text__blocks > * + * {
    margin-top: 20px;
  }
}

/* The ipad end responds to the mobile end in vertical screen */

/* @custom-media --tablet (max-width: 959px); */

/* @custom-media --gt-mobile (min-width: 751px); */

/* detectingScreen need to consider the configuration of the tablet */

/* ====== 购物车页:促销码 rich-text 优化成优惠券卡片(仅 cart 生效,不改内容) ====== */
body[data-template="cart"] .rich-text__text {
  display: inline-block;
  width: 400px; /* 与结算列 .cart__checkout-container 同宽,右对齐后左右对齐 */
  max-width: 100%;
  text-align: left;
  padding: 14px 18px;
  border: 1px solid rgba(233, 119, 35, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff6ee 0%, #fffdfb 100%);
  box-shadow: 0 6px 18px rgba(233, 119, 35, 0.1);
  line-height: 1.4;
}

/* 每行:描述靠左,折扣码靠右对齐(所有码排成一列) */
body[data-template="cart"] .promo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 5px 0;
}

body[data-template="cart"] .promo-desc {
  color: rgba(26, 28, 30, 0.82);
  font-weight: 600;
}

/* 促销码可点胶囊按钮(点击应用到购物车) */
body[data-template="cart"] .promo-code {
  display: inline-flex;
  align-items: center;
  padding: 2px 11px;
  margin: 0 2px;
  border: 1px solid rgba(233, 119, 35, 0.5);
  border-radius: 999px;
  background-color: #fff;
  color: #e97723 !important;
  font: inherit;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  cursor: pointer;
  vertical-align: baseline;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

body[data-template="cart"] .promo-code:hover,
body[data-template="cart"] .promo-code:focus-visible {
  background-color: #e97723;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(233, 119, 35, 0.35);
  outline: none;
}

/* 移动端:促销卡片满宽,与结算列一致 */
@media (max-width: 959px) {
  body[data-template="cart"] .rich-text__text {
    width: 100%;
  }
}
