/*
 * 文字サイズについて
 *   style_desktop.min.css / style_mobile.min.css が html の font-size を 62.5%
 *   にしているため、このサイトでは 1rem = 10px になる。rem は実寸を誤読しやすい
 *   ので、EC 画面の文字サイズは px で書く。
 *
 *   金額・数量・配送先など判断に使う情報は記事本文より一段読みやすくし、
 *   補助情報 13px / 操作ラベル 14px / 本文 15px を基本にする。
 *   明朝見出し・白黒・細罫線はサイト共通のまま維持する。
 *
 *   font-size 未指定の要素は body(= 14px) や html(= 10px) を継承してしまうため、
 *   各画面のルート要素に基準値を必ず置くこと。
 */

/* ============================================================================
 * EC 領域の <br> をブラウザ既定の改行に戻す
 *
 * add.css (レガシー、layout.php が全ページで読む) に次のグローバル指定がある:
 *
 *   br { display:block; margin-bottom:30px; font-size:14px; color:#1c1c1c;
 *        font-family:"MS PGothic",...; letter-spacing:0.08em; text-align:left }
 *
 * このため <br> が「高さ 30px のブロック」になり、住所を
 * 〒 と番地で改行しただけで行間が 30px 空いてしまう(配送先・注文確認・注文履歴で発生)。
 * 商品説明の改行(ec_product_banner.js)も同様に間延びする。
 *
 * add.css 側の br 指定は記事・お問い合わせ・採用など既存ページのレイアウトが
 * 依存しており(同ファイル内に .article-contact br / .list-article-main br の
 * 打ち消しが既にある)、外すと影響範囲が全サイトに及ぶ。よってここでは
 * EC のルート要素配下だけを既定の改行に戻す。
 *
 * このファイルは head.php が全ページで読み込むため、EC 画面すべてに効く。
 * ========================================================================== */
.ec-account br,
.ec-cart br,
.ec-checkout br,
.ec-orders br,
.ec-mypage-page br,
.ec-purchase br {
  display: inline;
  margin: 0;
  font-size: inherit;
  color: inherit;
  font-family: inherit;
  letter-spacing: inherit;
  text-align: inherit;
}

/* ============================================================================
 * hidden 属性を必ず効かせる
 *
 * ブラウザ既定の `[hidden] { display: none }` は UA スタイルなので、
 * `.ec-checkout__grid { display: grid }` のようなクラス指定に負ける。
 * JS が el.hidden = true にしても消えず、
 *   「見えているのに操作できない」(radio だけ disabled)
 * という分かりにくい壊れ方をする。実際に
 *   ・確認ステップで入力フォームが下に残る
 *   ・利用できない支払方法がクリックできない状態で並ぶ
 * が発生した。個別に打ち消すと必ず漏れるので、EC 配下は一律で落とす。
 *
 * 例外を作りたい要素が出たら、その要素側で display を !important で戻すこと。
 * ========================================================================== */
.ec-account [hidden],
.ec-cart [hidden],
.ec-checkout [hidden],
.ec-orders [hidden],
.ec-mypage-page [hidden],
.ec-purchase [hidden],
.ec-account[hidden],
.ec-cart[hidden],
.ec-checkout[hidden],
.ec-orders[hidden] {
  display: none !important;
}

/* EC カート: ヘッダの個数バッジ & /cart 殻ページ (Phase 3 / item 11, 12) */

/* --- ヘッダのカート個数バッジ --------------------------------------------- */
.ec-cart-link {
  position: relative;
}
.ec-cart-badge {
  box-sizing: border-box;
  display: inline-block;
  min-width: 20px;
  height: 20px;
  margin-left: 0.4em;
  padding: 0 5px;
  border-radius: 1em;
  background: #111;
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  vertical-align: middle;
}
.ec-cart-badge[hidden] {
  display: none;
}

@media (width >= 768px) {
  html[lang="ja"] #footer .container .etc > .ec-footer-link--tradelaw {
    width: calc(20% + 2em);
  }

  html[lang="ja"] #footer .container .etc > .ec-footer-link--tradelaw a {
    white-space: nowrap;
  }

  html[lang="en"] #footer .container .etc {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px 25px;
  }

  html[lang="en"] #footer .container .etc > li {
    width: auto;
    min-width: 0;
    margin: 0;
  }

  html[lang="en"] #footer .container .etc > li a {
    line-height: 1.25;
    overflow-wrap: break-word;
  }
}

/* --- /cart 殻ページ ------------------------------------------------------- */
.ec-cart {
  box-sizing: border-box;
  font-size: 15px;
  line-height: 1.65;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  color: #1c1c1c;
}
.ec-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.ec-flow-header {
  max-width: 62em;
  padding-bottom: 24px;
  border-bottom: 1px solid #303030;
  margin-bottom: 20px;
}
.ec-flow-header__eyebrow {
  margin: 0 0 8px;
  color: #777;
  font-family: 'EB Garamond', serif;
  font-size: 13px;
  letter-spacing: .14em;
}
.ec-flow-header__lead {
  max-width: 58em;
  margin: 12px 0 0;
  color: #555;
  font-size: 15px;
  line-height: 1.7;
}
.ec-cart__title {
  font-size: 26px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  margin: 0;
}
.ec-cart__status {
  color: #666;
  min-height: 1.5em;
  margin: 0 0 12px;
}
.ec-cart__empty {
  padding: 56px 24px;
  border-bottom: 1px solid #e5e5e5;
  text-align: center;
  color: #666;
}
.ec-cart__empty-title {
  margin: 0 0 8px;
  color: #1c1c1c;
  font-size: 18px;
}
.ec-cart__empty a {
  text-decoration: underline;
}

.ec-cart__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #e5e5e5;
}
.ec-cart__item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto minmax(8em, auto) auto;
  gap: 20px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid #e5e5e5;
}
.ec-cart__media {
  position: relative;
  display: block;
  width: 104px;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f2f2f0;
}
.ec-cart__media.is-missing::after {
  content: "IMAGE NOT AVAILABLE";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: #999;
  font-family: 'EB Garamond', serif;
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: .08em;
  text-align: center;
}
.ec-cart__thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.ec-cart__info {
  flex: 1 1 auto;
  min-width: 0;
}
.ec-cart__name {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
}
.ec-cart__price {
  margin: 0;
  color: #333;
}
.ec-cart__unavailable {
  color: #c00;
  font-size: 14px;
  margin: 6px 0 0;
}
.ec-cart__qty {
  min-width: 92px;
}
.ec-cart__qty label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #555;
  font-size: 14px;
}
.ec-cart__qty input {
  width: 56px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #9d9fa2;
  border-radius: 0;
  background: #fff;
  color: #1c1c1c;
  font-size: 16px;
  text-align: right;
}
.ec-cart__line-total {
  min-width: 8em;
  text-align: right;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.ec-cart__remove {
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  background: none;
  border: none;
  color: #c00;
  cursor: pointer;
  text-decoration: underline;
  font-size: 14px;
}

.ec-cart__summary {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  align-items: baseline;
  gap: 8px 24px;
  padding-top: 24px;
  margin: 0;
  font-size: 15px;
}
.ec-cart__summary dt,
.ec-cart__summary dd {
  margin: 0;
}
.ec-cart__summary dt span {
  color: #777;
  font-size: 13px;
}
.ec-cart__total {
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ec-cart__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.ec-cart__checkout {
  box-sizing: border-box;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  cursor: pointer;
  font: inherit;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.ec-cart__checkout:focus {
  color: #fff;
}
.ec-cart__checkout:hover:not([disabled]) {
  border-color: #111;
  background: #fff;
  color: #111;
}
.ec-cart__checkout[disabled] {
  border-color: #aaa;
  background: #aaa;
  color: #fff;
  opacity: 1;
  cursor: default;
}
.ec-cart__secondary {
  box-sizing: border-box;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 1px solid #303030;
  background: #fff;
  color: #303030;
  cursor: pointer;
  font: inherit;
  line-height: 1.4;
  text-align: center;
  text-decoration: none !important;
  transition: background-color .15s ease, color .15s ease;
}
.ec-cart__secondary:hover {
  background: #303030;
  color: #fff;
}

/* --- /checkout (item 17) --- */
.ec-checkout {
  box-sizing: border-box;
  font-size: 15px;
  line-height: 1.65;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  color: #1c1c1c;
}
.ec-checkout__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas:
    "details summary"
    "back summary";
  column-gap: 48px;
  row-gap: 32px;
  align-items: start;
}
.ec-checkout__details-col {
  grid-area: details;
  min-width: 0;
}
/* details 側の各セクション見出しを、罫線+上余白で明確に区切る(checkout / consultation 共通)。
   最初の見出しは区切らない。セクションの境目が分かりにくい問題への対応。 */
.ec-checkout__details-col .ec-account__heading:not(:first-child) {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid #e6e6e6;
}
/* 「お客様情報/配送先を変更」で開くインライン編集パネルを、明確なカード(枠+地色+見出し)にする。
   開いた部分が周囲と地続きで分かりにくい問題への対応(checkout / consultation 共通)。 */
.ec-consult__account-edit,
.ec-checkout__account-edit {
  margin: 14px 0 8px;
  padding: 18px 20px;
  background: #f7f6f4;
  border: 1px solid #ddd9d2;
  border-radius: 3px;
}
.ec-consult__account-edit .ec-account,
.ec-checkout__account-edit .ec-account {
  max-width: none;
  margin: 0;
}
.ec-consult__account-head,
.ec-checkout__account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e4e0d9;
}
.ec-consult__account-title,
.ec-checkout__account-title {
  font-size: 14px;
  font-weight: bold;
  letter-spacing: .04em;
}
/* お客様情報(連絡先=氏名/電話)の表示。consultation / checkout で共通の見た目にする。 */
.ec-contact__name { font-weight: 700; }
.ec-contact__phone { margin-top: 3px; color: #555; }
.ec-contact__editrow { margin-top: 20px; }
/* 配送先: 保存済み住所のラジオ選択リスト(標準フロー=「選ぶ + 追加」。編集/削除/既定はマイページ)。 */
.ec-checkout__addr-list { display: flex; flex-direction: column; gap: 10px; }
.ec-checkout__addr-option {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid #ddd; border-radius: 3px; cursor: pointer;
  background: #fff; transition: border-color .15s ease, background-color .15s ease;
}
.ec-checkout__addr-option:hover { border-color: #999; }
.ec-checkout__addr-option.is-selected { border-color: #303030; background: #fafafa; }
.ec-checkout__addr-option input[type="radio"] { margin: 2px 0 0; width: 18px; height: 18px; flex: 0 0 18px; }
.ec-checkout__addr-option-body { font-size: 13px; line-height: 1.7; }
.ec-checkout__addr-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; font-size: 11px; color: #555; background: #f0f0f0; border-radius: 2px; }
.ec-checkout__addr-actions { margin-top: 16px; }
.ec-checkout__addr-manage { margin-top: 12px; font-size: 12px; color: #777; }
.ec-checkout__addr-manage a { text-decoration: underline; }
.ec-checkout__addr-empty { font-size: 13px; }
/* 選択中(この注文に使う)住所のフル詳細カード。既定はこれ1件だけ表示。 */
.ec-checkout__addr-selected { padding: 14px 16px; border: 1px solid #ddd; border-radius: 3px; background: #fff; font-size: 13px; line-height: 1.7; }
.ec-checkout__addr-chooser { margin-top: 12px; }        /* 「別の住所を選ぶ」で開く選択リスト */
.ec-checkout__addr-short { color: #666; font-size: 12px; }
/* ラジオ/チェックボックスをサイトのモノトーン(墨色)に。既定の青丸はこのサイトのテイストに合わないため。 */
.ec-checkout input[type="radio"],
.ec-checkout input[type="checkbox"],
.ec-account input[type="radio"],
.ec-account input[type="checkbox"] { accent-color: #303030; }

/* お支払い方法(クレジットカード / 銀行振込)。配送先のラジオと同じ見た目に揃える。 */
.ec-checkout__method { display: flex; flex-direction: column; gap: 10px; }
.ec-checkout__method-option {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid #ddd; border-radius: 3px; cursor: pointer;
  background: #fff; transition: border-color .15s ease, background-color .15s ease;
}
.ec-checkout__method-option:hover { border-color: #999; }
.ec-checkout__method-option.is-selected { border-color: #303030; background: #fafafa; }
.ec-checkout__method-option input[type="radio"] { margin: 2px 0 0; width: 18px; height: 18px; flex: 0 0 18px; }
.ec-checkout__method-option input[type="radio"]:disabled { cursor: not-allowed; }
.ec-checkout__method-body { display: block; font-size: 13px; line-height: 1.7; }
.ec-checkout__method-title { display: block; font-weight: 600; }
.ec-checkout__method-note { display: block; margin-top: 2px; font-size: 12px; color: #777; }
.ec-checkout__card { margin-top: 16px; }

/* 確認ステップ。入力(grid)を hidden にして入れ替えで表示する。
   .ec-checkout__grid は display:grid を持つクラス指定なので、UA の [hidden]{display:none}
   では消えない(クラスセレクタのほうが強い)。確認中に入力フォームが残って編集できて
   しまうため、!important で明示的に落とす。 */
.ec-checkout__grid[hidden],
.ec-checkout__confirm[hidden] { display: none !important; }
.ec-checkout__confirm { max-width: 720px; margin: 0 auto; }
.ec-checkout__confirm-lead { margin: 8px 0 24px; font-size: 13px; line-height: 1.8; color: #555; }
.ec-checkout__confirm-list { margin: 0; border-top: 1px solid #e5e5e5; }
.ec-checkout__confirm-list dt { padding: 16px 0 6px; font-size: 12px; letter-spacing: .04em; color: #777; }
.ec-checkout__confirm-list dd {
  margin: 0; padding: 0 0 16px; border-bottom: 1px solid #e5e5e5;
  font-size: 13px; line-height: 1.8;
}
.ec-checkout__confirm-card { display: inline-block; margin-left: 8px; color: #555; font-size: 12px; letter-spacing: .06em; }

.ec-checkout__legal-notice {
  margin: 24px 0 0;
  color: #555;
  font-size: 13px;
  line-height: 1.8;
}

.ec-checkout__legal-notice a {
  color: #1c1c1c;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.ec-checkout__confirm-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
/* 再認証(403 REAUTH_REQUIRED)の案内内リンク。 */
.ec-checkout__reauth-link { text-decoration: underline; white-space: nowrap; }

/* 銀行振込の案内(注文確定後の結果画面)。 */
.ec-checkout-bank {
  margin: 24px 0 0; padding: 20px 24px; border: 1px solid #303030; background: #fafafa;
  display: grid; grid-template-columns: auto 1fr; gap: 8px 20px;
  font-size: 13px; line-height: 1.8; text-align: left;
}
.ec-checkout-bank dt { color: #777; white-space: nowrap; }
.ec-checkout-bank dd { margin: 0; font-weight: 600; }
.ec-checkout-bank__note { margin-top: 12px; font-size: 12px; line-height: 1.8; color: #777; text-align: left; }

.ec-checkout__summary-col {
  grid-area: summary;
  background: #fafafa;
  border: 1px solid #eee;
  padding: 24px;
  position: sticky;
  top: 24px;
}
.ec-checkout__lines {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.ec-checkout__line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 15px;
}
.ec-checkout__addr-label {
  display: block;
  margin-bottom: 6px;
  color: #555;
  font-size: 14px;
}
.ec-checkout__addr-select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 0;
  background: #fff;
  color: #1c1c1c;
  font-size: 16px;
  margin-bottom: 12px;
}
.ec-checkout__addr-summary {
  box-sizing: border-box;
  margin: 0 0 24px;
  padding: 14px 16px;
  border: 1px solid #e2e2e2;
  background: #fafafa;
}
.ec-checkout__addr-summary-title {
  margin: 0 0 6px;
  color: #666;
  font-size: 13px;
  font-weight: 700;
}
.ec-checkout__addr-summary address {
  margin: 0;
  font-style: normal;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.ec-checkout__card {
  margin-bottom: 24px;
}
.ec-checkout__card-el {
  min-height: 48px;
  padding: 14px 12px;
  border: 1px solid #ccc;
  background: #fff;
}
.ec-checkout__card-help {
  margin: 8px 0 0;
  color: #777;
  font-size: 13px;
  line-height: 1.6;
}
.ec-checkout__card-msg {
  margin: 8px 0 0;
  min-height: 1.2em;
  font-size: 13px;
  color: #c00;
}
.ec-checkout__summary-col .ec-cart__checkout {
  width: 100%;
  margin-top: 16px;
}
.ec-checkout__back-area {
  grid-area: back;
  display: flex;
  align-items: flex-start;
}
.ec-checkout__back {
  box-sizing: border-box;
  display: inline-flex;
  width: auto;
  min-width: 220px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid #303030;
  background: #fff;
  color: #303030;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.ec-checkout__back::before {
  content: "←";
  font-size: 16px;
}
.ec-checkout__back:hover {
  background: #303030;
  color: #fff;
}
@media (max-width: 767px) {
  .ec-cart,
  .ec-checkout {
    padding-left: 0;
    padding-right: 0;
  }

  .ec-checkout__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "details"
      "summary"
      "back";
  }
  .ec-checkout__back { width: 100%; min-width: 0; }
}
.ec-cart__msg {
  margin-top: 12px;
  min-height: 1.2em;
  color: #666;
  text-align: right;
  line-height: 1.6;
}

.ec-checkout.is-processing .ec-checkout__grid {
  pointer-events: none;
  user-select: none;
}
body.ec-checkout-is-processing {
  overflow: hidden;
}
.ec-checkout-processing[hidden] {
  display: none;
}
.ec-checkout-processing {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(2px);
}
.ec-checkout-processing__dialog {
  box-sizing: border-box;
  width: min(100%, 420px);
  padding: 36px 32px;
  border: 1px solid #303030;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .18);
  text-align: center;
}
.ec-checkout-processing__dialog:focus {
  outline: 2px solid #111;
  outline-offset: 4px;
}
.ec-checkout-processing__spinner {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto 20px;
  border: 2px solid #d4d4d4;
  border-top-color: #111;
  border-radius: 50%;
  animation: ec-checkout-spin .8s linear infinite;
}
.ec-checkout-processing__title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .04em;
}
.ec-checkout-processing__text {
  margin: 12px 0 0;
  color: #555;
  font-size: 14px;
  line-height: 1.7;
}
@keyframes ec-checkout-spin {
  to { transform: rotate(360deg); }
}

.ec-checkout-complete {
  max-width: 680px;
  padding: 56px 0 64px;
  margin: 0 auto;
  text-align: center;
}
.ec-checkout-complete:focus {
  outline: none;
}
.ec-checkout-complete__lead {
  max-width: 46em;
  margin: 20px auto 28px;
  color: #555;
  line-height: 1.8;
  font-size: 15px;
}
.ec-checkout-complete__number {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 8px 20px;
  padding: 20px 28px;
  border-top: 1px solid #303030;
  border-bottom: 1px solid #303030;
  margin: 0 auto 32px;
  text-align: left;
}
.ec-checkout-complete__number dt,
.ec-checkout-complete__number dd {
  margin: 0;
}
.ec-checkout-complete__number dt {
  color: #777;
  font-size: 13px;
}
.ec-checkout-complete__number dd {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.ec-checkout-complete__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.ec-cart a:focus-visible,
.ec-cart button:focus-visible,
.ec-cart input:focus-visible,
.ec-checkout a:focus-visible,
.ec-checkout button:focus-visible,
.ec-checkout select:focus-visible,
.ec-checkout__card-el:focus-within {
  outline: 2px solid #111;
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .ec-cart,
  .ec-checkout {
    width: 100%;
    padding: 32px 0 64px;
  }
  .ec-flow-header {
    padding-bottom: 20px;
  }
  .ec-cart__title {
    font-size: 24px;
  }
  .ec-cart__item {
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 20px 0;
  }
  .ec-cart__media {
    grid-column: 1;
    grid-row: 1;
    width: 88px;
  }
  .ec-cart__info {
    grid-column: 2 / 4;
    grid-row: 1;
  }
  .ec-cart__qty {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    min-width: 0;
  }
  .ec-cart__qty label {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .ec-cart__line-total {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: end;
  }
  .ec-cart__remove {
    grid-column: 3;
    grid-row: 2;
    align-self: center;
    justify-self: end;
  }
  .ec-cart__line-total {
    min-width: 0;
  }
  .ec-cart__summary {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
  }
  .ec-cart__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .ec-cart__actions > * {
    width: 100%;
  }
  .ec-checkout__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .ec-checkout__summary-col {
    position: static;
    padding: 20px;
  }
  .ec-checkout-complete {
    padding: 40px 0 56px;
  }
  .ec-checkout-complete__number {
    width: 100%;
  }
  .ec-checkout-complete__actions {
    flex-direction: column;
  }
  .ec-checkout-complete__actions > * {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ec-cart *,
  .ec-checkout * {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  .ec-checkout-processing__spinner {
    animation: none;
  }
}

/* ===== カートボタン(PAGE TOP と同じ #backtop 内) ＋ 追加モーダル =====
   位置・形・サイズ・色(rgba(48,48,48,.8))・fixed 化・hover(#backtop:hover{opacity:.7})は
   すべて #backtop .body a のスタイルを継承する。ここでは
   ・PAGE TOP の上に重ねる位置オフセット(fixed 時)
   ・商品0/未ログイン時とカート関連画面での非表示
   ・横長表示時の CART ラベル
   ・オレンジの個数バッジとキーボードフォーカス
   を足す。独自の移動アニメーションや背景色は持たせない。 */
.ec-cart-backtop { position: relative; }
.ec-cart-backtop[hidden] { display: none !important; }
body#cart #backtop .ec-cart-backtop,
body#checkout #backtop .ec-cart-backtop { display: none !important; }
/* fixed 化(スクロール中): PAGE TOP(bottom:20px) の上に重ねる。<1200 はバー(44px)/≥1200 は正方形(60px)。 */
#backtop.fixed .ec-cart-backtop { bottom: 63px; }
@media (min-width: 1200px) {
  #backtop.fixed .ec-cart-backtop { bottom: 88px; }
}
.ec-cart-backtop__label {
  display: none;
  font-family: 'NimbusSan-Reg', Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .14em;
}
@media (max-width: 1199px) {
  #backtop .ec-cart-backtop {
    height: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  #backtop .ec-cart-backtop .ec-cart-backtop__ic {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
  }
  .ec-cart-backtop__label { display: block; }
}
.ec-cart-backtop__count {
  box-sizing: border-box;
  position: absolute;
  top: -8px; right: -8px;
  min-width: 24px; height: 24px;
  padding: 0 5px;
  border-radius: 12px;
  background: #e8722c;       /* オレンジのアクセント(個数バッジ) */
  color: #fff;
  font-size: 12px;
  line-height: 24px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  z-index: 1;
}
.ec-cart-backtop:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

/* --- 追加モーダル --- */
.ec-add-modal {
  font-size: 15px;
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.45);
  padding: 16px;
  opacity: 0; transition: opacity .15s ease;
}
.ec-add-modal.is-open { opacity: 1; }
.ec-add-modal__dialog {
  background: #fff; color: #111;
  width: 100%; max-width: 360px;
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  transform: translateY(8px); transition: transform .15s ease;
}
.ec-add-modal.is-open .ec-add-modal__dialog { transform: translateY(0); }
.ec-add-modal__title {
  font-size: 16px; letter-spacing: 0.04em;
  margin: 0 0 14px; display: flex; align-items: center; gap: 8px;
}
.ec-add-modal__title::before { content: "✓"; color: #2e7d32; font-weight: 700; }
.ec-add-modal__item { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.ec-add-modal__thumb { flex: 0 0 64px; width: 64px; height: 64px; object-fit: cover; background: #f4f4f4; }
.ec-add-modal__name { margin: 0 0 4px; font-size: 15px; line-height: 1.4; }
.ec-add-modal__price { margin: 0; color: #333; font-variant-numeric: tabular-nums; }
.ec-add-modal__actions { display: flex; gap: 10px; }
.ec-add-modal__actions a, .ec-add-modal__actions button {
  flex: 1; min-height: 48px; padding: 11px 8px; text-align: center; font-size: 14px;
  border-radius: 4px; cursor: pointer; text-decoration: none; border: 1px solid #111;
  transition: background-color .15s ease, color .15s ease;
}
.ec-add-modal__go { background: #111; color: #fff; }          /* カートを見る */
.ec-add-modal__cont { background: #fff; color: #111; }        /* 買い物を続ける */
.ec-add-modal__go:hover,
.ec-add-modal__go:focus {
  background: #fff;
  color: #111;
}
.ec-add-modal__cont:hover,
.ec-add-modal__cont:focus-visible {
  background: #111;
  color: #fff;
}
@media (max-width: 480px) {
  .ec-add-modal__actions { flex-direction: column; }          /* 狭い端末は縦積み */
}
