@charset "UTF-8";

/*
 * カート・購入手続き
 * woo.css や WooCommerce・数量ボタン（qib）の指定に !important が多いため、
 * ここでは body のクラスから詳しめに指定し、必要なところだけ !important で上書きする
 * 色や線は注文確認画面（checkout-confirm-woo）のトーンに合わせている
 */

body.woocommerce-cart,
body.woocommerce-checkout {
  --msm-ink: #333;
  --msm-sub: #767676;
  --msm-line: #e5e5e5;
  --msm-line-strong: #cfcfcf;
  --msm-soft: #f7f7f7;
  --msm-accent: #000;
  --msm-error: #bf0000;
  --msm-radius: 4px;
  --msm-radius-l: 8px;
  --msm-sticky-top: calc(var(--wp-admin--admin-bar--height, 0px) + 100px);
}


/* =========================================================
 * 共通：主ボタン
 * ========================================================= */

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
body.woocommerce-checkout #payment #place_order {
  display: flex !important;
  align-items: center;
  justify-content: center;
  float: none !important;
  width: 100% !important;
  height: 56px;
  margin: 0 !important;
  padding: 0 1em !important;
  font-size: 15px !important;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.4;
  color: #fff !important;
  background: var(--msm-accent) !important;
  border: none !important;
  border-radius: var(--msm-radius) !important;
  transition: opacity .2s;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
body.woocommerce-checkout #payment #place_order:hover {
  opacity: .8;
}


/* 共通：ラジオ・チェックボックス（woo.css の赤い塗りを、黒の点・チェックに） */
body.woocommerce-cart input[type="radio"],
body.woocommerce-checkout input[type="radio"] {
  flex: none;
  width: 18px !important;
  height: 18px !important;
  margin: 0;
  border-color: var(--msm-line-strong);
  cursor: pointer;
}

body.woocommerce-cart input[type="radio"]:checked,
body.woocommerce-checkout input[type="radio"]:checked {
  border-color: var(--msm-accent);
}

body.woocommerce-cart input[type="radio"]:checked::before,
body.woocommerce-checkout input[type="radio"]:checked::before {
  width: 10px;
  height: 10px;
  background: var(--msm-accent);
}

body.woocommerce-checkout input[type="checkbox"] {
  flex: none;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  border-color: var(--msm-line-strong);
  border-radius: 3px;
  cursor: pointer;
}

body.woocommerce-checkout input[type="checkbox"]:checked {
  background: var(--msm-accent);
  border-color: var(--msm-accent);
}

body.woocommerce-checkout input[type="checkbox"]:checked::before {
  top: 45%;
  width: 5px;
  height: 10px;
  background: none;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}


/* =========================================================
 * カート
 * ========================================================= */

/* PC：商品リストと金額の 2 カラム（金額はスクロールに追従） */
@media (min-width: 1024px) {
  body.woocommerce-cart div.woocommerce {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    column-gap: 48px;
    align-items: start;
  }

  body.woocommerce-cart div.woocommerce > * {
    grid-column: 1 / -1;
  }

  body.woocommerce-cart div.woocommerce > .woocommerce-cart-form {
    grid-column: 1;
  }

  /* 金額は右カラムで 2 行ぶんにまたがり、おすすめ商品を商品リストの下（左カラム）に置く */
  body.woocommerce-cart div.woocommerce > .cart-collaterals {
    grid-column: 2;
    grid-row: span 2;
    position: sticky;
    top: var(--msm-sticky-top);
  }

  body.woocommerce-cart div.woocommerce > .cross-sells {
    grid-column: 1;
  }
}

/* おすすめ商品（クロスセル） */
body.woocommerce-cart .cross-sells {
  float: none !important;
  width: auto !important;
  margin-top: 56px;
}

body.woocommerce-cart .cross-sells > h2 {
  margin: 0 0 20px !important;
  padding: 0 0 12px !important;
  font-size: 16px !important;
  font-weight: 700;
  color: var(--msm-ink) !important;
  background: none !important;
  border: none !important;
  border-bottom: 1px solid var(--msm-line) !important;
}

body.woocommerce-cart .cross-sells ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 16px;
  margin: 0 !important;
}

body.woocommerce-cart .cross-sells ul.products::before,
body.woocommerce-cart .cross-sells ul.products::after {
  display: none !important;
}

body.woocommerce-cart .cross-sells ul.products li.product {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}

@media (max-width: 768px) {
  body.woocommerce-cart .cross-sells ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 商品リスト：表をやめてカード状に並べる */
body.woocommerce-cart table.shop_table.cart {
  display: block;
  margin: 0 !important;
  border: none !important;
  border-top: 1px solid var(--msm-line) !important;
  border-radius: 0 !important;
}

body.woocommerce-cart table.shop_table.cart thead {
  display: none;
}

body.woocommerce-cart table.shop_table.cart tbody {
  display: block;
}

body.woocommerce-cart table.shop_table.cart tr.cart_item {
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  grid-template-areas:
    "thumb name     remove"
    "thumb price    price"
    "thumb quantity subtotal";
  column-gap: 16px;
  row-gap: 6px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--msm-line);
}

body.woocommerce-cart table.shop_table.cart tr.cart_item td {
  display: block !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  text-align: left !important;
  font-size: 14px;
}

body.woocommerce-cart table.shop_table.cart tr.cart_item td::before {
  display: none !important;
}

body.woocommerce-cart table.shop_table.cart td.product-thumbnail {
  grid-area: thumb;
  margin: 0 !important;
}

body.woocommerce-cart table.shop_table.cart td.product-thumbnail a {
  display: block !important;
  margin: 0 !important;
}

body.woocommerce-cart table.shop_table.cart td.product-thumbnail img {
  display: block;
  width: 88px !important;
  height: 88px;
  object-fit: cover;
  background: #f1f1f1;
  border-radius: var(--msm-radius);
  box-shadow: none;
}

body.woocommerce-cart table.shop_table.cart td.product-name {
  grid-area: name;
  line-height: 1.6;
}

body.woocommerce-cart table.shop_table.cart td.product-name a {
  color: var(--msm-ink);
  text-decoration: none !important;
}

body.woocommerce-cart table.shop_table.cart td.product-name dl.variation {
  display: block !important;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--msm-sub);
}

body.woocommerce-cart table.shop_table.cart td.product-price {
  grid-area: price;
  font-size: 13px;
  color: var(--msm-sub);
}

body.woocommerce-cart table.shop_table.cart td.product-quantity {
  grid-area: quantity;
  align-self: end;
  margin-top: 6px;
}

body.woocommerce-cart table.shop_table.cart td.product-subtotal {
  grid-area: subtotal;
  align-self: end;
  text-align: right !important;
  font-size: 15px;
  font-weight: 700;
}

/* 削除：赤い × ではなく控えめな文字リンクに */
body.woocommerce-cart table.shop_table.cart td.product-remove {
  grid-area: remove;
  text-align: right !important;
}

body.woocommerce-cart table.shop_table.cart a.remove {
  display: inline !important;
  width: auto !important;
  height: auto !important;
  font-size: 0 !important;
  line-height: 1;
  color: var(--msm-sub) !important;
  background: none !important;
  border-radius: 0 !important;
}

body.woocommerce-cart table.shop_table.cart a.remove::after {
  content: "削除";
  font-size: 12px;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.woocommerce-cart table.shop_table.cart a.remove:hover {
  color: var(--msm-ink) !important;
  background: none !important;
}

/* 数量：枠でまとめた − 数字 + */
body.woocommerce-cart table.shop_table.cart .qib-container {
  display: inline-flex !important;
  align-items: stretch;
  height: 36px;
  border: 1px solid var(--msm-line-strong);
  border-radius: var(--msm-radius);
  overflow: hidden;
}

body.woocommerce-cart table.shop_table.cart .qib-container .qib-button {
  width: 36px !important;
  height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 16px !important;
  color: var(--msm-ink) !important;
  background: #fff !important;
  border: none !important;
  border-radius: 0 !important;
  transition: background-color .2s;
}

body.woocommerce-cart table.shop_table.cart .qib-container .qib-button:hover {
  background: var(--msm-soft) !important;
}

body.woocommerce-cart table.shop_table.cart .qib-container .quantity {
  margin: 0 !important;
}

body.woocommerce-cart table.shop_table.cart .qib-container .qty {
  width: 40px !important;
  height: 34px !important;
  padding: 0 !important;
  font-size: 14px;
  text-align: center;
  border: none !important;
  border-left: 1px solid var(--msm-line) !important;
  border-right: 1px solid var(--msm-line) !important;
  border-radius: 0 !important;
  background: #fff;
}

/* 「お買い物カゴを更新」：数量の変更で自動更新するので、JS が動く環境では隠す */
body.woocommerce-cart table.shop_table.cart tr:has(> td.actions) {
  display: block;
}

body.woocommerce-cart table.shop_table.cart td.actions {
  display: block !important;
  padding: 16px 0 0 !important;
  border: none !important;
  background: none !important;
  text-align: right !important;
}

body.woocommerce-cart table.shop_table.cart td.actions [name="update_cart"] {
  float: none !important;
  padding: 8px 16px !important;
  font-size: 12px !important;
  color: var(--msm-ink) !important;
  background: #fff !important;
  border: 1px solid var(--msm-line-strong) !important;
  border-radius: var(--msm-radius) !important;
}

body.msm-cart-autoupdate table.shop_table.cart td.actions {
  padding: 0 !important;
}

body.msm-cart-autoupdate table.shop_table.cart td.actions [name="update_cart"] {
  display: none !important;
}

/* クーポン：購入手続きのクーポン欄と同じカード型 */
body.woocommerce-cart table.shop_table.cart td.actions .coupon {
  display: flex !important;
  gap: 8px;
  float: none !important;
  margin: 16px 0 0 !important;
  padding: 16px !important;
  text-align: left;
  border: 1px solid var(--msm-line) !important;
  border-radius: var(--msm-radius-l) !important;
  background: #fff;
}

body.woocommerce-cart table.shop_table.cart td.actions .coupon .input-text {
  flex: 1;
  box-sizing: border-box;
  float: none !important;
  width: auto !important;
  min-width: 0;
  height: 46px;
  margin: 0 !important;
  padding: 0 14px !important;
  font-size: 16px;
  line-height: 1.4;
  color: var(--msm-ink);
  background: #fff;
  border: 1px solid var(--msm-line-strong) !important;
  border-radius: var(--msm-radius) !important;
  box-shadow: none;
  transition: border-color .2s, box-shadow .2s;
}

body.woocommerce-cart table.shop_table.cart td.actions .coupon .input-text:focus {
  outline: none;
  border-color: var(--msm-ink) !important;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .06);
}

body.woocommerce-cart table.shop_table.cart td.actions .coupon .button {
  display: block !important;
  float: none !important;
  width: auto !important;
  height: 46px;
  margin: 0 !important;
  padding: 0 20px !important;
  font-size: 13px !important;
  font-weight: 700;
  line-height: 1 !important;
  white-space: nowrap;
  color: var(--msm-ink) !important;
  background: #fff !important;
  border: 1px solid var(--msm-ink) !important;
  border-radius: var(--msm-radius) !important;
}

@media (max-width: 768px) {
  body.woocommerce-cart table.shop_table.cart td.actions .coupon {
    padding: 12px !important;
  }

  body.woocommerce-cart table.shop_table.cart td.actions .coupon .button {
    padding: 0 14px !important;
  }
}

/* 更新中は商品リストを薄く */
body.woocommerce-cart .woocommerce-cart-form.processing,
body.woocommerce-cart .cart_totals.processing {
  opacity: .5;
}

.msm-continue-shopping {
  margin: 20px 0 0;
  font-size: 13px;
}

.msm-continue-shopping a {
  color: var(--msm-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.msm-continue-shopping a::before {
  content: "←";
  margin-right: .5em;
  display: inline-block;
  text-decoration: none;
}

/* 金額：カード */
body.woocommerce-cart .cart-collaterals {
  width: 100% !important;
}

body.woocommerce-cart .cart-collaterals .cart_totals {
  float: none !important;
  width: 100% !important;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--msm-line);
  border-radius: var(--msm-radius-l);
}

@media (max-width: 1023px) {
  body.woocommerce-cart .cart-collaterals {
    margin-top: 40px;
  }
}

body.woocommerce-cart .cart_totals h2 {
  margin: 0 0 12px !important;
  padding: 0 !important;
  font-size: 16px !important;
  font-weight: 700;
  border: none !important;
  background: none !important;
}

body.woocommerce-cart .cart_totals table.shop_table {
  display: block;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

body.woocommerce-cart .cart_totals table.shop_table tbody {
  display: block;
}

body.woocommerce-cart .cart_totals table.shop_table tr {
  display: flex !important;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--msm-line);
}

body.woocommerce-cart .cart_totals table.shop_table th,
body.woocommerce-cart .cart_totals table.shop_table td {
  display: block !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  font-size: 14px;
  line-height: 1.6;
}

/* woo.css の旧レイアウト用の固定幅（td{width:20%} など）を打ち消す */
body.woocommerce-cart .cart_totals table.shop_table th,
body.woocommerce-cart .cart_totals table.shop_table td {
  width: auto !important;
  min-width: 0;
}

body.woocommerce-cart .cart_totals table.shop_table td {
  flex: 1 1 auto;
}

/* 金額は桁が増えても途中で折り返さない */
body.woocommerce-cart .cart_totals .amount {
  white-space: nowrap;
}

body.woocommerce-cart .cart_totals table.shop_table th {
  flex: none;
  white-space: nowrap;
  font-weight: 400 !important;
  color: var(--msm-sub);
}

body.woocommerce-cart .cart_totals table.shop_table td {
  text-align: right !important;
}

body.woocommerce-cart .cart_totals table.shop_table td::before {
  display: none !important;
}

body.woocommerce-cart .cart_totals tr.relax-club-hint th,
body.woocommerce-cart .cart_totals tr.relax-club-hint td {
  font-size: 12px;
}

body.woocommerce-cart .cart_totals tr.order-total {
  align-items: center;
}

body.woocommerce-cart .cart_totals tr.order-total th {
  font-weight: 700 !important;
  color: var(--msm-ink);
}

body.woocommerce-cart .cart_totals tr.order-total td strong .amount {
  font-size: 22px !important;
}

body.woocommerce-cart .cart_totals small.includes_tax {
  display: block;
  font-size: 11px;
  color: var(--msm-sub);
}

body.woocommerce-cart .cart_totals .woocommerce-shipping-destination,
body.woocommerce-cart .cart_totals .woocommerce-shipping-calculator {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--msm-sub);
}

body.woocommerce-cart .wc-proceed-to-checkout {
  padding: 16px 0 0 !important;
}

/* 送料無料までの進捗 */
.msm-free-shipping {
  margin: 0 0 20px;
  padding: 0 0 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--msm-line);
}

.msm-free-shipping__text {
  margin: 0 0 10px;
  line-height: 1.6;
}

.msm-free-shipping__text strong {
  margin: 0 .2em;
  font-size: 16px;
}

.msm-free-shipping__bar {
  height: 6px;
  background: var(--msm-soft);
  border-radius: 3px;
  overflow: hidden;
}

.msm-free-shipping__bar span {
  display: block;
  height: 100%;
  background: var(--msm-accent);
  border-radius: 3px;
  transition: width .4s;
}

.msm-free-shipping__note {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--msm-sub);
}

.msm-free-shipping.is-achieved .msm-free-shipping__text strong {
  margin-left: 0;
}

/* スマホ：合計と購入ボタンを画面下に固定（下部の SNS ナビの上） */
.msm-cart-bar {
  display: none;
}

@media (max-width: 768px) {
  body.woocommerce-cart {
    padding-bottom: 72px;
  }

  .msm-cart-bar {
    position: fixed;
    right: 0;
    bottom: 56px;
    left: 0;
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid var(--msm-line);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, .05);
    transition: transform .25s, opacity .25s;
  }

  .msm-cart-bar.is-hidden {
    transform: translateY(16px);
    opacity: 0;
    pointer-events: none;
  }

  .msm-cart-bar__total {
    line-height: 1.3;
  }

  .msm-cart-bar__total small {
    display: block;
    font-size: 11px;
    color: var(--msm-sub);
  }

  .msm-cart-bar__total span {
    font-size: 18px;
    font-weight: 700;
  }

  .msm-cart-bar__btn {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    height: 44px;
    font-size: 14px;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    background: var(--msm-accent);
    border-radius: var(--msm-radius);
  }

  body.woocommerce-cart table.shop_table.cart tr.cart_item {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    column-gap: 12px;
  }

  body.woocommerce-cart table.shop_table.cart td.product-thumbnail img {
    width: 72px !important;
    height: 72px;
  }

  body.woocommerce-cart .cart-collaterals .cart_totals {
    padding: 20px 16px;
  }
}


/* =========================================================
 * 購入手続き
 * ========================================================= */

/* 段階表示（注文確認画面と同じ見た目） */
.msm-steps {
  display: flex;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--msm-line);
}

.msm-steps li {
  position: relative;
  flex: 1;
  margin: 0;
  padding: 0 0 12px;
  font-size: 13px;
  text-align: center;
  color: var(--msm-sub);
}

.msm-steps b {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: .12em;
}

.msm-steps .is-current {
  font-weight: 700;
  color: var(--msm-ink);
}

.msm-steps .is-current::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--msm-accent);
}

/* 確認画面のあいだは入力画面用の部品を隠す */
body.ccw-is-confirm .msm-steps,
body.ccw-is-confirm .msm-order-summary {
  display: none !important;
}

/* クーポン */
body.woocommerce-checkout form.checkout_coupon {
  display: flex !important;
  gap: 8px;
  margin: 0 0 32px !important;
  padding: 16px !important;
  border: 1px solid var(--msm-line) !important;
  border-radius: var(--msm-radius-l) !important;
}

body.woocommerce-checkout form.checkout_coupon .form-row {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.woocommerce-checkout form.checkout_coupon .form-row-first {
  flex: 1;
}

body.woocommerce-checkout form.checkout_coupon .clear {
  display: none;
}

body.woocommerce-checkout form.checkout_coupon .button {
  height: 46px;
  padding: 0 20px !important;
  font-size: 13px !important;
  white-space: nowrap;
  color: var(--msm-ink) !important;
  background: #fff !important;
  border: 1px solid var(--msm-ink) !important;
  border-radius: var(--msm-radius) !important;
}

/* PC：入力とご注文内容の 2 カラム */
body.woocommerce-checkout form.checkout #customer_details .col-1,
body.woocommerce-checkout form.checkout #customer_details .col-2 {
  float: none !important;
  width: 100% !important;
}

@media (min-width: 1024px) {
  body.woocommerce-checkout form.checkout::after {
    content: "";
    display: table;
    clear: both;
  }

  body.woocommerce-checkout form.checkout #customer_details {
    float: left;
    width: calc(100% - 448px);
  }

  body.woocommerce-checkout form.checkout #order_review_heading,
  body.woocommerce-checkout form.checkout #order_review {
    float: right;
    clear: right;
    width: 400px;
  }
}

/* 見出し：番号付きの区切り */
body.woocommerce-checkout form.checkout {
  counter-reset: msm-step;
}

body.woocommerce-checkout form.checkout .woocommerce-billing-fields > h3,
body.woocommerce-checkout form.checkout .woocommerce-additional-fields > h3:first-of-type,
body.woocommerce-checkout form.checkout #order_review_heading,
body.woocommerce-checkout form.checkout .msm-payment-heading {
  counter-increment: msm-step;
  margin: 48px 0 20px !important;
  padding: 0 0 12px !important;
  font-size: 16px !important;
  font-weight: 700;
  line-height: 1.5;
  border-bottom: 1px solid var(--msm-ink);
}

body.woocommerce-checkout form.checkout .woocommerce-billing-fields > h3 {
  margin-top: 0 !important;
}

/* PC：右カラムの「ご注文内容」を「お客様情報」と同じ高さにそろえる（上の共通指定より後に置く） */
@media (min-width: 1024px) {
  body.woocommerce-checkout form.checkout #order_review_heading {
    margin-top: 0 !important;
  }
}

body.woocommerce-checkout form.checkout .woocommerce-billing-fields > h3::before,
body.woocommerce-checkout form.checkout .woocommerce-additional-fields > h3:first-of-type::before,
body.woocommerce-checkout form.checkout #order_review_heading::before,
body.woocommerce-checkout form.checkout .msm-payment-heading::before {
  content: counter(msm-step, decimal-leading-zero);
  margin-right: 10px;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--msm-sub);
}

/* 「追加情報」は小見出し */
body.woocommerce-checkout form.checkout .woocommerce-additional-fields > h3:not(:first-of-type) {
  margin: 24px 0 12px !important;
  padding: 0 !important;
  font-size: 13px !important;
  font-weight: 700;
  border: none;
}

/* 「請求先と別の住所に送る」 */
body.woocommerce-checkout form.checkout h3#ship-to-different-address {
  margin: 8px 0 16px !important;
  padding: 0 !important;
  font-size: 14px !important;
  font-weight: 400;
  border: none;
}

body.woocommerce-checkout form.checkout h3#ship-to-different-address label {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

body.woocommerce-checkout form.checkout h3#ship-to-different-address label span {
  margin: 0 !important;
  font-size: 14px !important;
  font-weight: 700;
}

body.woocommerce-checkout form.checkout .shipping_address {
  margin: 0 0 8px;
  padding: 20px 20px 4px;
  background: var(--msm-soft);
  border-radius: var(--msm-radius-l);
}

/* 入力欄 */
body.woocommerce-checkout form.checkout .form-row {
  margin: 0 0 18px !important;
  padding: 0 !important;
}

body.woocommerce-checkout form.checkout .form-row label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

body.woocommerce-checkout form.checkout .form-row label .required {
  display: none;
}

/* 必須の * は出さず、任意の項目にだけ「任意」 */
body.woocommerce-checkout form.checkout .form-row label .optional {
  font-size: 0;
}

body.woocommerce-checkout form.checkout .form-row label .optional::after {
  content: "任意";
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  vertical-align: 1px;
  color: var(--msm-sub);
  border: 1px solid var(--msm-line-strong);
  border-radius: 2px;
}

body.woocommerce-checkout form.checkout_coupon .input-text,
body.woocommerce-checkout form.checkout .form-row .input-text,
body.woocommerce-checkout form.checkout .form-row select,
body.woocommerce-checkout form.checkout .form-row .selModalButton {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  padding: 0 14px !important;
  font-size: 16px;
  line-height: 1.4;
  color: var(--msm-ink);
  background-color: #fff;
  border: 1px solid var(--msm-line-strong) !important;
  border-radius: var(--msm-radius) !important;
  box-shadow: none;
  transition: border-color .2s, box-shadow .2s;
}

body.woocommerce-checkout form.checkout .form-row select {
  appearance: none;
  padding-right: 36px !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23767676' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

body.woocommerce-checkout form.checkout .form-row .selModalButton {
  text-align: left;
  cursor: pointer;
}

body.woocommerce-checkout form.checkout .form-row textarea.input-text {
  height: 120px;
  padding: 12px 14px !important;
  line-height: 1.6;
}

body.woocommerce-checkout form.checkout .form-row .input-text::placeholder {
  font-size: 14px;
  color: #aaa;
}

body.woocommerce-checkout form.checkout .form-row .input-text:focus,
body.woocommerce-checkout form.checkout .form-row select:focus,
body.woocommerce-checkout form.checkout .form-row .selModalButton:focus-visible {
  outline: none;
  border-color: var(--msm-ink) !important;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .06);
}

body.woocommerce-checkout form.checkout .form-row.woocommerce-invalid .input-text,
body.woocommerce-checkout form.checkout .form-row.woocommerce-invalid select {
  border-color: var(--msm-error) !important;
}

/* エラー表示 */
body.woocommerce-checkout .woocommerce-NoticeGroup-checkout .woocommerce-error,
body.woocommerce-checkout .woocommerce-error {
  margin: 0 0 32px;
  padding: 16px 20px !important;
  font-size: 13px;
  color: var(--msm-ink);
  background: #fdf4f4;
  border: none;
  border-left: 2px solid var(--msm-error);
  border-radius: 0;
}

body.woocommerce-checkout .woocommerce-error::before {
  display: none;
}

/* ご注文内容：カード */
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table {
  border-collapse: separate;
  margin: 0 0 24px !important;
  padding: 4px 20px;
  border: 1px solid var(--msm-line) !important;
  border-radius: var(--msm-radius-l) !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table thead {
  display: none;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table th,
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table td {
  padding: 14px 0 !important;
  font-size: 14px !important;
  line-height: 1.6;
  vertical-align: top;
  background: none !important;
  border: none !important;
  border-top: 1px solid var(--msm-line) !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tbody tr:first-child td {
  border-top: none !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table th {
  font-weight: 400 !important;
  text-align: left;
  color: var(--msm-sub);
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table td {
  text-align: right;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table td.product-name {
  padding-right: 16px !important;
  text-align: left;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table .product-quantity {
  margin-left: .25em;
  font-weight: 400;
  color: var(--msm-sub);
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.relax-club-hint th,
body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.relax-club-hint td {
  font-size: 12px !important;
  font-weight: 400 !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.order-total th {
  font-weight: 700 !important;
  color: var(--msm-ink);
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.order-total td strong .amount {
  font-size: 22px !important;
}

body.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table small.includes_tax {
  display: block;
  font-size: 11px;
  color: var(--msm-sub);
}

/* 配送方法 */
body.woocommerce-checkout ul#shipping_method {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.woocommerce-checkout ul#shipping_method li {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0;
  text-indent: 0;
}

body.woocommerce-checkout ul#shipping_method li:last-child {
  margin-bottom: 0;
}

body.woocommerce-checkout ul#shipping_method li input {
  margin: 0 !important;
}

body.woocommerce-checkout ul#shipping_method li label {
  font-weight: 400;
  cursor: pointer;
}

/* お支払い方法：選択肢をカードに */
body.woocommerce-checkout #payment {
  background: none !important;
  border-radius: 0 !important;
}

body.woocommerce-checkout #payment ul.payment_methods {
  display: grid;
  gap: 10px;
  margin: 0 0 24px !important;
  padding: 0 !important;
  border: none !important;
}

body.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method {
  position: relative;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  background: #fff;
  border: 1px solid var(--msm-line-strong);
  border-radius: var(--msm-radius-l);
  transition: border-color .2s, box-shadow .2s;
}

body.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method:has(> input:checked) {
  border-color: var(--msm-accent);
  box-shadow: 0 0 0 1px var(--msm-accent);
}

body.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method > input {
  position: absolute;
  top: 18px;
  left: 16px;
  margin: 0 !important;
}

/* ラベルを行いっぱいに広げ、どこを押しても選べるように */
body.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method > label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  margin: 0;
  padding: 14px 16px 14px 46px;
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: baseline !important;
  cursor: pointer;
}

body.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method > label img {
  max-height: 20px;
  margin: 0 !important;
  float: none !important;
}

body.woocommerce-checkout #payment div.payment_box {
  box-sizing: border-box;
  width: auto !important;
  margin: 0 16px 16px !important;
  padding: 12px 14px !important;
  font-size: 13px;
  line-height: 1.7;
  color: var(--msm-sub) !important;
  background: var(--msm-soft) !important;
  border-radius: var(--msm-radius);
}

body.woocommerce-checkout #payment div.payment_box::before {
  display: none !important;
}

body.woocommerce-checkout #payment div.payment_box p {
  margin: 0;
}

body.woocommerce-checkout #payment div.payment_box.payment_method_stripe {
  background: #fff !important;
  padding: 0 !important;
}

body.woocommerce-checkout #wc-stripe-upe-form {
  border: 0 !important;
}

body.woocommerce-checkout #payment .form-row.place-order {
  margin: 0 !important;
  padding: 0 !important;
  background: none;
}

body.woocommerce-checkout #payment .woocommerce-privacy-policy-text p {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--msm-sub);
}

body.woocommerce-checkout #payment .woocommerce-privacy-policy-text a {
  color: var(--msm-ink);
}

/* スマホ・タブレット：ご注文内容を開閉式で上部に（JS で生成） */
.msm-order-summary {
  display: none;
}

@media (max-width: 1023px) {
  .msm-order-summary {
    display: block;
    margin: 0 0 32px;
    background: var(--msm-soft);
    border-radius: var(--msm-radius-l);
  }

  .msm-order-summary summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    font-size: 14px;
    list-style: none;
    cursor: pointer;
  }

  .msm-order-summary summary::-webkit-details-marker {
    display: none;
  }

  .msm-order-summary summary > span::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 10px;
    vertical-align: 3px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s;
  }

  .msm-order-summary[open] summary > span::after {
    vertical-align: 0;
    transform: rotate(-135deg);
  }

  .msm-order-summary summary b {
    font-size: 16px;
  }

  .msm-order-summary__body dl {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 0;
    margin: 0;
    padding: 4px 16px 16px;
    font-size: 13px;
  }

  .msm-order-summary__body dt {
    margin: 0;
    font-weight: 400;
    color: var(--msm-sub);
  }

  .msm-order-summary__body dd {
    margin: 0;
    padding-left: 16px;
    text-align: right;
  }

  .msm-order-summary__body .is-item {
    color: var(--msm-ink);
  }

  .msm-order-summary__body .is-item .product-quantity {
    font-weight: 400;
    color: var(--msm-sub);
  }

  .msm-order-summary__body .is-total {
    padding-top: 10px;
    font-weight: 700;
    color: var(--msm-ink);
    border-top: 1px solid var(--msm-line-strong);
  }

  .msm-order-summary__body small.includes_tax {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--msm-sub);
  }
}

/* ===== 購入手続き：Amazon Pay の案内 ===== */
body.woocommerce-checkout .wc-amazon-payments-advanced-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0 0 32px;
  padding: 20px;
  /* woo.css の .woocommerce-info { border-top: none !important } に負けないよう !important */
  border: 1px solid var(--msm-line) !important;
  border-radius: 8px;
  background: #fff;
  color: var(--msm-ink);
  font-size: 14px;
}

body.woocommerce-checkout .wc-amazon-payments-advanced-info::before {
  content: none !important;
}

body.woocommerce-checkout .wc-amazon-payments-advanced-info #pay_with_amazon {
  float: none !important;
  width: 100%;
  margin: 0 !important;
}

/* スマホ：見出し → ボタン → 手順 の順に縦並び */
.msm-amzn__head {
  display: grid;
  gap: 4px;
  order: -1;
}

.msm-amzn__title {
  font-size: 14px;
  font-weight: 700;
}

.msm-amzn__lead {
  color: var(--msm-sub);
  font-size: 12px;
  line-height: 1.7;
}

body.woocommerce-checkout .msm-amzn__steps {
  display: grid;
  gap: 8px;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  counter-reset: msm-amzn;
}

body.woocommerce-checkout .msm-amzn__steps li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 !important;
  color: var(--msm-sub);
  font-size: 12px;
  line-height: 1.6;
  list-style: none !important;
  counter-increment: msm-amzn;
}

body.woocommerce-checkout .msm-amzn__steps li::before {
  content: counter(msm-amzn);
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--msm-ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
}

/* PC：左に見出しと手順、右にボタン */
@media (min-width: 769px) {
  body.woocommerce-checkout .wc-amazon-payments-advanced-info {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
      "head  button"
      "steps button";
    column-gap: 40px;
    row-gap: 16px;
    padding: 24px 28px;
  }

  body.woocommerce-checkout .wc-amazon-payments-advanced-info #pay_with_amazon {
    grid-area: button;
    align-self: center;
  }

  .msm-amzn__head {
    grid-area: head;
  }

  body.woocommerce-checkout .msm-amzn__steps {
    grid-area: steps;
  }
}

/* 横幅に余裕があるときは手順を横に並べる */
@media (min-width: 1024px) {
  body.woocommerce-checkout .msm-amzn__steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}
