/* =========================================
   site.css (global)
   - Always light theme (white base)
   - Non-destructive: avoid overriding Bootstrap core classes
   - Provide utility tokens + optional UI helpers
   ========================================= */

/* Force light mode regardless of OS preference */
:root{ color-scheme: light; }

/* Design tokens (light) */
:root{
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-contrast: #ffffff;
  --success: #059669;
  --danger: #dc2626;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 2px 6px rgba(0,0,0,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Base */
*{ box-sizing: border-box; }
html, body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a{ color: var(--primary); text-decoration: none; }

/* Optional page container (use .page-container wrapper when必要) */
.page-container{ max-width: 1080px; margin: 0 auto; padding: 24px 16px; }

/* Messages (Django messages) */
.messages{ margin:12px 0; display:grid; gap:8px; }
.message{
  padding:10px 12px; border-radius: 10px; border:1px solid var(--border);
  background: var(--surface);
}
.message.success{ background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.25); }
.message.error{   background: rgba(239,68,68,.12);  border-color: rgba(239,68,68,.25); }
.message.info{    background: rgba(37,99,235,.10);  border-color: rgba(37,99,235,.25); }

/* Toolbar / breadcrumb */
.toolbar{ display:flex; justify-content:space-between; align-items:center; margin:12px 0 16px; }

/* パンくず：ヘッダーとの間に余白をつける */
.breadcrumb {
  display: block;
  margin-top: 16px;   /* ← ここで上の余白を調整（お好みで 12–24px） */
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: #666;
}

.breadcrumb a {
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}
.spacer{ flex:1; }


/* Form layout */
.form-grid{
  display:grid;
  gap:12px;
  grid-template-columns:1fr;
}
@media (min-width:860px){
  .form-grid{ grid-template-columns: 1fr 1fr; }
}

.field{
  display:flex;
  flex-direction:column;
  gap:.35rem;
}
.field label{ font-weight:700; color:#374151; }
.field .help{ color:#6b7280; font-size:.85rem; }

.is-invalid{
  border-color:#ef4444 !important;
  box-shadow:0 0 0 2px rgba(239,68,68,.10);
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.4rem;
  padding:.6rem .9rem;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#fff;
  font-weight:800;
  color:#111827;
  cursor:pointer;
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover{ background:#f9fafb; }
.btn--primary{ background:#111827; border-color:#111827; color:#fff; }
.btn--primary:hover{ background:#0f172a; }
.btn--ghost{ background:#f8fafc; }
.btn--danger{ background:#fef2f2; border-color:#fecaca; color:#991b1b; }
.btn--sm{ padding:.45rem .7rem; border-radius:10px; }
.btn--xs{ padding:.35rem .55rem; font-size:.9rem; border-radius:10px; }

/* Bootstrap outline と併用するなら、hover/active/focusの色も固定する */
.btn.btn-outline-secondary:hover,
.btn.btn-outline-secondary:focus,
.btn.btn-outline-secondary:active{
  color:#111827;
  background:#f9fafb;
  border-color:#e5e7eb;
}

.btn.btn-outline-danger:hover,
.btn.btn-outline-danger:focus,
.btn.btn-outline-danger:active{
  color:#991b1b;
  background:#fef2f2;
  border-color:#fecaca;
}

/* ===== compact actions (right aligned) ===== */
.form-actions{
  display: flex;
  justify-content: flex-end; /* ★右寄せ */
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;           /* 画面が狭いと折り返す */
  margin-top: 14px;
}

/* ボタンを小さく（a / button 両対応） */
.form-actions .op-btn{
  width: auto;               /* ★幅は内容に合わせる */
  height: 34px;              /* ★小さめ */
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

/* さらに狭い端末でちょい詰め */
@media (max-width: 420px){
  .form-actions{ gap: 8px; }
  .form-actions .op-btn{
    height: 32px;
    padding: 0 16px;
    font-size: 12.5px;
  }
}

/* =========================
   Modern checkbox (site-color friendly)
   Usage:
   <label class="checkbox">
     <input type="checkbox" ...>
     <span>必須</span>
   </label>
   ========================= */

.checkbox{
  display: inline-flex;
  align-items: center;
  gap: .7rem;

  cursor: pointer;
  user-select: none;
  line-height: 1.2;

  font-weight: 650;
  color: var(--site-text);
}

/* チェック本体 */
.checkbox input[type="checkbox"]{
  -webkit-appearance: none;
  appearance: none;

  width: 24px;                 /* ★大きめ */
  height: 24px;                /* ★大きめ */
  margin: 0;

  border-radius: 8px;          /* 角を少し丸めて今っぽく */
  border: 1.5px solid var(--site-border);
  background: #fff;

  display: inline-grid;
  place-content: center;

  box-shadow:
    0 1px 0 rgba(17,24,39,.04),
    0 0 0 0 rgba(0,0,0,0);

  transition:
    background-color .16s ease,
    border-color .16s ease,
    box-shadow .16s ease,
    transform .08s ease;
}

/* hover */
.checkbox:hover input[type="checkbox"]{
  border-color: color-mix(in srgb, var(--site-accent) 35%, var(--site-border));
  box-shadow:
    0 2px 10px rgba(17,24,39,.06),
    0 0 0 3px var(--site-accent-weak);
}

/* check mark (SVG風にキレイな線) */
.checkbox input[type="checkbox"]::before{
  content: "";
  width: 12px;
  height: 7px;

  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  border-radius: 1px;

  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform .14s ease;
}

/* checked */
.checkbox input[type="checkbox"]:checked{
  background: var(--site-accent);
  border-color: var(--site-accent);
  box-shadow:
    0 6px 16px color-mix(in srgb, var(--site-accent) 22%, transparent),
    0 0 0 4px var(--site-accent-weak);
}

.checkbox input[type="checkbox"]:checked::before{
  transform: rotate(-45deg) scale(1);
}

/* focus (keyboard) */
.checkbox input[type="checkbox"]:focus-visible{
  outline: none;
  box-shadow:
    0 6px 16px color-mix(in srgb, var(--site-accent) 22%, transparent),
    0 0 0 5px var(--site-accent-weak);
}

/* pressed */
.checkbox:active input[type="checkbox"]{
  transform: translateY(1px) scale(.98);
}

/* disabled */
.checkbox input[type="checkbox"]:disabled{
  cursor: not-allowed;
  opacity: .55;
  box-shadow: none;
}

.checkbox input[type="checkbox"]:disabled ~ span{
  color: var(--site-muted);
}

/* 任意: ラベルテキストの整え */
.checkbox > span{
  display: inline-block;
  letter-spacing: .01em;
}

/* form */
.help {
  font-size: .8rem;
  color: #6b7280;
}

.form-group label {
  font-size: .9rem;
}

.errorlist {
  color: #dc2626;
  list-style: none;
  font-size: .9rem;
  padding-left: 0!important;
}

/* checkbox */
/* =========================
   withcafe checkbox (match screenshot palette)
   Usage:
   <label class="checkbox">
     <input type="checkbox" ...>
     <span>テイクアウト可</span>
   </label>
   ========================= */

:root{
  /* 添付UIから拾った系（だいたいこの辺） */
  --wc-taupe: #C3B5A5;      /* ボタン枠/文字っぽい色 */
  --wc-taupe-2: #E2D8CC;    /* さらに薄い枠 */
  --wc-line: #D9D1C7;       /* 罫線 */
  --wc-ink: #333333;        /* 黒テキスト */
  --wc-blue: #2762E5;       /* リンク青（必要なら） */
}

.checkbox{
  display: inline-flex;
  align-items: center;
  gap: 12px;

  cursor: pointer;
  user-select: none;

  font-weight: 500;
  line-height: 1.3;
}

/* checkbox 本体 */
.checkbox input[type="checkbox"]{
  -webkit-appearance: none;
  appearance: none;

  width: 28px;               /* ★大きめ */
  height: 28px;              /* ★大きめ */
  margin: 0;

  border-radius: 6px;       /* 角丸（カードUIに馴染む） */
  border: 2px solid var(--wc-line);
  background: #fff;

  display: grid;
  place-content: center;

  box-shadow:
    0 1px 0 rgba(0,0,0,.03),
    0 0 0 0 rgba(0,0,0,0);

  transition:
    border-color .16s ease,
    background-color .16s ease,
    box-shadow .16s ease,
    transform .08s ease;
}

/* ホバー時：枠だけ少しだけ “taupe” に寄せる */
.checkbox:hover input[type="checkbox"]{
  border-color: var(--wc-taupe);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--wc-taupe) 18%, transparent);
}

/* チェックマーク（線が綺麗なタイプ） */
.checkbox input[type="checkbox"]::before{
  content: "";
  width: 12px;
  height: 7px;

  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  border-radius: 1px;

  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform .14s ease;
}

/* checked：taupe をベースに “薄い立体感” */
.checkbox input[type="checkbox"]:checked{
  border-color: var(--wc-taupe);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--wc-taupe) 92%, #ffffff) 0%,
    var(--wc-taupe) 100%
  );
  box-shadow:
    0 8px 18px color-mix(in srgb, var(--wc-taupe) 26%, transparent),
    0 0 0 4px color-mix(in srgb, var(--wc-taupe) 18%, transparent);
}

.checkbox input[type="checkbox"]:checked::before{
  transform: rotate(-45deg) scale(1);
}

/* キーボードフォーカス：上品に */
.checkbox input[type="checkbox"]:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--wc-taupe) 22%, transparent);
}

/* クリック感 */
.checkbox:active input[type="checkbox"]{
  transform: translateY(1px) scale(.98);
}

/* disabled */
.checkbox input[type="checkbox"]:disabled{
  cursor: not-allowed;
  opacity: .55;
  border-color: var(--wc-taupe-2);
  box-shadow: none;
}
.checkbox input[type="checkbox"]:disabled ~ span{
  opacity: .65;
}

/* ラベル文字（微調整） */
.checkbox > span{
  letter-spacing: .01em;
}

/* ===== Ring + Dot Radio (border & dot: #D9D1C7) ===== */
.radio{
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  cursor: pointer;
  user-select: none;
  line-height: 1.2;
  font-weight: 650;
  color: var(--site-text);
  margin-right: 20px;
}

/* 本体 */
.radio input[type="radio"]{
  -webkit-appearance: none;
  appearance: none;

  width: 24px;
  height: 24px;
  margin: 0;

  border-radius: 999px;
  border: 2px solid #D9D1C7;  /* 枠線 */
  background: #fff;

  display: inline-grid;
  place-content: center;

  box-shadow:
    0 1px 0 rgba(17,24,39,.04),
    0 0 0 0 rgba(217,209,199,0);

  transition:
    border-color .16s ease,
    box-shadow .16s ease,
    transform .08s ease;
}

/* hover：枠線は固定のまま、影とリングだけ出す */
.radio:hover input[type="radio"]{
  border-color: #D9D1C7;
  box-shadow:
    0 2px 10px rgba(17,24,39,.06),
    0 0 0 3px rgba(217,209,199,.35); /* ←薄いリング（#D9D1C7系） */
}

/* 真ん中のドット */
.radio input[type="radio"]::before{
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;

  background: #D9D1C7;        /* ドット色 */
  transform: scale(0);
  transition: transform .14s ease;
}

/* checked */
.radio input[type="radio"]:checked::before{
  transform: scale(1);
}

/* focus (keyboard) */
.radio input[type="radio"]:focus-visible{
  outline: none;
  box-shadow:
    0 2px 10px rgba(17,24,39,.06),
    0 0 0 5px rgba(217,209,199,.45);
}

/* pressed */
.radio:active input[type="radio"]{
  transform: translateY(1px) scale(.98);
}

/* disabled */
.radio input[type="radio"]:disabled{
  cursor: not-allowed;
  opacity: .55;
  box-shadow: none;
}
.radio input[type="radio"]:disabled ~ span{
  color: var(--site-muted);
}

/* ラベルテキスト */
.radio > span{
  display: inline-block;
  letter-spacing: .01em;
}


/* =========================
   Compact image uploader (cardvalue-like)
   ========================= */

.img-uploader{
  display: flex;
  align-items: flex-start;
  gap: 18px;

  padding: 16px 18px;
  border-radius: 8px;

  border: 1px solid rgba(17,24,39,.10);
  background: #fff;
  box-shadow: 0 10px 26px rgba(17,24,39,.06);
}

.img-uploader__preview{
  width: 92px;
  height: 92px;
  border-radius: 8px;

  border: 1px solid rgba(17,24,39,.12);
  background: rgba(17,24,39,.03);

  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.img-uploader__preview img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 右側 */
.img-uploader__body{
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
}

.img-uploader__meta{
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.img-uploader__title{
  font-weight: 800;
  color: rgba(17,24,39,.90);
}

.img-uploader__remove{
  white-space: nowrap;
}

/* アクション */
.img-uploader__actions{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.img-uploader__pick{
  position: relative;
  overflow: hidden;
}

.img-uploader__pick input[type="file"]{
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.img-uploader__filename{
  color: rgba(17,24,39,.55);
  font-weight: 600;
  font-size: 13px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.img-uploader__hint{
  margin-top: 8px;
  font-size: 12px;
}

/* =========================
   Image uploader - mobile compact
   ========================= */

/* 既存 .img-uploader がある前提（前に渡したやつ） */

/* スマホでは “必ず横並び” にして縦長を解消 */
@media (max-width: 560px){
  .img-uploader{
    flex-direction: row;          /* ★縦積み禁止 */
    align-items: center;
    gap: 12px;

    padding: 12px 12px;
    border-radius: 14px;
  }

  .img-uploader__preview{
    width: 72px;                  /* ★小さめ */
    height: 72px;
    border-radius: 14px;
    flex: 0 0 auto;
  }

  .img-uploader__body{
    flex: 1 1 auto;
    min-width: 0;
  }

  /* タイトル + 削除チェックを横に詰める */
  .img-uploader__meta{
    margin-bottom: 6px;
    gap: 10px;
  }

  .img-uploader__title{
    font-size: 13px;              /* ★小さめ */
    font-weight: 800;
  }

  /* 操作は “ボタン + ファイル名” を1段に収めやすく */
  .img-uploader__actions{
    gap: 10px;
    flex-wrap: nowrap;            /* ★基本1行 */
  }

  .img-uploader__filename{
    font-size: 12px;              /* ★小さめ */
    max-width: 40vw;              /* 長い名前は省略 */
  }

  /* 削除チェックはテキスト小さく */
  .img-uploader__remove{
    font-size: 12px;
  }

  /* 説明文（hint）を小さく＆余白も詰める */
  .img-uploader__hint,
  .img-uploader .hint{
    font-size: 11.5px;            /* ★小さめ */
    line-height: 1.4;
    margin-top: 6px;
  }

  /* op-btn がデカい場合の縮小 */
  .img-uploader__pick.op-btn{
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
  }

  /* checkbox も少し縮小（前に作った大きめ対策） */
  .img-uploader .checkbox input[type="checkbox"]{
    width: 20px;
    height: 20px;
    border-radius: 8px;
  }
}


/* =========================
   Compact wc-toast
   ========================= */

.wc-toast-stack{
  position: fixed;
  top: calc(55px + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;

  width: min(520px, calc(100vw - 18px)); /* ★横幅を小さく */
  display: grid;
  gap: 8px;

  pointer-events: none;
}

.wc-toast{
  pointer-events: auto;

  display: flex;
  align-items: center;

  padding: 10px 12px;           /* ★縦幅を小さく */
  border-radius: 8px;

  background: rgba(250, 249, 248, 0.92);
  border: 1px solid rgba(17,24,39,.14);
  box-shadow: 0 10px 26px rgba(17,24,39,.12);

  color: rgba(17,24,39,.92);
  font-weight: 650;
  font-size: 13px;              /* ★文字も少し小さく */
  line-height: 1.35;

  animation: wc-toast-in .16s ease both;
}

@keyframes wc-toast-in{
  from{ opacity: 0; transform: translateY(-6px); }
  to  { opacity: 1; transform: translateY(0); }
}

/* 長文は2行まで＋省略（邪魔にならない） */
.wc-toast__body{
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* success：薄いグリーン（目立つけど濃すぎない） */
.wc-toast--success{
  background: rgba(236, 253, 245, 0.8);
  color: rgba(6, 95, 70, 0.96);
}

/* info：薄いブルー（withcafeの雰囲気に合う） */
.wc-toast--info{
  background: rgba(239, 246, 255, 0.8);
  color: rgba(30, 64, 175, 0.96);
}

/* warning：薄いアンバー（強すぎない注意色） */
.wc-toast--warning{
  background: rgba(255, 251, 235, 0.8);
  color: rgba(146, 64, 14, 0.96);
}

/* error：薄いレッド（ピンク寄りで濃すぎない） */
.wc-toast--error{
  background: rgba(254, 242, 242, 0.8);
  color: rgba(153, 27, 27, 0.96);
}

/* 消えるアニメ */
.wc-toast.is-hiding{
  animation: wc-toast-out .20s ease both;
}

@keyframes wc-toast-out{
  to{ opacity: 0.5; transform: translateY(-6px); }
}

/* =========================
   Action buttons
   ========================= */

/* ボタン本体（a / button 両対応） */
.op-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  width: 100%;               /* ★列幅に揃える */
  height: 38px;              /* 少しだけ押しやすく */
  padding: 0 14px;

  border: 1px solid #c3b5a5;
  border-radius: 10px;

  background: #fff;
  color: #7a6a56;

  font-size: 13px;
  font-weight: 600;
  text-decoration: none;

  transition: background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
  word-break: keep-all;

  -webkit-tap-highlight-color: transparent;
}

.op-btn:hover{
  background: #c3b5a5;
  color: #fff;
}

.op-btn:focus-visible{
  outline: 2px solid rgba(195, 181, 165, .7);
  outline-offset: 2px;
}

.op-btn:disabled{
  opacity: .55;
  cursor: not-allowed;
}

/* 控えめ（リンク系） */
.op-btn.is-ghost{
  background: #faf9f8;
  border-color: #e2d8cc;
  color: #7a6a56;
}
.op-btn.is-ghost:hover{
  background: #eee8e1;
  border-color: #c3b5a5;
  color: #7a6a56;
}

/* 破壊的（キャンセルを目立たせたい場合） */
.op-btn.is-danger{
  border-color: #e8b8b8;
  background: #fff;
  color: #b14b4b;
}
.op-btn.is-danger:hover{
  background: #b14b4b;
  color: #fff;
  border-color: #b14b4b;
}

/* =========================
   wc-fold (details/summary)
   ========================= */

.wc-fold{
  border: 1px solid rgba(17,24,39,.10);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.wc-fold__summary{
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;         /* ★少しコンパクト */
  cursor: pointer;
  user-select: none;

  background: #faf9f8;        /* withcafeトーン */
  color: rgba(17,24,39,.88);
}

.wc-fold__summary:hover{
  background: #f3efea;
}

.wc-fold__title{
  font-size: 13px;            /* ★小さめ */
  font-weight: 650;
}

.wc-fold__meta{
  margin-left: auto;
  font-size: 12px;
  color: rgba(17,24,39,.55);
  white-space: nowrap;
}

/* 標準マーカー消す */
.wc-fold__summary::-webkit-details-marker{ display:none; }
.wc-fold__summary::marker{ content:""; }

/* シェブロン（CSSのみ） */
.wc-fold__chev{
  width: 18px;
  height: 18px;
  border-radius: 8px;
  position: relative;
  flex: 0 0 18px;
}
.wc-fold__chev::before{
  content:"";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(17,24,39,.45);
  border-bottom: 2px solid rgba(17,24,39,.45);
  transform: rotate(45deg);          /* ▼ */
  transition: transform .16s ease;
}

/* open時に回転 */
.wc-fold[open] .wc-fold__chev::before{
  transform: rotate(-135deg);        /* ▲ */
}

.wc-fold__body{
  padding: 10px 12px 12px;
  background: #fff;
}

/* =========================
   mini table (compact)
   ========================= */

.wc-mini-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;                 /* ★小さめ */
}

.wc-mini-table__th{
  text-align: left;
  padding: 8px 6px;
  color: rgba(17,24,39,.65);
  font-weight: 650;
  border-bottom: 1px solid rgba(17,24,39,.10);
}

.wc-mini-table__th--num{
  text-align: right;
  width: 88px;
}

.wc-mini-table__tr + .wc-mini-table__tr .wc-mini-table__td{
  border-top: 1px solid rgba(17,24,39,.08);
}

.wc-mini-table__td{
  padding: 9px 6px;
  vertical-align: middle;
}

.wc-mini-table__td--num{
  text-align: right;
}

.wc-mini-table__link{
  color: #2b6de8;
  text-decoration: none;
}
.wc-mini-table__link:hover{
  text-decoration: underline;
}

.wc-mini-table__pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #faf9f8;
  border: 1px solid rgba(17,24,39,.10);
  color: rgba(17,24,39,.78);
  font-weight: 650;
}
