/* =========================================================
   PRODUCT（Hub / Detail 共通）
   - /product/ は背景グレー
   - ヘッダー帯（nk-page-hero--product）は会社概要と同系
   - タブで商品切替（ボタン）
   - 商品表示は白カード
========================================================= */


/* =========================================================
   1) /product/ の「標準アーカイブ表示」を無効化（重複表示対策）
   ※Hello Elementor 側のタイトルや header が残る場合があるため
========================================================= */
.post-type-archive-product .site-main > header,
.post-type-archive-product .site-main header.page-header,
.post-type-archive-product .site-main .page-header,
.post-type-archive-product .site-main .archive-header,
.post-type-archive-product .site-main .archive-title,
.post-type-archive-product .site-main .page-title,
.post-type-archive-product .site-main .entry-header,
.post-type-archive-product .site-main > h1{
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* テーマにより ul/ol が直下に出る保険 */
.post-type-archive-product .site-main > ul,
.post-type-archive-product .site-main > ol{
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}


/* =========================================================
   2) Page Hero（会社概要と同じ見た目）
   archive-product.php で出す帯：nk-page-hero--product
========================================================= */
.post-type-archive-product .nk-page-hero{
  width: 100%;
  background: transparent;
  padding: 0;
  margin: 0;
}

/* 白帯（上）＋グレー帯＋白帯（下） */
.post-type-archive-product .nk-page-hero--product{
  border-top: 20px solid #ffffff;
  border-bottom: 20px solid #ffffff;
  background: #7a7a7a;
  padding: 28px 0;
  box-sizing: border-box;
}

/* 中央揃え */
.post-type-archive-product .nk-page-hero-inner{
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
  text-align: center;
}

.post-type-archive-product .nk-page-hero-title{
  margin: 0;
  color: #fff;
  font-weight: 600;
  letter-spacing: .08em;
  font-size: 32px;
  line-height: 1.1;
}



/* =========================================================
   3) PRODUCT HUB（/product/ タブ領域）★おしゃれ版に差し替え
========================================================= */
.product-hub{
  width: 100%;
}

/* タブ領域：薄いグレーの帯＋下に境界 */
.product-hub-header{
  background: #f4f4f4;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

/* 1140px 内側：中央寄せ＋少し余白 */
.product-hub-inner{
  max-width: 1140px;
  margin: 0 auto;
  padding: 18px 16px 14px; /* HERO直下なので少し詰めつつ上品に */
  box-sizing: border-box;
}

/* タブ横スクロール（スマホ対応） */
.product-hub-nav{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.product-hub-tabs{
  list-style:none;
  display:flex;
  justify-content:center;
  flex-wrap:wrap;      /* ← ★これで自動改行 */
  gap:12px;
  margin:0;
  padding:2px 2px;
  row-gap:14px;
}

.product-hub-tab{
  list-style: none;
}

/* ボタン（通常） */
.product-hub-tab a{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 12px 20px;           /* ★少し大きく */
  border-radius: 999px;
  text-decoration: none;

  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.10);
  color: #222;

  font-weight: 800;
  font-size: 14px;
  line-height: 1;

  box-shadow: 0 2px 10px rgba(0,0,0,.06);   /* ★上品な影 */
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

/* hover（浮き上がり） */
.product-hub-tab a:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
  border-color: rgba(0,0,0,.14);
}

/* アクティブ（グラデ＋発光） */
.product-hub-tab.is-active a{
  background: linear-gradient(135deg, #2f6e4a, #3e8b60);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(47,110,74,.35);
}

/* キーボード操作の視認性 */
.product-hub-tab a:focus-visible{
  outline: 3px solid rgba(47,110,74,.35);
  outline-offset: 3px;
}

/* 空表示 */
.product-hub-empty,
.product-hub-empty-detail{
  margin: 10px 0 0;
  color: #555;
}

/* SP：中央寄せのまま、少し小さく */
@media (max-width: 768px){
  .product-hub-tabs{
    justify-content: flex-start;   /* ★スマホは横スクロールしやすく左寄せ */
    gap: 10px;
  }
  .product-hub-tab a{
    padding: 10px 16px;
    font-size: 13px;
  }
}


/* =========================================================
   FIX：商品名タブ領域だけフルスクリーン（自動改行）
   ========================================================= */

/* タブの外枠だけ 100vw に突破させる */
.post-type-archive-product .product-hub-nav{
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  /* 端の余白（画面に密着しないように） */
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;

  overflow-x: hidden; /* “フル幅 + 折り返し”なので横スクは基本不要 */
}

/* タブは折り返し（すでに flex-wrap:wrap だけど保険） */
.post-type-archive-product .product-hub-tabs{
  flex-wrap: wrap;
  justify-content: center; /* PCは中央 */
}

/* ボタン内の文字が長い時に、2行以上で折り返せるように */
.post-type-archive-product .product-hub-tab a{
  white-space: normal;          /* 折り返し許可 */
  line-height: 1.2;             /* 行間（いま line-height:1 で詰まりやすい） */
  text-align: center;
  overflow-wrap: anywhere;      /* 長い品名でも崩れない */
  word-break: break-word;

  /* 1つのボタンが横に伸びすぎない上限（任意） */
  max-width: min(420px, 80vw);
}

/* SPは左寄せ（あなたの既存方針を維持） */
@media (max-width: 768px){
  .post-type-archive-product .product-hub-tabs{
    justify-content: flex-start;
  }
}



/* =========================================================
   4) /product/ 背景・本文エリア
========================================================= */
.product-hub-body{
  background: #6f6f6f;  /* 濃いグレー背景 */
  padding: 18px 0 60px;
}

.product-hub-body-inner{
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}


/* =========================================================
   5) 商品カード（product-render.php で出る）
========================================================= */
.product-detail{
  max-width: 1140px;
  margin: 0 auto;
  padding: 22px 22px;
  box-sizing: border-box;

  background: #f4f4f4;   /* ← 白から変更 */
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08); /* 少し弱めにすると自然 */
}

.product-header{
  margin: 0 0 14px;
}

.product-title{
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 600;
  color: #111;
}

/* 説明文（品名とブランドの間） */
.product-lead{
  margin: 0 0 14px;
  padding: 14px 16px;

  background: #f4f4f4;   /* ← 同色に統一 */
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;

  line-height: 1.9;
  color: #222;
}

.product-lead p{
  margin: 0 0 10px;
}
.product-lead p:last-child{
  margin-bottom: 0;
}

.product-meta p{
  margin: 0 0 6px;
  font-size: 15px;
  color: #333;
}


/* =========================================================
   6) Gallery（2列 × 最大3行 = 最大6枚）
========================================================= */
.product-gallery{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 10px;
}

/* 7枚目以降は非表示（保険） */
.product-gallery .product-photo:nth-child(n+7){
  display: none;
}

.product-photo{
  margin: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
}

.product-photo img{
  width: 100%;
  height: auto;
  display: block;
}


/* =========================================================
   7) Specs
========================================================= */
.product-spec{
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,.10);
}

.product-spec h2{
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 900;
  color: #111;
}

.product-spec-body{
  background: #f6f6f6;
  border-radius: 12px;
  padding: 14px 16px;
  line-height: 1.9;
  color: #222;
}


/* =========================================================
   8) 他の商品（関連商品）※今後用（現状維持）
========================================================= */
.product-related{
  margin: 60px 0 0;
  padding-top: 30px;
  border-top: 1px solid rgba(0,0,0,.12);
}

.product-related .related-title{
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 20px;
}

.related-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.related-item{
  display: block;
  text-decoration: none;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.related-thumb img{
  width: 100%;
  height: auto;
  display: block;
}

.related-thumb .no-image{
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: #f1f1f1;
  color: #666;
  font-size: 13px;
}

.related-body{
  padding: 12px 12px 14px;
}

.related-name{
  font-weight: 900;
  color: #111;
  line-height: 1.4;
}

.related-model{
  margin-top: 6px;
  font-size: 13px;
  color: #555;
}

.product-title::before{
  content: "■";
  margin-right: 8px;
  color: #2f6e4a;      /* ブランドカラーに合わせる */
  font-weight: 900;
}



/* =========================================================
   9) Responsive
========================================================= */
@media (max-width: 768px){
  .post-type-archive-product .nk-page-hero-title{
    font-size: 34px;
  }
  .post-type-archive-product .nk-page-hero--product{
    padding: 26px 0;
    border-top-width: 14px;
    border-bottom-width: 14px;
  }

  .product-title{
    font-size: 24px;
  }

  .product-detail{
    padding: 18px 16px;
  }
}

@media (max-width: 560px){
  .related-grid{
    grid-template-columns: 1fr;
  }
}