#checkoutSuccess {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 0 50px;
  box-sizing: border-box;
}

/* 左：完了メッセージ / 右：注文詳細 */
.checkout-success-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 28px;
  align-items: start;
}

.checkout-success-left,
.checkout-success-right {
  min-width: 0;
}

/* 左側：見出し */
#checkoutSuccessHeading {
  margin: 0 0 14px;
  padding: 12px 16px;
  background: #e8e8e8;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  border: none;
}

/* 注文番号 */
#checkoutSuccessOrderNumber {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.6;
}

/* 左側本文 */
#checkoutSuccessMainContent,
.checkout-success-payment-message,
#checkoutSuccessLogoff,
#checkoutSuccessContactLink {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.9;
}

#checkoutSuccessMainContent {
  padding: 0;
  background: transparent;
}

/* 赤い注意文など */
.checkout-success-left .content {
  font-size: 14px;
  line-height: 1.9;
}

/* 左側ボタン */
.checkout-success-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 16px;
  clear: both;
}

.checkout-success-buttons a {
  display: inline-block;
}

.checkout-success-buttons img {
  max-width: 100%;
  height: auto;
}

/* 右側：注文詳細テーブル */
.checkout-success-right table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #f3f3f3;
}

.checkout-success-right th,
.checkout-success-right td {
  border: 1px solid #d9d9d9;
  padding: 12px 10px;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.7;
  word-break: break-word;
}

.checkout-success-right th {
  background: #e5e5e5;
  font-weight: 700;
  text-align: left;
}

/* 商品一覧：数量・品名・合計 */
.checkout-success-right table th:nth-child(1),
.checkout-success-right table td:nth-child(1) {
  width: 48px;
  text-align: center;
}

.checkout-success-right table th:nth-child(2),
.checkout-success-right table td:nth-child(2) {
  width: auto;
}

.checkout-success-right table th:nth-child(3),
.checkout-success-right table td:nth-child(3) {
  width: 90px;
  text-align: right;
  white-space: nowrap;
}

/* 商品オプション */
.checkout-success-right ul,
.checkout-success-right ol {
  margin: 8px 0 0 18px;
  padding: 0;
}

.checkout-success-right li {
  margin: 0 0 3px;
}

/* 合計金額欄 */
.checkout-success-right #orderTotals {
  width: 260px;
  max-width: 100%;
  margin: 14px 0 22px auto;
  padding: 0;
  clear: both;
}

.checkout-success-right #orderTotals .lineTitle,
.checkout-success-right #orderTotals .amount {
  box-sizing: border-box;
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.8;
}

.checkout-success-right #orderTotals .lineTitle {
  float: left;
  width: 58%;
  text-align: right;
  padding-right: 12px;
  clear: left;
}

.checkout-success-right #orderTotals .amount {
  float: right;
  width: 42%;
  text-align: right;
  clear: right;
  white-space: nowrap;
}

.checkout-success-right #orderTotals::after {
  content: "";
  display: block;
  clear: both;
}

/* セクション見出し */
.checkout-success-right h2,
.checkout-success-right h3,
#csNotifications legend {
  margin: 0 0 10px;
  padding: 8px 12px;
  background: #dcdcdc;
  border: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

/* 注文履歴・住所・配送・支払方法の箱 */
.checkout-success-right .floatingBox,
.checkout-success-right fieldset,
.checkout-success-right .content {
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  background: #f3f3f3;
  border: none;
  box-sizing: border-box;
  float: none;
  clear: both;
}

/* 住所などの中身 */
.checkout-success-right address,
.checkout-success-right .smallText {
  display: block;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.8;
  font-style: normal;
}

/* 支払方法の赤文字 */
.checkout-success-right font[color="red"] {
  font-weight: 700;
}

/* 通知欄 */
#csNotifications {
  margin: 24px 0 0;
  padding: 0;
  background: #f3f3f3;
  border: none;
}

#csNotifications legend {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  background: #cfcfcf;
}

.cs-notify-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 12px 8px;
  font-size: 13px;
  line-height: 1.7;
}

.cs-notify-item input[type="checkbox"] {
  margin-top: 4px;
}

.cs-notify-button {
  margin: 0;
  padding: 10px 12px 18px;
  text-align: right;
  float: none;
}

.cs-notify-button input[type="image"],
.cs-notify-button img {
  max-width: 120px;
  height: auto;
}

/* 最下部のありがとう文 */
#checkoutSuccessThanks {
  display: none;
}

/* Zen Cart標準floatの干渉対策 */
.checkout-success-left .forward,
.checkout-success-left .back,
.checkout-success-right .forward,
.checkout-success-right .back {
  float: none;
}

/* ただし合計欄だけはfloatを戻す */
.checkout-success-right #orderTotals .forward {
  float: right;
}

.checkout-success-right #orderTotals .back {
  float: left;
}

/* スマホは1カラム */
@media (max-width: 900px) {
  #checkoutSuccess {
    max-width: 100%;
    padding: 12px 8px 40px;
  }

  .checkout-success-layout {
    display: block;
  }

  .checkout-success-left {
    margin-bottom: 24px;
  }

  #checkoutSuccessHeading {
    font-size: 17px;
  }

  #checkoutSuccessOrderNumber {
    font-size: 18px;
  }

  .checkout-success-buttons {
    flex-wrap: wrap;
  }

  .checkout-success-right th,
  .checkout-success-right td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .checkout-success-right table th:nth-child(1),
  .checkout-success-right table td:nth-child(1) {
    width: 42px;
  }

  .checkout-success-right table th:nth-child(3),
  .checkout-success-right table td:nth-child(3) {
    width: 82px;
  }

  .checkout-success-right #orderTotals {
    width: 100%;
  }
}

/* checkout_success 左側ボタン：小さめ横並び */
.checkout-success-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin: 18px 0 14px;
  clear: both;
}

.checkout-success-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 30px;
  padding: 0 14px;
  box-sizing: border-box;
  background: #d9d9d9;
  border-radius: 8px;
  color: #111;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.checkout-success-buttons a:hover {
  background: #cfcfcf;
  color: #111;
  text-decoration: none;
}

.checkout-success-buttons img {
  display: none;
}