/* ============================================================
   1. 安全対策：.fabric-scope 内だけに限定したリセット
============================================================ */
.fabric-scope *,
.fabric-scope *::before,
.fabric-scope *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.fabric-scope p,
.fabric-scope h1,
.fabric-scope h2,
.fabric-scope h3,
.fabric-scope h4,
.fabric-scope h5,
.fabric-scope h6 {
  margin: 0;
}

/* 不要な空タグのみ消去 */
.fabric-scope p:empty,
.fabric-scope div:empty,
.fabric-scope br {
  display: none !important;
}

/* 2. タブで非表示にしたコンテンツブロックの余白・高さを完全にゼロにする */
.fabric-tabs [id^="content_"]:not(:target) {
  margin: 0 !important;
  padding: 0 !important;
}

/* 3. テーブル内の非表示行が占有していた隙間を完全消去 */
.lineup-table tr[style*="display: none"],
.lineup-table tr:not([style*="display"]) {
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
}

/* ============================================================
   2. 見出し・コンテナ
============================================================ */
h3.main,
.line-heading {
  font-size: 1.35rem;
  color: #1b2233;
  border-bottom: 2px solid #b89a5a;
  padding-bottom: 8px;
  padding-left: 36px;
  margin: 24px 0 24px;
}
h4 { padding-left: 36px; }

/* ============================================================
   3. タブUI & 連動制御（全ページ共通対応版）
============================================================ */
.fabric-tabs {
  max-width: 900px;
  margin: 0 auto;
}

.fabric-tabs input[type="radio"],
.color-radio {
  display: none;
}

.tab-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 auto 24px;
}

.tab-label {
  flex: 1;
  min-width: 110px;
  text-align: center;
  padding: 10px 0;
  background: #1b2233;
  color: #fff;
  border-left: 4px solid #b89a5a;
  border-bottom: 4px solid transparent;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  transition: background 0.2s ease;
  white-space:nowrap;
}

.tab-label:hover {
  background: #25304a;
}

/* --- タブ選択状態（アクティブ表示） --- */
.fabric-tabs:has(#tab_all:checked) label[for="tab_all"],
.fabric-tabs:has(#tab_silver:checked) label[for="tab_silver"],
.fabric-tabs:has(#tab_silver_function:checked) label[for="tab_silver_function"],
.fabric-tabs:has(#tab_gold:checked) label[for="tab_gold"],
.fabric-tabs:has(#tab_platinum:checked) label[for="tab_platinum"],
.fabric-tabs:has(#tab_basic:checked) label[for="tab_basic"],
.fabric-tabs:has(#tab_standard:checked) label[for="tab_standard"],
.fabric-tabs:has(#tab_lank_e:checked) label[for="tab_lank_e"],
.fabric-tabs:has(#tab_lank_c:checked) label[for="tab_lank_c"] {
  background: linear-gradient(#2c3450, #1b2233);
  border-bottom: 4px solid #b89a5a;
  color: #b89a5a;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* ==========================================
   【Part 1】 1ページ目用：テーブル行 & カードの非表示連動
========================================== */
/* テーブル行の切り替え */
.fabric-tabs:has(#tab_silver:checked) .lineup-table tr:not(.row-silver),
.fabric-tabs:has(#tab_silver_function:checked) .lineup-table tr:not(.row-silver-func),
.fabric-tabs:has(#tab_gold:checked) .lineup-table tr:not(.row-gold),
.fabric-tabs:has(#tab_platinum:checked) .lineup-table tr:not(.row-platinum) { 
  display: none !important; 
}

/* カードの切り替え（CSVのarticle_classに対応） */
.fabric-tabs:has(#tab_silver:checked) .fabric-card-v2:not(.silver_article),
.fabric-tabs:has(#tab_silver_function:checked) .fabric-card-v2:not(.silver_func_article),
.fabric-tabs:has(#tab_gold:checked) .fabric-card-v2:not(.gold_article),
.fabric-tabs:has(#tab_platinum:checked) .fabric-card-v2:not(.platinum_article) {
  display: none !important;
}

/* ==========================================
   【Part 2】 2ページ目用：テーブル行 & カードの非表示連動
========================================== */
.fabric-tabs:has(#tab_basic:checked) .lineup-table tr:not(.row-basic),
.fabric-tabs:has(#tab_standard:checked) .lineup-table tr:not(.row-standard),
.fabric-tabs:has(#tab_lank_e:checked) .lineup-table tr:not(.row-e),
.fabric-tabs:has(#tab_lank_c:checked) .lineup-table tr:not(.row-c) { 
  display: none !important; 
}

.fabric-tabs:has(#tab_basic:checked) .fabric-card-v2:not(.basic_article),
.fabric-tabs:has(#tab_standard:checked) .fabric-card-v2:not(.standard_article),
.fabric-tabs:has(#tab_lank_e:checked) .fabric-card-v2:not(.e_article),
.fabric-tabs:has(#tab_lank_c:checked) .fabric-card-v2:not(.c_article) {
  display: none !important;
}

/* ALL（すべて表示）選択時 */
.fabric-tabs:has(#tab_all:checked) .fabric-card-v2,
.fabric-tabs:has(#tab_all:checked) .lineup-table tr {
  display: table-row; /* tr用 */
}
.fabric-tabs:has(#tab_all:checked) .fabric-card-v2 {
  display: block; /* カード用 */
}

/* ============================================================
   4. 掲載生地・ブランド一覧テーブル
============================================================ */
.lineup-container {
  background: #fff;
  border: 1px solid #dcd6cd;
  border-top: 3px solid #b89a5a;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 32px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.lineup-title {
  font-size: 0.9rem;
  font-weight: bold;
  color: #1b2233;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
  letter-spacing: 0.05em;
}

.lineup-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.82rem;
}

.lineup-table tr {
  border-bottom: 1px solid #eef1f5;
}

.lineup-table tr:nth-child(even) {
  background-color: #f9fbfd;
}

.lineup-table th,
.lineup-table td {
  padding: 8px 12px;
}

.lineup-table th {
  width: 30%;
  text-align: left;
  font-weight: bold;
  white-space: nowrap;
}

.lineup-table td {
  color: #2b2b2b;
}

.badge-gold-text { color: #8c6a22; }
.badge-platinum-text { color: #3a475d; }
.badge-silver-text { color: #232a3b; }
.badge-basic-text { color: #232a3b; }
.badge-standard-text { color: #1f4e5b; }
.badge-e-text { color: #8c6a22; }
.badge-c-text { color: #6b3a5d; }

/* ============================================================
   5. 商品カード (fabric-card-v2)
============================================================ */
.fabric-card-v2 {
  position: relative;
  background-color: #f3efe9;
  border: 1px solid #dcd6cd;
  border-radius: 6px;
  padding: 20px 16px 16px;
  margin-top: 24px;
  margin-bottom: 28px;
  color: #2b2b2b;
}

/* 丸型バッジ */
.card-badge {
  position: absolute;
  top: -20px;
  left: -10px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #232a3b;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  line-height: 1.2;
  font-size: 0.65rem;
  font-weight: bold;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
  z-index: 2;
}

.card-badge .badge-line-name { letter-spacing: 0.03em; }
.card-badge .badge-sub-name {
  font-size: 0.55rem;
  color: #c9d6df;
}

.recommend-point-box {
  margin-bottom: 12px;
}

.fabric-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: #1b2233;
  padding-left: 48px; /* 丸バッジとの重なり防止 */
}

/* カードメイン情報レイアウト */
.card-main-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.product-spec {
  font-size: 0.78rem;
  color: #555;
  line-height: 1.4;
}

/* スタッフ情報 */
.info-right-staff {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.8);
  border: 1px solid #d0c8bc;
  border-radius: 20px;
}

.staff-avatar-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid #b89a5a;
  flex-shrink: 0;
}

.staff-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* ▼ 基準を「中央」に変更し、全体的に少しだけ拡大して引き上げる ▼ */
  object-position: center center;
  transform: scale(1.25);
}

.staff-name-text {
  font-size: 0.75rem;
  font-weight: bold;
  color: #2b2b2b;
}

/* 価格タグ */
.card-price-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e0d8cc;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 12px;
}

.card-price-header strong {
  color: #c0392b;
  font-size: 0.85rem;
}

/* サムネイルグリッド */
.fabric-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.thumb-item {
  text-align: center;
}

.thumb-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.15);
  margin-bottom: 4px;
}

.thumb-code {
  font-size: 0.65rem;
  font-weight: 600;
  color: #444;
  word-break: break-all;
  display: block;
}

/* コメント */
.card-comment-box {
  background: rgba(255,255,255,0.6);
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid #e0d8cc;
}

.comment-text {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #333;
  text-align: justify;
}

/* ============================================================
   6. レスポンシブ (768px以下)
============================================================ */
@media (max-width: 768px) {
  .fabric-thumb-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .card-main-info {
    flex-direction: column;
    gap: 8px;
  }

  .fabric-card-v2 {
    padding: 16px 12px 12px;
    margin-bottom: 20px;
  }
}
/* カードメイン情報レイアウト（スタッフ位置調整のため relative に） */
.card-main-info {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

/* スタッフ情報（カード右上へ移動＆上に飛び出させる） */
.info-right-staff {
  position: absolute;
  top: -45px;          /* ← 上への飛び出し具合を調整（数字を小さくするとさらに上へ） */
  right: 0px;          /* ← 右端からの位置 */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #d0c8bc;
  border-radius: 30px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* 少し影をつけて浮き上がらせる */
  z-index: 3;
}

/* アイコン画像枠（上へ少し飛び出させる調整） */
.staff-avatar-box {
  width: 48px;         /* アイコンサイズ */
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #b89a5a;
  flex-shrink: 0;
  background: #fff;
}
/* ============================================================
   掲載生地テーブル：各ライン（カテゴリ）の区切り線設定
============================================================ */

/* 2行目以降にくるカテゴリの切り替わり（先頭行）に区切り線を入れる */
.lineup-table tr.row-silver-func ~ tr.row-gold,
.lineup-table tr.row-gold ~ tr.row-platinum,
.lineup-table tr.row-silver ~ tr.row-silver-func,
.lineup-table tr.row-basic ~ tr.row-standard,
.lineup-table tr.row-standard ~ tr.row-e,
.lineup-table tr.row-e ~ tr.row-c {
  /* 隣接境界の判別用 */
}

/* 各カテゴリグループの最初の行の上部に太めのアクセント線を追加 */
.lineup-table tr.row-silver-func:first-of-type,
.lineup-table tr.row-gold:first-of-type,
.lineup-table tr.row-platinum:first-of-type,
.lineup-table tr.row-standard:first-of-type,
.lineup-table tr.row-e:first-of-type,
.lineup-table tr.row-c:first-of-type {
  border-top: 2.5px solid #b89a5a; /* 上部にゴールドの区切り線 */
}

/* 境目がより際立つよう、区切り直前の行に少し余白感を持たせる設定 */
.lineup-table tr.row-silver-func:first-of-type th,
.lineup-table tr.row-gold:first-of-type th,
.lineup-table tr.row-platinum:first-of-type th,
.lineup-table tr.row-silver-func:first-of-type td,
.lineup-table tr.row-gold:first-of-type td,
.lineup-table tr.row-platinum:first-of-type td {
  padding-top: 12px; /* 区切り直後の行の上の余白を少し広く */
}
/* ============================================================
   7. おすすめ仕立てコーナー（新規追加）
============================================================ */
.card-recommend-box {
  background: #fdfaf3; /* コメント枠より温かみ・上質感のある背景色 */
  padding: 12px 14px;
  border-radius: 4px;
  border: 1px solid #e2d9c8;
  border-left: 4px solid #b89a5a; /* 左側にゴールドのアクセントライン */
  margin-top: 10px; /* コメント枠がある場合の間隔 */
}

/* タイトル（左肩） */
.recommend-title {
  font-size: 0.75rem;
  font-weight: bold;
  color: #8c6a22; /* アクセントカラー（シックなゴールド系） */
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
}

/* タイトルの左にワンポイントアイコン風の四角を追加（お好みで） */
.recommend-title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #8c6a22;
  margin-right: 6px;
  border-radius: 1px;
}

/* 本文テキスト */
.recommend-text {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #333;
  text-align: justify;
}

/* おすすめ仕立て 1 と 2 の間の区切り線 */
.recommend-divider {
  border: 0;
  border-top: 1px dashed #d8cebc; /* 点線の区切り線 */
  margin: 8px 0;
}
.comment-text br,
.recommend-text br,
.quality-note br,
.tab-label br{
  display: block !important;
  content: "";            /* 余計な疑似要素をクリア */
  margin-bottom: 0.2em;   /* お好みで改行後の行間を少し空けることも可能 */
}

/* おすすめ仕立て画像ギャラリー（PC：横並び / スマホ：縦並び） */
.card-recommend-imgs {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* ★強制的に2列横並びにする */
  gap: 12px;
  margin: 16px 0;
}

/* 画像が1枚しかない場合は横いっぱいに表示 */
.card-recommend-imgs:has(.recommend-img-item:only-child) {
  grid-template-columns: 1fr;
}

.recommend-img-item {
  width: 100%;
  min-width: 0; /* 折り返し事故を防止 */
}

.recommend-img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;      /* 900:675 (4:3) の比率固定 */
  object-fit: cover;        /* 切り抜き */
  border-radius: 6px;
  display: block;
}

/* スマホ表示時（768px以下）：縦並び（1列） */
@media screen and (max-width: 768px) {
  .card-recommend-imgs {
    grid-template-columns: 1fr; /* ★スマホでは1列にする */
  }
}
.quality-note {
  display: block;          /* 確実にブロック要素として扱う */
  font-size: 11px;
  color: #777777;
  line-height: 1.6;
  padding-top: 40px;       /* ★margin-topの代わりにpadding-topを使用 */
  margin-bottom: 30px;     /* 下の余白 */
  text-align: left;
}
/* レスポンシブ (768px以下) */
@media (max-width: 768px) {
  .fabric-thumb-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .card-main-info {
    flex-direction: column;
    gap: 8px;
  }

  .fabric-card-v2 {
    padding: 16px 12px 12px;
    margin-bottom: 20px;
  }

  /* ★ スマホ時のみ浮き上がりを解除して正常な位置へ戻す */
  .info-right-staff {
    position: static;      /* absolute（絶対配置）を解除 */
    top: auto;             /* 上位置の指定をリセット */
    right: auto;           /* 右位置の指定をリセット */
    align-self: flex-start;/* 左寄せ（右寄せにしたい場合は flex-end） */
  }
}
@media (max-width: 768px) {
  /* --- 既存のレスポンシブ設定はそのまま --- */

  /* ★ テーブルのth（カテゴリー欄）を折り返して縮小し、td（生地名）を広くする */
  .lineup-table th {
    white-space: normal;   /* PC側の nowrap を解除して折り返しを許可 */
    width: 25%;            /* 幅を縮小（お好みで 80px などの固定値も可） */
    padding: 8px 4px;      /* パディングを少し詰めて領域を最大活用 */
    word-break: break-word;/* 英字（LINE等）の途中折り返し崩れを防止 */
    font-size:10px;
  }

  .lineup-table td {
    padding: 8px 6px;      /* td側も左右の余白を少し調整 */
  }
}
.fabric-group-header {
  grid-column: 1 / -1;      /* 全列を結合 */
  text-align: center;       /* 中央寄せ */
  font-weight: bold;        /* 太字 */
  padding: 8px 0;           /* 余白 */
  background-color: #f5f5f5;/* 背景色（必要に応じて調整） */
  margin: 10px 0 5px 0;
}