/* 資材マーケット
   サービス色は Green #15803d（中古=Blue / 共同購入=Teal / お困り相談=Indigo と区別する）。
   面（帯）とバッジにだけ出し、本文・CTA には出さない。 */

:root {
  --clr-material: #15803d;
  --clr-material-dark: #14532d;
  --clr-material-soft: #f0fdf4;
}

/* ヒーロー帯（app.css の .page-hero を資材色で上書き） */
.page-hero--material {
  background: linear-gradient(100deg, var(--clr-material-dark) 0%, var(--clr-material) 58%, #22a355 100%);
}

/* ---- フィルタ ---- */
.mt-filter {
  background: #f6f7f9;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 26px;
}
.mt-filter__label {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: #64748b;
}
.mt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mt-chip {
  display: inline-block;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #d7dbe0;
  border-radius: 20px;
  font-size: 0.88rem;
  color: #334155;
  text-decoration: none;
}
.mt-chip:hover { background: var(--clr-material-soft); border-color: var(--clr-material); }
.mt-chip.is-active { background: var(--clr-material); border-color: var(--clr-material); color: #fff; }
.mt-chip i { margin-right: 5px; }

.mt-search { display: flex; gap: 10px; }
.mt-search input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #d7dbe0;
  border-radius: 6px;
  font-size: 1em;
}

/* ---- 商品カード ---- */
.mt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 20px;
}
.mt-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s, border-color 0.18s;
}
.mt-card:hover { box-shadow: 0 6px 20px rgba(15, 23, 42, 0.09); border-color: #cbd5e1; }
/* 価格注記の有無でカード丈が揃わなくなるので、本文を伸ばしてフッターを底に落とす */
.mt-card > a { text-decoration: none; color: inherit; display: flex; flex-direction: column; flex: 1; }
.mt-card__body { flex: 1; display: flex; flex-direction: column; }
.mt-card__price, .mt-card__price--locked { margin-top: auto; }
.mt-card__thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f1f5f9;
  display: block;
}
.mt-card__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 2.4rem;
}
.mt-card__body { padding: 14px 16px 12px; }
.mt-card__cat {
  font-size: 0.74rem;
  color: var(--clr-material);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 5px;
}
.mt-card__title {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.45;
  color: #0f172a;
  margin-bottom: 6px;
}
.mt-card__model {
  font-size: 0.78rem;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-bottom: 8px;
}
.mt-card__unit {
  display: inline-block;
  background: var(--clr-material-soft);
  color: var(--clr-material-dark);
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.mt-card__price {
  font-size: 1.06rem;
  font-weight: 700;
  color: #0f172a;
}
.mt-card__price small { font-size: 0.72rem; font-weight: 400; color: #64748b; margin-left: 4px; }
.mt-card__price--locked {
  font-size: 0.84rem;
  font-weight: 600;
  color: #94a3b8;
}
.mt-card__price--locked i { margin-right: 5px; }
.mt-card__footer {
  border-top: 1px solid #f1f5f9;
  padding: 9px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: #94a3b8;
}
.mt-card__supplier { color: #64748b; }

/* ---- 詳細 ---- */
.mt-detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 34px; }
.mt-detail__media img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}
.mt-detail__media .mt-card__thumb--empty {
  aspect-ratio: 4 / 3;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.mt-detail__title { font-size: 1.5rem; line-height: 1.4; margin: 6px 0 10px; }
.mt-detail__model {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  color: #475569;
  margin-bottom: 16px;
}
.mt-spec { width: 100%; border-collapse: collapse; margin: 16px 0 22px; font-size: 0.9rem; }
.mt-spec th, .mt-spec td { border-bottom: 1px solid #eef1f4; padding: 9px 4px; text-align: left; vertical-align: top; }
.mt-spec th { width: 34%; color: #64748b; font-weight: 500; }

/* 会員限定ブロック */
.mt-gate {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  background: #fff;
}
.mt-gate--locked { background: #f8fafc; border-style: dashed; text-align: center; }
.mt-gate__price { font-size: 1.7rem; font-weight: 700; color: #0f172a; }
.mt-gate__price small { font-size: 0.76rem; font-weight: 400; color: #64748b; margin-left: 6px; }
.mt-gate__blur {
  font-size: 1.7rem;
  font-weight: 700;
  color: #0f172a;
  filter: blur(7px);
  user-select: none;
  margin-bottom: 12px;
}
.mt-gate__note { font-size: 0.84rem; color: #64748b; margin: 10px 0 16px; }
.mt-gate__actions { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.mt-gate__actions .btn { width: 100%; text-align: center; }
.mt-btn-primary {
  display: inline-block;
  background: var(--clr-material);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 18px;
  font-size: 0.96rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.mt-btn-primary:hover { background: var(--clr-material-dark); color: #fff; }
.mt-btn-outline {
  display: inline-block;
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 11px 18px;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
}
.mt-btn-outline:hover { background: #f8fafc; }

.mt-flow {
  background: #f8fafc;
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 18px;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.85;
}
.mt-flow strong { color: #0f172a; }

.mt-empty { text-align: center; padding: 60px 20px; color: #94a3b8; }
.mt-empty i { font-size: 2.6rem; margin-bottom: 12px; display: block; }

/* ---- 供給者ダッシュボード ---- */
.mt-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.mt-kpi {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 18px;
}
.mt-kpi__label { font-size: 0.78rem; color: #64748b; margin-bottom: 6px; }
.mt-kpi__value { font-size: 1.62rem; font-weight: 700; color: #0f172a; line-height: 1.2; }
.mt-kpi__value small { font-size: 0.8rem; font-weight: 500; color: #64748b; margin-left: 3px; }
.mt-kpi__sub { font-size: 0.74rem; color: #94a3b8; margin-top: 5px; }
.mt-kpi--accent { border-color: #bbf7d0; background: var(--clr-material-soft); }

.mt-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; background: #fff; }
.mt-table th, .mt-table td { border-bottom: 1px solid #eef1f4; padding: 11px 10px; text-align: left; }
.mt-table th { background: #f8fafc; color: #475569; font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
.mt-table td.num, .mt-table th.num { text-align: right; }
.mt-table tbody tr:hover { background: #fafbfc; }
.mt-table th:first-child, .mt-table td:first-child { min-width: 230px; }
.mt-table__title { font-weight: 600; color: #0f172a; line-height: 1.5; }
.mt-table__model { font-size: 0.76rem; color: #94a3b8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mt-scroll { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 10px; }

.mt-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap; /* 表の狭いセルで縦書きになるのを防ぐ */
}

/* 幅を固定しておかないと、この列が伸びて右端の操作ボタンが押し出される */
.mt-spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; width: 84px; }
.mt-spark span {
  flex: 1;
  min-width: 3px;
  background: #bbf7d0;
  border-radius: 1px 1px 0 0;
}
.mt-spark span.is-hot { background: var(--clr-material); }

/* ---- 出品フォーム ---- */
.mt-form { max-width: 760px; }
.mt-form fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px 20px 22px;
  margin-bottom: 22px;
}
.mt-form legend { font-size: 0.86rem; font-weight: 600; color: var(--clr-material-dark); padding: 0 8px; }
.mt-form label { display: block; font-size: 0.84rem; font-weight: 600; color: #334155; margin: 14px 0 5px; }
.mt-form label:first-of-type { margin-top: 4px; }
.mt-form input[type="text"],
.mt-form input[type="number"],
.mt-form input[type="file"],
.mt-form select,
.mt-form textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.94rem;
  font-family: inherit;
  background: #fff;
}
.mt-form textarea { min-height: 92px; resize: vertical; }
.mt-form__hint { font-size: 0.76rem; color: #94a3b8; margin-top: 4px; }
.mt-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mt-form__actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.mt-form__err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 6px;
  padding: 11px 14px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}
.mt-form__ok {
  background: var(--clr-material-soft);
  border: 1px solid #bbf7d0;
  color: var(--clr-material-dark);
  border-radius: 6px;
  padding: 11px 14px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}

@media (max-width: 860px) {
  .mt-detail { grid-template-columns: 1fr; gap: 22px; }
  .mt-form__row { grid-template-columns: 1fr; }
  .mt-search { flex-direction: column; }
}

/* ---- 地域別送料グリッド（出品フォーム） ---- */
.mt-fee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mt-fee-grid__item { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.mt-fee-grid__item span { font-size: 0.78rem; font-weight: 600; color: #334155; }
.mt-fee-grid__item input { width: 100%; }
