/* ==================================================================
   cart.css v2.1  — カート画面 最小・安定セット（クリーン版）
   ================================================================== */

/* === 読み込み確認バッジ（不要なら削除OK） =========================== */
html body::after{
  content:"cart.css v2.1";
  position:fixed; left:10px; bottom:10px;
  padding:4px 6px; background:#000; color:#fff; z-index:999999;
  font:12px/1.2 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial;
}

/* ================================================================
 * A) ページ全体を中央寄せ（テーブルも合計も中央）
 * ================================================================ */
#air-cart-wrap .woocommerce{
  display:grid !important;
  grid-template-columns:1fr;
  grid-auto-flow:row;
  justify-items:center;         /* 子要素（表/合計）を中央 */
  row-gap:28px;
  max-width:1120px;
  margin:0 auto;
  padding:0 16px;
  box-sizing:border-box;
}

/* テーブル側コンテナ */
#air-cart-wrap .woocommerce-cart-form{
  width:100% !important;
  max-width:1040px !重要;
  margin:0 auto !important;
  float:none !important;
}

/* 合計側コンテナ */
#air-cart-wrap .cart-collaterals{
  width:100% !important;
  max-width:1040px !important;
  margin:0 auto !important;
  float:none !important;
  border:0 !important;           /* テーマが枠を付ける対策 */
  outline:0 !important;
  box-shadow:none !important;
}

/* 合計カードは少し細めで中央 */
#air-cart-wrap .cart-collaterals .cart_totals{
  width:100%;
  max-width:560px;
  margin:0 auto !important;
}

/* ================================================================
 * B) テーブル：外枠1本／内部は横線のみ（縦線なし）
 * ================================================================ */
#air-cart-wrap table.shop_table{
  width:100%;
  border-collapse:separate !important;
  border-spacing:0 !important;
  border:1px solid #E6E8EC !important;   /* ← 外枠はこの1本だけ */
  border-radius:10px;
  overflow:hidden;                        /* 角丸のはみ出し防止 */
  background:#fff;
  table-layout:fixed;                     /* 列幅指定を効かせる鍵 */
  position:relative;
}
/* 旧CSSの外枠擬似線を完全無効化（“二重枠”防止） */
#air-cart-wrap table.shop_table::before{
  content:none !important;
}

/* ヘッダー：中央寄せ＋下側だけ横線 */
#air-cart-wrap table.shop_table thead th{
  background:#f8fafc;
  font-weight:600;
  padding:12px 14px;
  text-align:center;
  vertical-align:middle;
  border-top:none !important;
  border-bottom:1px solid #E6E8EC !important;
}

/* 本文：行区切り（横線）のみ。縦線は出さない */
#air-cart-wrap table.shop_table tbody td{
  padding:16px 14px;
  vertical-align:middle;
  border-left:none !important;
  border-right:none !important;
}
#air-cart-wrap table.shop_table tbody tr + tr td{
  border-top:1px solid #F0F2F5 !important;
}
#air-cart-wrap table.shop_table tbody tr:last-child td{
  border-bottom:none !important;
}

/* 列幅・整列（見やすさ用最小指定） */
:root{
  --col-price:12ch;
  --col-qty:9ch;
  --col-subtotal:14ch;
}
#air-cart-wrap table.shop_table th.product-remove,
#air-cart-wrap table.shop_table td.product-remove{ width:44px; text-align:center; }
#air-cart-wrap table.shop_table th.product-thumbnail,
#air-cart-wrap table.shop_table td.product-thumbnail{ width:100px; }
#air-cart-wrap table.shop_table td.product-thumbnail{ text-align:center; }
#air-cart-wrap table.shop_table td.product-thumbnail a{ display:inline-block; }
#air-cart-wrap table.shop_table td.product-thumbnail img{
  width:88px; height:88px; object-fit:contain; display:inline-block;
}
#air-cart-wrap table.shop_table th.product-name{ text-align:center; }
#air-cart-wrap table.shop_table td.product-name{ text-align:left; overflow-wrap:anywhere; }

#air-cart-wrap table.shop_table th.product-price{ width:var(--col-price); text-align:center; }
#air-cart-wrap table.shop_table td.product-price{
  width:var(--col-price); text-align:left; padding-left:10px; font-variant-numeric:tabular-nums;
}
#air-cart-wrap table.shop_table th.product-quantity,
#air-cart-wrap table.shop_table td.product-quantity{ width:var(--col-qty); text-align:center; }
#air-cart-wrap table.shop_table th.product-subtotal{ width:var(--col-subtotal); text-align:center; }
#air-cart-wrap table.shop_table td.product-subtotal{
  width:var(--col-subtotal); text-align:right; padding-right:10px; font-variant-numeric:tabular-nums;
}

/* ヘッダーの文言（削除／商品画像） */
#air-cart-wrap table.shop_table thead th.product-remove,
#air-cart-wrap table.shop_table thead th.product-thumbnail{
  font-size:0; position:relative; white-space:nowrap;
}
#air-cart-wrap table.shop_table thead th.product-remove::after{
  content:"削除"; font-size:13px; color:#555; letter-spacing:.02em;
}
#air-cart-wrap table.shop_table thead th.product-thumbnail::after{
  content:"商品画像"; font-size:13px; color:#555; letter-spacing:.02em;
}

/* 数量入力 */
#air-cart-wrap .quantity input.qty{
  width:76px; height:34px;
  text-align:center;
  border:1px solid #d1d7df; border-radius:8px; box-shadow:none;
}

/* ================================================================
 * C) 「ショップに戻る」：外枠見えを除去＋ボタンをグレー＋上マージン
 * ================================================================ */
#air-cart-wrap .woocommerce-cart-form table.shop_table{ margin-bottom:10px !important; }

#air-cart-wrap .woocommerce-cart-form table.shop_table tbody td.actions{
  border-top:0 !important; border-left:0 !important; border-right:0 !important;
  background:transparent !important;
  padding-top:14px !important; padding-bottom:10px !important;
  box-shadow:none !important;
}

#air-cart-wrap .woocommerce-cart-form td.actions a.button,
#air-cart-wrap a.button.wc-backward,
#air-cart-wrap .cart-return-wrap .custom-return{
  background:#888 !important; border:0 !important; box-shadow:none !important;
  color:#fff !important; text-shadow:none !important; background-image:none !important;
  border-radius:6px !important; padding:10px 18px !important;
}
#air-cart-wrap .woocommerce-cart-form td.actions a.button:hover,
#air-cart-wrap a.button.wc-backward:hover,
#air-cart-wrap .cart-return-wrap .custom-return:hover{
  background:#666 !important;
}

/* 「ショップに戻る」コンテナも中央幅に合わせる */
#air-cart-wrap .return-to-shop{
  display:block !important;
  width:100%;
  max-width:1040px;
  margin:12px auto 0 auto !important;
  float:none !important;
}

/* ================================================================
 * D) 合計ブロック：枠線/影/擬似要素を完全OFF（見た目だけ消す）
 * ================================================================ */
#air-cart-wrap .cart_totals{
  border:0 !important; outline:0 !important; box-shadow:none !important;
  background:transparent !important;
}
#air-cart-wrap .cart_totals::before,
#air-cart-wrap .cart_totals::after{
  content:none !important; display:none !important;
}
#air-cart-wrap .cart_totals :is(table, thead, tbody, tfoot, tr, th, td){
  border:0 !important; outline:0 !important; box-shadow:none !important;
}

/* ================================================================
 * E) モバイル微調整
 * ================================================================ */
@media (max-width:767px){
  #air-cart-wrap .woocommerce{ padding:0 12px; }
  #air-cart-wrap table.shop_table{ table-layout:auto !important; }
  #air-cart-wrap .cart-collaterals .cart_totals{ max-width:100%; }
}

/* ===============================================================
   Center fix v2.1c — テーブルを確実に中央寄せ
   =============================================================== */
#air-cart-wrap .woocommerce{
  justify-items: center !important;     /* 子要素の配置を中央に固定 */
}

/* フォーム自体を中央＆最大幅に（テーマのfloat/幅指定を無効化） */
#air-cart-wrap .woocommerce-cart-form{
  width: 100% !important;
  max-width: 1040px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
  display: block !important;
}
#air-cart-wrap .woocommerce-cart-form::after{
  content:""; display:block; clear:both;   /* 内部のfloatの影響を遮断 */
}

/* テーブルも“自前で”中央寄せ（幅はフォームいっぱい） */
#air-cart-wrap .woocommerce-cart-form table.shop_table{
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
}

/* ===============================================================
   Center hard-patch v2.2 — テーブル/合計を確実にセンター配置
   （他のレイアウト指定を上書きするため全て !important 付き）
   =============================================================== */

/* 親ラッパーを縦並びのフレックスにして子要素を中央へ */
body.woocommerce-cart #air-cart-wrap .woocommerce{
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;   /* 左右中央 */
  row-gap: 28px !important;         /* テーブルと合計の間隔 */
}

/* テーブルのフォームコンテナを中央＆最大幅に */
body.woocommerce-cart #air-cart-wrap form.woocommerce-cart-form{
  width: auto !important;
  max-width: 1040px !important;
  margin: 0 auto !important;
  float: none !important;
  align-self: center !important;
  display: block !important;
}
/* テーブル本体も中央（幅はフォームいっぱい） */
body.woocommerce-cart #air-cart-wrap form.woocommerce-cart-form > table.shop_table{
  width: 100% !important;
  margin: 0 auto !important;
  float: none !important;
}

/* 合計ブロックの外側ラッパーも同じ幅で中央 */
body.woocommerce-cart #air-cart-wrap .cart-collaterals{
  width: 100% !important;
  max-width: 1040px !important;
  margin: 0 auto !important;
  float: none !important;
  align-self: center !important;
  display: block !important;
}
/* 合計カード本体は少し細めで中央 */
body.woocommerce-cart #air-cart-wrap .cart-collaterals .cart_totals{
  width: 100% !important;
  max-width: 560px !important;
  margin: 0 auto !important;
  float: none !important;
}

/* ===============================================================
   Center Final Lock v2.3 — カート全体を確実に中央寄せ
   （親ラッパーを中央にし、子幅を揃える。すべて !important で上書き）
   =============================================================== */

/* 読み込みバッジ（確認用） */
html body::after{
  content:"cart.css v2.3";
  position:fixed; left:10px; bottom:10px;
  padding:4px 6px; background:#000; color:#fff; z-index:999999; font-size:12px;
}

/* 1) カート全体のラッパーを“中央固定” */
body.woocommerce-cart #air-cart-wrap{
  max-width: 1040px !important;    /* ここがセンター幅の基準。必要なら調整 */
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
}

/* 2) 直下の2ブロック（フォーム=テーブル／合計）も親と同じ幅で中央に */
body.woocommerce-cart #air-cart-wrap > form.woocommerce-cart-form,
body.woocommerce-cart #air-cart-wrap > .cart-collaterals,
body.woocommerce-cart #air-cart-wrap > .return-to-shop{
  max-width: 1040px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
  display: block !important;
}

/* 3) テーブルは“親幅いっぱい”に（＝中央に見える） */
body.woocommerce-cart #air-cart-wrap > form.woocommerce-cart-form > table.shop_table{
  width: 100% !important;
  margin: 0 auto !important;
  float: none !important;
}

/* 4) 合計カード本体は少し細めにして“中央”へ */
body.woocommerce-cart #air-cart-wrap .cart-collaterals .cart_totals{
  width: 100% !important;
  max-width: 560px !important;      /* お好みで 360–600px 程度 */
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
}

/* ===============================================================
 * CTA Gray v2.3 — 「購入手続きに進む」ボタンをグレーに統一
 * 作用範囲：カート内の .wc-proceed-to-checkout のみ
 * =============================================================== */
#air-cart-wrap .wc-proceed-to-checkout a.checkout-button,
#air-cart-wrap .wc-proceed-to-checkout .checkout-button,
#air-cart-wrap .cart_totals .wc-proceed-to-checkout .button.checkout-button{
  background: #888 !important;
  border-color: #888 !important;
  color: #fff !important;
  text-shadow: none !important;
  background-image: none !important;
  box-shadow: none !important;
  border-radius: 8px !important;
  padding: 12px 18px !important;
}

/* ホバー時は少し濃く */
#air-cart-wrap .wc-proceed-to-checkout a.checkout-button:hover,
#air-cart-wrap .wc-proceed-to-checkout .checkout-button:hover{
  background: #666 !important;
  border-color: #666 !important;
  color: #fff !important;
}

/* ================================================================
   FIX — 角丸じゃない外枠だけ除去（内部線＆角丸ボーダーは維持）
   ================================================================ */

/* A) テーブルに付く「角丸じゃない輪郭（outline/影）」を無効化 */
#air-cart-wrap table.shop_table{
  outline: none !important;     /* ← 角丸にならない輪郭はコレ */
  box-shadow: none !important;  /* ← 影で疑似外枠を出すテーマ対策 */
}

/* B) 過去の“角丸なし”擬似外枠が残っていた場合の保険 */
#air-cart-wrap table.shop_table::before{
  content: none !important;
  border: 0 !important;
  outline: 0 !important;
}

/* C) 角丸の“本来の外枠”は明示的に残す（必要なら色だけ変更可） */
#air-cart-wrap table.shop_table{
  border: 1px solid #E6E8EC !important;  /* ← 残したい外枠（角丸） */
  border-radius: 10px !important;
  overflow: hidden !important;            /* 角丸のはみ出し防止 */
}

/* D) 内部の横線は維持（保険）。縦線は触らない */
#air-cart-wrap table.shop_table thead th{
  border-bottom: 1px solid #E6E8EC !important;
}
#air-cart-wrap table.shop_table tbody tr + tr td{
  border-top: 1px solid #F0F2F5 !important;
}

/* --- バッジ（ここから最新版に上書き） ---------------------------- */
html body::after{ content:"cart.css v2.02"; }

/* ================================================================
 * PATCH — Cart form の外枠線を完全OFF（中の table は触らない）
 * 目的：.woocommerce-cart .woocommerce-cart-form { border:1px … } を打ち消す
 * ================================================================ */
body.woocommerce-cart #air-cart-wrap form.woocommerce-cart-form{
  border: none !important;      /* ← これでフォーム外枠の線を完全OFF */
  outline: none !important;     /* 念のため */
  box-shadow: none !important;  /* 影で擬似枠を出すテーマ対策 */
}

/* ===== FINAL BADGE LOCK (force) ===== */
#air-cart-wrap::after{
  content: "cart.css v2.02" !important;   /* ← これで確実に表示 */
  position: fixed; left: 10px; bottom: 10px;
  padding: 4px 6px; background: #000; color: #fff;
  font: 12px/1.2 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial;
  z-index: 999999;
}

/* ===============================================================
 * Totals Restore v2.03 — 合計ブロックの枠線をきっちり表示
 * （レイアウトはそのまま／内部テーブルの横線も復活）
 * =============================================================== */
#air-cart-wrap .cart_totals{
  border: 1px solid #E6E8EC !important;  /* ← 枠線を戻す */
  border-radius: 12px !important;
  background: #fff !important;
  padding: 20px 22px !important;          /* 内側に余白 */
  box-shadow: none !important;            /* 影は出さない（必要なら調整） */
}

/* 見出し・内部テーブルの体裁（最小限） */
#air-cart-wrap .cart_totals h2{
  font-size: 18px; margin: 0 0 10px;
}
#air-cart-wrap .cart_totals table{
  width: 100%;
  border-collapse: collapse !important;
}
#air-cart-wrap .cart_totals th,
#air-cart-wrap .cart_totals td{
  padding: 10px 0 !important;
  border-top: 1px solid #EEF2F6 !important;  /* 行の区切り線 */
}
#air-cart-wrap .cart_totals tr:first-child th,
#air-cart-wrap .cart_totals tr:first-child td{
  border-top: none !important;
}
#air-cart-wrap .cart_totals .order-total .amount{
  color: #2b6cf6; font-weight: 700;
}

/* バッジ（任意）：読み込み確認 */
#air-cart-wrap::after{
  content:"cart.css v2.03";
  position:fixed; left:10px; bottom:10px;
  padding:4px 6px; background:#000; color:#fff; z-index:999999; font-size:12px;
}

/* ===============================================================
 * CTA fit v2.04 — 合計ボックス内の「購入手続きに進む」を枠内に収める
 * =============================================================== */
#air-cart-wrap .cart_totals .wc-proceed-to-checkout{
  margin: 14px 0 0 !important;   /* 上だけ少し余白、左右のはみ出しを防止 */
  padding: 0 !important;
  width: 100% !important;
  float: none !important;        /* テーマの float を無効化 */
  text-align: initial !important;
}

#air-cart-wrap .cart_totals .wc-proceed-to-checkout a.checkout-button,
#air-cart-wrap .cart_totals .wc-proceed-to-checkout .checkout-button{
  display: block !important;     /* ブロック要素で横幅を取り切る */
  width: 100% !important;        /* 枠内いっぱい */
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;          /* はみ出し原因の外側余白を消す */
  border-radius: 8px !important; /* 角丸はお好みで */
  /* 色設定は前のグレー化ルールが効いたままでOK */
}

/* 念のため：ボックス側の横スクロールの発生を防ぐ */
#air-cart-wrap .cart_totals{
  overflow: hidden !important;
}

/* ===============================================================
 * ▼ Totals Right Align v2.06 — 合計ブロックだけ右寄せ（PC）
 *    親を flex 化して右端に寄せる。既存の中央指定を打ち消し。
 * =============================================================== */
@media (min-width: 768px){
  body.woocommerce-cart #air-cart-wrap .cart-collaterals{
    display: flex !important;                 /* ← これが鍵 */
    justify-content: flex-end !important;     /* 右端へ */
    align-items: flex-start !important;
  }
  body.woocommerce-cart #air-cart-wrap .cart-collaterals .cart_totals{
    width: auto !important;                   /* 100% を解除 */
    max-width: 560px !important;              /* お好みで */
    margin: 0 !important;                     /* 中央寄せマージンを打消し */
    float: none !important;                   /* テーマの float を無効化 */
  }
}

/* ---------------------------------------------------------------
 * ▼ Fallback（ビルダーが display を差し替える環境向け）
 *    親をテキスト右寄せ＋子を inline-block にするもう一段の保険
 * --------------------------------------------------------------- */
@media (min-width: 768px){
  body.woocommerce-cart #air-cart-wrap .cart-collaterals{
    text-align: right !important;
  }
  body.woocommerce-cart #air-cart-wrap .cart-collaterals .cart_totals{
    display: inline-block !important;
  }
}

/* ===============================================================
 * Align Totals to Table Right v2.07
 * 目的：テーブルと合計ブロックの横位置（右端）を完全一致させる
 *  - 親 .woocommerce の余白をリセット
 *  - 直下の2ブロック（フォーム/合計）に同じ左右パディングを付与
 *  - 合計カードは右寄せ（テキストは左揃え）
 * =============================================================== */

/* --- 親の左右パディングをゼロに（子に統一して持たせる） --- */
body.woocommerce-cart #air-cart-wrap .woocommerce{
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* --- 子ブロック（テーブル/合計）に同じ横パディングを付与 --- */
@media (min-width: 768px){
  body.woocommerce-cart #air-cart-wrap > form.woocommerce-cart-form,
  body.woocommerce-cart #air-cart-wrap > .cart-collaterals{
    max-width: 1040px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 16px !important;          /* ★テーブルと合計の基準余白 */
    padding-right: 16px !important;         /* ★ここを揃えると右端が一致 */
    box-sizing: border-box !important;
  }

  /* 合計ブロックは右端へ（テキストは左揃えのまま） */
  body.woocommerce-cart #air-cart-wrap > .cart-collaterals{
    display: flex !important;
    justify-content: flex-end !important;   /* 右端へ寄せる */
    align-items: flex-start !important;
  }
  body.woocommerce-cart #air-cart-wrap > .cart-collaterals .cart_totals{
    width: auto !important;
    max-width: 560px !important;            /* お好みで */
    margin: 0 !important;                   /* 中央マージンを打消し */
    float: none !important;
    text-align: left !important;            /* テキストは左のまま */
  }
}

/* --- テーブルは親幅いっぱい（中央に見える） --- */
body.woocommerce-cart #air-cart-wrap > form.woocommerce-cart-form > table.shop_table{
  width: 100% !important;
  margin: 0 auto !important;
  float: none !important;
}