/* ==================================================
 * 2026-09-24 追加：取り扱い製品 一覧（/product1/）と製品詳細
 * 読み込み先：製品一覧ページ・製品詳細ページのみ（functions.php）
 * 色は既存の製品ページに合わせる：製品名 #1b224c／緑 #004831・#4dab3c
 * Figma指示：画像の枠線は画像に焼き込まずCSSで付ける／画像サイズで表示サイズが変わらないようにする
 * ================================================== */

/* ---------- 一覧 ---------- */
.product-list {
  max-width: 1200px;
  margin: 0 auto 131px;
  padding: 0 40px;
  box-sizing: border-box;
}

.product-list__inner {
  margin-top: 100px;
}

.product-list__lead {
  max-width: 960px;
  margin: 0 auto 48px;
  font-family: "游ゴシック体", YuGothic, "游ゴシック Medium", "Yu Gothic Medium", "游ゴシック", "Yu Gothic", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.9;
  color: #1b224c;
}

.product-list__filter {
  margin: -16px 0 32px;
  text-align: center;
  font-size: 15px;
  color: #004831;
}

.product-list__filter a {
  margin-left: 12px;
  color: #4dab3c;
  text-decoration: underline;
}

.product-list__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-card[hidden] {
  display: none;
}

.product-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

.product-card__link:hover {
  opacity: 0.6;
}

/*
 * 画像の枠：どんな大きさ・比率の画像でも同じ大きさで表示する。
 * ※今の製品写真は画像そのものに角丸の枠線が描き込まれているため、CSSの枠線は既定では付けない（二重になるため）。
 *   枠なしの写真に差し替えたら、下の .product-card__image / .product-gallery__main に
 *   border: 1px solid #d9d9d9; border-radius: 8px; を足せばCSSで枠が付く（Figma指示）。
 */
.product-card__image {
  aspect-ratio: 5 / 3;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card__noimage {
  color: #999;
  font-size: 14px;
}

.product-card__body {
  margin-top: 16px;
  font-family: "游ゴシック体", YuGothic, "游ゴシック Medium", "Yu Gothic Medium", "游ゴシック", "Yu Gothic", sans-serif;
}

.product-card__maker {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  color: #4dab3c;
}

.product-card__name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: #1b224c;
}

.product-card__catch {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
  color: #555;
}

.product-list__empty {
  text-align: center;
  font-size: 16px;
  color: #555;
  margin-top: 40px;
}

/* ---------- 詳細 ---------- */
.product-single__catch {
  margin: 8px 0 24px;
  font-family: "游ゴシック体", YuGothic, "游ゴシック Medium", "Yu Gothic Medium", "游ゴシック", "Yu Gothic", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
  color: #004831;
}

.product-gallery {
  margin-bottom: 32px;
}

.product-gallery__main {
  aspect-ratio: 5 / 3;
  max-width: 640px;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-single main.single-main .product-gallery__main img,
.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.product-gallery__thumb {
  width: 96px;
  height: 72px;
  padding: 4px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.product-gallery__thumb.is-active {
  border: 2px solid #4dab3c;
}

.product-single main.single-main .product-gallery__thumb img,
.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-single__meta {
  margin: 0 0 40px;
  font-family: "游ゴシック体", YuGothic, "游ゴシック Medium", "Yu Gothic Medium", "游ゴシック", "Yu Gothic", sans-serif;
  font-size: 15px;
  border-top: 1px solid #e3e3e3;
}

.product-single__meta > div {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #e3e3e3;
}

.product-single__meta dt {
  flex-shrink: 0;
  width: 110px;
  font-weight: 700;
  color: #1b224c;
}

.product-single__meta dd {
  margin: 0;
}

.product-single__meta a {
  color: #004831;
  text-decoration: underline;
}

.product-single__section {
  margin-bottom: 48px;
}

.product-single__section h2 {
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 4px solid #4dab3c;
  font-family: "游ゴシック体", YuGothic, "游ゴシック Medium", "Yu Gothic Medium", "游ゴシック", "Yu Gothic", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1b224c;
}

/* 製品詳細の本文（リッチエディタ）：表と箇条書きを読みやすく */
.product-single__section .text {
  font-family: "游ゴシック体", YuGothic, "游ゴシック Medium", "Yu Gothic Medium", "游ゴシック", "Yu Gothic", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.9;
}

.product-single__section .text p {
  margin: 0 0 1em;
}

.product-single__section .text ul,
.product-single__section .text ol {
  margin: 0 0 1em 1.5em;
}

.product-single__section .text ul { list-style: disc; }
.product-single__section .text ol { list-style: decimal; }

.product-single__section .text table {
  width: 100%;
  margin: 0 0 1em;
  border-collapse: collapse;
}

.product-single__section .text th,
.product-single__section .text td {
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  text-align: left;
  vertical-align: top;
}

.product-single__section .text th {
  background: #eef6ec;
  font-weight: 700;
}

.product-single__back a {
  display: inline-block;
  padding: 10px 32px;
  border: 1px solid #4dab3c;
  border-radius: 30px;
  color: #004831;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.product-sidebar__list {
  margin: 12px 0 32px;
  padding: 0;
  list-style: none;
}

.product-sidebar__list li {
  border-bottom: 1px solid #e3e3e3;
}

.product-sidebar__list a {
  display: block;
  padding: 10px 4px;
  font-size: 15px;
  color: #1b224c;
  text-decoration: none;
}

.product-sidebar__list a:hover {
  color: #4dab3c;
}

/* ---------- タブレット ---------- */
@media (max-width: 1000px) {
  .product-list__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- スマホ ---------- */
@media (max-width: 428px) {
  .product-list {
    padding: 0 16px;
    margin-bottom: 80px;
  }

  .product-list__inner {
    margin-top: 48px;
  }

  .product-list__lead {
    font-size: 15px;
    margin-bottom: 32px;
  }

  .product-list__grid {
    gap: 32px 16px;
  }

  .product-card__name {
    font-size: 15px;
  }

  .product-card__maker,
  .product-card__catch {
    font-size: 14px;
  }

  .product-single__catch {
    font-size: 16px;
  }

  .product-gallery__thumb {
    width: 64px;
    height: 48px;
  }

  .product-single__meta dt {
    width: 90px;
  }
}

/* ==================================================
 * ジャンルのタブ（2026-09-24 デザイン改善・3案試作）
 *  写真（または「すべて」のアイコン）／ジャンル名／件数のカード。
 *  3案（写真カード型・下線タブ型・写真アイコン付きピル型）を試作し、写真カード型に決定
 *  文字は最小15px（塚原さんの基準）。色は既存サイトの緑に合わせる
 * ================================================== */
.gtabs {
  margin: 0 0 48px;
  font-family: "游ゴシック体", YuGothic, "游ゴシック Medium", "Yu Gothic Medium", "游ゴシック", "Yu Gothic", sans-serif;
}

.gtabs__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gtabs__link {
  color: #1b224c;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

.gtabs__img--all {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4dab3c;
  background: #eef6ec;
}

.gtabs__name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
}

.gtabs__count {
  font-weight: 500;
  font-size: 15px;
  color: #6b7a72;
}

/* ---------- A：写真カード型 ---------- */
.gtabs--a .gtabs__list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.gtabs--a .gtabs__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #e0e6e2;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.gtabs--a .gtabs__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 72, 49, .10);
}

.gtabs--a .gtabs__img {
  position: relative;
  display: block;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: #fff;
}

/* 旧ジャンル画像（横長・周囲に枠の描き込みあり）を少し拡大して、枠の線が見えないようにする */
.gtabs--a .gtabs__img img {
  position: absolute;
  inset: 0;
  object-fit: cover;
  transform: scale(1.12);
}

.gtabs--a .gtabs__img--all {
  display: flex;
}

.gtabs--a .gtabs__name {
  display: block;
  padding: 10px 8px 0;
  text-align: center;
}

.gtabs--a .gtabs__count {
  display: block;
  padding: 2px 8px 10px;
  text-align: center;
}

.gtabs--a .gtabs__count::after {
  content: "件";
  margin-left: 1px;
}

.gtabs--a .gtabs__link.is-active {
  border: 2px solid #4dab3c;
  background: #f3faf1;
  box-shadow: 0 6px 16px rgba(77, 171, 60, .18);
}

.gtabs--a .gtabs__link.is-active .gtabs__name {
  color: #004831;
}

/* ---------- タブレット ---------- */
@media (max-width: 1000px) {
  .gtabs--a .gtabs__list {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- スマホ：タブは横にスクロールする1列（縦に長くならないように） ---------- */
@media (max-width: 428px) {
  .gtabs {
    margin: 0 -16px 32px;
  }

  .gtabs__list {
    padding: 0 16px 8px !important;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding-left: 16px; /* 吸着しても左端の余白を保つ */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .gtabs__list::-webkit-scrollbar {
    display: none;
  }

  .gtabs__item {
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .gtabs--a .gtabs__list {
    display: flex;
    gap: 10px;
  }

  .gtabs--a .gtabs__item {
    width: 112px;
  }

}

/* 2026-09-24 スマホでタブを押したとき上の線が切れる件の修正 */
@media (hover: none) {
  .gtabs--a .gtabs__link:hover {
    transform: none;
  }
}
@media (max-width: 428px) {
  .gtabs__list {
    padding-top: 6px !important;
  }
}
