:root{
  --bg:#fff;
  --fg:#222;
  --muted:#666;
  --brand:#0ea5e9;   /* 既定のブランド色（青系） */
  --border:#e5e7eb;  /* 枠線色 */
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans JP",Roboto,"Hiragino Kaku Gothic ProN","Yu Gothic","YuGothic","Meiryo",sans-serif;
  color:var(--fg);
  background:var(--bg);
  line-height:1.7;
}

.container{width:min(1100px,92%);margin:0 auto}

.site-header{border-bottom:1px solid var(--border);background:#fff;position:sticky;top:0;z-index:20}
.site-header .brand{font-weight:700;text-decoration:none;color:#ff66cc !important;;font-size:25px}
.site-header .container{display:flex;align-items:center;justify-content:space-between;padding:12px 0}

.nav a{text-decoration:none;color:var(--fg);margin-left:16px}
.nav a:hover{color:var(--brand)}

.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:16px}
.card{border:1px solid var(--border);border-radius:12px;padding:16px}
.card img{width:100%;height:auto;border-radius:8px}

.btn{display:inline-block;padding:10px 14px;border-radius:8px;text-decoration:none;border:1px solid var(--border)}
.btn.primary{background:var(--brand);color:#fff;border-color:transparent}
.btn[disabled]{opacity:.5;pointer-events:none}

.form-row{display:grid;gap:8px;margin-bottom:14px}
.form-row label{font-size:14px;color:var(--muted)}

.input,select,textarea{width:100%;padding:10px;border-radius:8px;border:1px solid var(--border)}

.table{width:100%;border-collapse:collapse}
.table th,.table td{border-bottom:1px solid var(--border);padding:10px;text-align:left}
.table th{color:var(--muted);font-weight:500}

.price{font-weight:700}
.flash{padding:10px 12px;border-radius:8px;margin:14px 0;background:#f1f5f9}

/* ───────── カート下のボタン行 ───────── */
.footer-actions{
  display:flex;
  gap:12px;
  justify-content:flex-end;
  flex-wrap:nowrap;   /* 折り返しなし */
  margin-top:16px;
}

@media (max-width:780px){.grid{grid-template-columns:repeat(2,1fr)}}
@media (min-width:781px){.grid{grid-template-columns:repeat(4,1fr)}}

/* ───────── 送料無料の進捗バー ───────── */
.free-ship-tip{
  background:#f0fbf4;
  border:1px solid #bfe7cc;
  color:#145a32;
  padding:10px 12px;
  border-radius:8px;
  margin:10px 0 0 0;
  line-height:1.5;
}
.free-ship-tip .tip-title{font-weight:600;margin-bottom:6px;}
.free-ship-tip .tip-sub{font-size:12px;color:#2f6d45;margin-top:6px;}
.free-ship-tip .tip-sub .note-small{font-size:11px;color:var(--muted);margin-left:4px;}
.free-ship-tip .progress{height:8px;background:#e6f5ea;border-radius:999px;overflow:hidden;margin-top:2px;}
.free-ship-tip .progress .bar{height:100%;width:0%;background:#2bb673;transition:width .3s linear;}
.free-ship-tip.ok{background:#eefbf4;border-color:#a7e3be;}
.free-ship-tip .ok-badge{
  display:inline-block;
  background:#2bb673;
  color:#fff;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
}

/* ───────── フォームの読みやすさ調整 ───────── */
.form-row label{font-size:16px;color:#222;font-weight:500}
select.input{font-size:16px;padding:10px 12px;height:auto}
#btn-zip-autofill{font-size:14px;padding:8px 14px;background:var(--brand);color:#fff;border:none;border-radius:6px;}
#btn-zip-autofill:hover{background:#0284c7}
.input,select,textarea{font-size:17px;padding:12px}
.btn-order-confirm{font-size:18px;padding:14px 20px;font-weight:600}

/* ───────── テーブル調整 ───────── */
.table th.num, .table td.num { text-align:right; }
.table tfoot th, .table tfoot td { padding-top:12px; }

/* ───────── ボタンのバリエーション ───────── */
.btn.ghost{background:transparent;border-color:var(--border);color:var(--fg);}
.btn.danger{background:#fff1f2;border-color:#fecaca;color:#b91c1c;}

/* ───────── スマホ時：カート下ボタンを横3つ並びで均等配置 ───────── */
@media (max-width:640px){
  .footer-actions{
    display:flex !important;
    flex-direction:row !important;
    justify-content:space-between !important;
    align-items:stretch !important;
    gap:12px !important;
  }
  .footer-actions .btn,
  .footer-actions a.btn,
  .footer-actions button.btn{
    flex:1 1 0 !important; /* 均等伸縮 */
    width:auto !important;
    height:56px !important; /* タップしやすい高さ */
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:16px !important;
    padding:0 !important;
  }
}

/* タブレット以下：強制3カラム */
@media (max-width: 1024px){
  .footer-actions{
    display:grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap:12px !important;
    align-items:center !important;
    justify-content:space-between !important;
    flex-wrap:unset !important; /* 折り返し解除 */
  }
  .footer-actions > a.btn,
  .footer-actions > button.btn{
    width:100% !important;
    display:block !important;
    padding:12px 10px !important;
    font-size:16px !important;
    order:0 !important;
  }
}

/* PC基準の最終整形 */
.footer-actions .btn,
.footer-actions a.btn,
.footer-actions button.btn {
  flex: 0 0 auto;     /* 幅は内容に合わせる */
  width: auto;
  min-width: 120px;   /* 最低幅 */
}

/* 再掲（念のためスマホの均等伸縮を保持） */
@media (max-width: 640px) {
  .footer-actions { display: flex; justify-content: space-between; gap: 12px; }
  .footer-actions .btn,
  .footer-actions a.btn,
  .footer-actions button.btn { flex: 1 1 0; width: auto; }
}

/* 高さとタイポの統一 */
.footer-actions .btn,
.footer-actions a.btn,
.footer-actions button.btn {
  height:56px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:16px !important;
  line-height:1 !important;
  padding:0 12px !important;
}

/* PC時の配置（右寄せ・折り返し可） */
.footer-actions{
  display:flex !important;
  gap:12px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.footer-actions .btn,
.footer-actions a.btn,
.footer-actions button.btn{
  flex:0 0 auto !important;
  width:auto !important;
  min-width:140px;
}

/* スマホ：3ボタンを横並びで均等に */
@media (max-width:640px){
  .footer-actions{
    justify-content:space-between;
    flex-wrap:nowrap;
  }
  .footer-actions .btn,
  .footer-actions a.btn,
  .footer-actions button.btn{
    flex:1 1 0 !important;
    min-width:0 !important;
  }
}

/* 既定の見た目（グレー系） */
.footer-actions .btn{
  background:#fff;
  border:1px solid var(--border);
  color:var(--fg);
  -webkit-appearance:none;
  appearance:none;
  cursor:pointer;
}
.footer-actions .btn.primary{
  background:var(--brand);
  color:#fff;
  border-color:transparent;
}

/* ───────── 商品カードの数量セレクト（SP快適化） ───────── */
@media (max-width: 640px) {
  .product-form select[name="qty"] {
    font-size: 16px;
    padding: 10px 12px;
    min-height: 44px;
    line-height: 1.2;
    margin-bottom: 10px;
    box-sizing: border-box;
  }
}
.product-form .btn.primary {
  white-space: nowrap;
  font-size: 16px;
  padding: 10px 12px;
  min-height: 44px;
  line-height: 1.2;
  box-sizing: border-box;
}

/* SP: カード内の数量セレクト微調整 */
@media (max-width: 640px){
  .product-form select[name="qty"] {
    font-size: 16px;
    padding: 12px;       /* つかみやすい */
    min-height: 44px;    /* iPhone推奨 */
    line-height: 1.3;
    width: 90px;         /* 幅固定 */
    box-sizing: border-box;
  }
}

/* PC: カード内数量セレクトの余白 */
@media (min-width: 641px) {
  .card select[name="qty"] {
    margin-bottom: 10px;
  }
}

/* 在庫わずかバッジ */
.low-stock-badge{
  display:inline-block;
  margin:6px 0;
  padding:2px 8px;
  border-radius:999px;
  background:#fff7e6;
  border:1px solid #f59e0b;
  color:#92400e;
  font-size:12px;
  font-weight:600;
  line-height:1.4;
}

/* Soldout ボタン（旧：グレー） */
.btn.soldout { background:#e5e7eb; color:#333; font-weight:600; border:1px solid #ccc; }

/* Soldout ボタン（最終デザイン） */
.btn.soldout{
  background:#ffe4e6;
  border-color:#fca5a5;
  color:#b91c1c;
  font-size:16px;
  font-weight:700;
  padding:12px 18px;
  border-radius:8px;
  cursor:not-allowed;
}

/* --- カートに追加後のフラッシュ通知 --- */
.flash{
  background:#e8fff0;
  border:1px solid #9ad5b5;
  color:#145a32;
  padding:10px 12px;
  margin:8px 0;
  border-radius:8px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.flash-text{ font-weight:600; }
.flash-actions{
  margin-left:auto;
  display:flex;
  gap:12px;
}
@media (max-width:640px){
  .flash{ flex-direction:column; align-items:stretch; }
  .flash-actions{
    width:100%; display:flex !important; flex-direction:row !important;
    gap:8px; margin-left:0 !important; flex-wrap:nowrap;
  }
  .flash-actions .btn{ flex:1 1 0 !important; width:auto !important; text-align:center; white-space:nowrap; }
}

/* 商品一覧（1列→PCで2列） */
.products-list-1col {
  grid-template-columns: 1fr;
  margin-top: 24px; /* ★追加：見出し削除後の余白 */
}
@media (min-width: 981px){
  .products-list-1col {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 商品画像（一覧カード） */
.products-list-1col .product-thumb{
  width:200px;
  height:auto;
  display:block;
  margin:0 auto 12px auto;
  border-radius:8px;
}

/* 商品詳細（PC2カラム） */
@media (min-width: 781px){
  .product-detail{
    display:grid;
    grid-template-columns:320px 1fr;
    gap:32px;
    align-items:start;
  }
  .product-media{ text-align:center; }
  .product-hero{
    max-width:300px;
    height:auto;
    border-radius:8px;
    object-fit:contain;
    display:inline-block;
  }
  .product-info{ padding-top:4px; }
}

/* 商品詳細：右カラムの見出し等 */
@media (min-width: 781px){
  .product-info h1{ font-size:20px !important; margin-bottom:12px !important; }
  .card.product-info{ padding-bottom:48px !important; }
}
.product-info .price{ font-size:18px !important; margin-bottom:18px !important; font-weight:600; }
.low-stock-badge{ margin:4px 0 12px; }
.card.product-media{ padding-top:12px; padding-bottom:12px; }
.product-info{ line-height:1.8; }

/* 商品詳細：購入ボタンの下マージン */
.product-detail .product-info .btn.primary{ margin-bottom:28px !important; }
@media (max-width: 640px){
  .product-detail .product-info .btn.primary{ margin-bottom:32px !important; }
}

/* 「カートに入れる」緑ボタン（商品カード/詳細） */
.product-form .btn.primary{
  background:#27c527 !important;
  border-color:#27c527 !important;
  color:#fff !important;
  font-weight:600;
  box-shadow:0 2px 4px rgba(0,0,0,0.2);
}
.product-form .btn.primary:hover{ background:#22a822 !important; }
.product-form .btn.primary:active{ background:#1e901e !important; }

/* 数量セレクトの幅・見栄え */
.qty-select{
  width:68px;
  text-align-last:center;
  font-size:16px;
  padding:4px;
}

/* （デバッグ用）カード枠の強調 — 必要なければ削除 */
.card { border: 1px solid #ff69b4 !important; }

/* ───────── ここから追加：レジへ進むボタンを緑に合わせる ───────── */
/* カート画面の右端ボタン（最後の .btn.primary = 「レジへ進む」）を「カートに入れる」と同じ色に */
.footer-actions .btn.primary:last-child{
  background:#27c527 !important;
  border-color:#27c527 !important;
  color:#fff !important;
  box-shadow:0 2px 4px rgba(0,0,0,0.2) !important;
}
.footer-actions .btn.primary:last-child:hover{ background:#22a822 !important; }
.footer-actions .btn.primary:last-child:active{ background:#1e901e !important; }
/* ───────── 追加ここまで ───────── */

/* === SP(～640px) の「レジへ進む」をカートと同じ緑に強制統一 === */
@media (max-width: 640px){
  .footer-actions .btn.primary,
  .footer-actions a.btn.primary,
  .footer-actions button.btn.primary{
    background:#27c527 !important;  /* 同じ緑 */
    border-color:#27c527 !important;
    color:#fff !important;
    box-shadow:0 2px 4px rgba(0,0,0,0.2) !important;
  }
  .footer-actions .btn.primary:hover,
  .footer-actions a.btn.primary:hover,
  .footer-actions button.btn.primary:hover{
    background:#22a822 !important;
  }
  .footer-actions .btn.primary:active,
  .footer-actions a.btn.primary:active,
  .footer-actions button.btn.primary:active{
    background:#1e901e !important;
  }
}

/* 商品詳細の「カートに入れる」ボタン下に余白を追加 */
.product-form .btn.primary {
  margin-bottom: 32px !important;  /* 好みに応じて 40px や 48px でもOK */
}

/* 画像保存ガード */
img {
  -webkit-touch-callout: none; /* iOS Safari 長押しメニュー無効 */
  -webkit-user-drag: none;     /* ドラッグ禁止 */
  user-select: none;           /* 選択禁止 */
}

/* ご注文手続きページ 見出しサイズ調整 */
.page-title-checkout {
  font-size: 22px !important;  /* ← 少し大きめに（元が25pxくらいだった想定） */
  line-height: 1.5;
  font-weight: 600;
  margin: 10px 0 14px;
}
}

/* ご注文手続きページ：フッターボタン下の余白 */
.footer-actions {
  margin-bottom: 32px !important;  /* お好みで20〜40pxに調整可 */
}

/* ご注文手続きページのフッターボタン下余白を強制 */
main .footer-actions {
  margin-bottom: 40px !important;  /* 数値は調整可 */
}

/* ───── お知らせボックス（商品一覧の上） ───── */
.shop-notice{
  margin: 18px 0 16px;
  padding: 14px 16px;
  background: linear-gradient(#f9fafb, #ffffff);
  border: 1px solid var(--border);
  border-radius: 12px;
  line-height: 1.6;
  color: #333;
  font-size: 14px;        /* ←フォントはここで調整 */
}
.shop-notice p{ margin: 0 0 10px; }
.shop-notice .em-red{ color:#d90429; font-weight:700; }
.shop-notice .notice-link{
  color:#7c3aed;           /* 紫 */
  font-weight:700;
  text-decoration:none;
  border-bottom:1px dashed currentColor;
}
.shop-notice .notice-link:hover{ text-decoration:underline; }

.c-red   { color:#d32f2f; }
.c-blue  { color:#1976d2; }
.c-green { color:#00cc7e; }
.c-pink  { color:#ff66cc; }

/* 説明文：サイズ指定 */
.sz-lg { font-size: 18px; line-height: 1.8; }
.sz-sm { font-size: 13px; line-height: 1.8; }

/* カートページの商品テーブルだけ余白を上に入れる */
.cart-table {
  margin-top: 24px;  /* お好みで 20px～40px に調整可 */
}