/* =========================================
   Product Detail Page Modern Layout
   (整理・統合版)
========================================= */

/* -------------------------------------------
   1. パンくずリスト
------------------------------------------- */
/* パンくずエリア全体 */
.breadcrumb-area {
  margin-bottom: 24px;
  font-size: 12px;
  color: #888;
}

/* フレックスボックスで横並びのベースを作る */
.topicpath-container {
  display: flex;
  flex-wrap: wrap; /* 画面幅が狭いときは折り返す */
  align-items: center;
  gap: 0px 12px; /* 上下左右に適度な隙間 */
}

/* リストの基本スタイル */
.topicpath-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* 区切り文字 */
.topicpath-nav .divider {
  margin: 0 4px;
  font-size: 10px;
  color: #ccc;
}

/* グループパンくずの微調整 */
.group-path {
  /* カテゴリパンくずとの区別をつける場合 */
  margin-left: 0; 
}

/* グループリンクを目立たせる（タグっぽくする） */
.group-link {
  color: #666;
  text-decoration: underline; /* リンクであることを明示 */
}

.group-link:hover {
  color: #A3CDBA; /* ブランドカラー */
  text-decoration: none;
}

/* 例：グループの区切り線を変更する場合 */
.group-path .divider {
  content: "|"; /* または "/" */
  color: #A3CDBA; /* ブランドカラーの緑にしてアクセントに */
  font-weight: 400;
}

/* -------------------------------------------
   2. メインググリッド（レスポンシブ対応）
------------------------------------------- */
.product-main-grid {
  display: grid;
  gap: 40px;
  margin-bottom: 60px;
  align-items: start;
  
  /* ▼基本（スマホ）は1カラム・縦積み */
  grid-template-columns: 1fr; 
}

/* ▼ PC（画面幅768px以上）の時だけ2カラムにする */
@media (min-width: 768px) {
  .product-main-grid {
    /* 左(画像) : 右(情報) = 1.2 : 1 */
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
  }
  
  /* 右側の情報をスクロール追従させる */
  .p-detail-info {
    position: sticky;
    top: 120px;
    align-self: start;
  }
}

/* -------------------------------------------
   3. 左カラム：画像ギャラリー
------------------------------------------- */
.p-detail-gallery {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.p-detail-gallery .main-image img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  /* PCで画像が大きすぎないように制限 */
  max-height: 650px; 
  object-fit: contain;
}

.thumb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 0;
}
.thumb-list li img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #eee;
  transition: opacity 0.2s;
}
.thumb-list li img:hover {
  opacity: 0.8;
}
.thumb-list li img.active,
.thumb-list li img:focus {
  border-color: #333;
  opacity: 1;
}

/* -------------------------------------------
   4. 右カラム：購入情報エリア
------------------------------------------- */

/* 商品名・型番 */
.p-title {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 16px;
  line-height: 1.4;
  border-bottom: 1px solid #eee;
  padding-bottom: 16px;
}
.p-model {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}

/* 価格（基本表示） */
.p-price-area {
  margin-bottom: 24px;
}
.regular-price, .teika-price {
  font-size: 13px;
  color: #888;
  text-decoration: line-through;
}
.sales-price {
  font-size: 1.6rem;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 12px;
}
.discount-badge {
  font-size: 12px;
  background: #cc0000;
  color: #fff;
  padding: 2px 6px;
  border-radius: 2px;
}

/* --- オプション（表形式）のデザイン --- */
.p-options-table-wrap {
  margin-bottom: 24px;
  width: 100%;
  overflow-x: auto; /* スマホで幅が足りない時はスクロール */
  -webkit-overflow-scrolling: touch;
}

.p-options-table-wrap table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  border: 1px solid #eee;
  white-space: nowrap;
}

.p-options-table-wrap th,
.p-options-table-wrap td {
  padding: 15px 10px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  vertical-align: middle;
}

/* ヘッダー（項目名） */
.p-options-table-wrap th {
  background: #f9f9f9;
  font-weight: 600;
  color: #555;
  text-align: center; /* 中央揃え */
  min-width: 100px;
}

/* 選択肢セル */
.p-options-table-wrap td {
  text-align: center;
  color: #333;
}

/* 表内の価格 */
.p-options-table-wrap .price {
  font-weight: bold;
  font-size: 15px;
  color: #333;
  display: block;
  margin-bottom: 4px;
}

/* ---------------------------------------------------
   ▼「オリジナルブレンドハーブティー」限定のデザイン
   （たっぷりサイズがお得、などの装飾）
--------------------------------------------------- */
.is-original-blend table tr:nth-of-type(1) {
  background-color: #faf7f0;
  border: 2px solid #d4c398;
}
.is-original-blend table tr:nth-of-type(1) th::after,
.is-original-blend table tr:nth-of-type(1) td:first-child::after {
  content: "★たっぷりサイズがお得";
  display: block;
  font-size: 11px;
  color: #c78938;
  font-weight: bold;
  margin-top: 4px;
}
.is-original-blend table tr:nth-of-type(1) .price {
  color: #cc0000;
  font-size: 1.1em;
}

/* -------------------------------------------
   カートアクション・数量ボタン
------------------------------------------- */
.p-cart-action {
  background: #faf9f6;
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.quantity-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

/* ＋−ボタン */
.qty-btn {
  width: 40px;
  height: 45px;
  background: #f5f5f5;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #555;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover {
  background: #e0e0e0;
}

/* 入力欄 */
.qty-input {
  width: 50px;
  height: 45px;
  border: none !important;
  border-left: 1px solid #ddd !important;
  border-right: 1px solid #ddd !important;
  border-radius: 0 !important;
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: none !important;
  margin: 0 !important;
}

.qty-label {
  font-weight: 600;
  font-size: 14px;
}

/* カートボタン */
.btn-add-cart {
  width: 100%;
  padding: 16px;
  background: #333;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.3s;
  display: block;
}
.btn-add-cart:hover {
  opacity: 0.8;
}

.btn-quick-order {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: #666;
  text-decoration: underline;
}

/* -------------------------------------------
   5. その他リンク・説明・モバイル調整
------------------------------------------- */
.p-meta-links {
  font-size: 12px;
  color: #888;
}
.meta-list {
  padding: 0;
  list-style: none;
  margin-bottom: 16px;
}
.meta-list li {
  margin-bottom: 4px;
}
.sns-share {
  display: flex;
  gap: 10px;
}

/* 商品説明エリア */
.product-description-area {
  max-width: 800px;
  margin: 0 auto 80px;
  line-height: 1.9;
  color: #444;
}
.desc-heading {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 32px;
  letter-spacing: 0.05em;
  font-family: serif;
}
.desc-body img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
}

/* --- モバイル固有の調整（横揺れ防止） --- */
@media (max-width: 768px) {
  #product-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 0 15px;
    box-sizing: border-box;
  }
  
  .p-title {
    font-size: 1.3rem;
  }
  .p-cart-action {
    padding: 20px;
  }
  
  /* オプション表（スマホ文字サイズ） */
  .p-options-table-wrap th {
    font-size: 13px;
    padding: 10px 8px;
    text-align: left; /* スマホでは左寄せが見やすい */
    width: 35%;
  }
  .p-options-table-wrap td {
    font-size: 13px;
    padding: 10px 5px;
  }
  
  .p-detail-info {
    padding: 0;
  }
}

/* =========================================
   モバイル表示の最終調整（表のはみ出し防止）
========================================= */
@media (max-width: 768px) {

  /* 1. 表全体の設定：横幅を画面に合わせる */
  .p-options-table-wrap table {
    width: 100% !important;
    table-layout: fixed; /* 列幅を固定してはみ出しを防ぐ */
    white-space: normal !important; /* ★重要：文字の改行を許可する */
  }

  /* 2. セルの設定：文字サイズと余白を詰める */
  .p-options-table-wrap th,
  .p-options-table-wrap td {
    font-size: 11px !important; /* 少し小さくして入るように */
    padding: 8px 4px !important; /* 余白を詰める */
    line-height: 1.4;
    word-wrap: break-word; /* 長い単語も折り返す */
  }

  /* 3. 左列（お茶の名前）の幅調整 */
  .p-options-table-wrap th {
    width: 80px !important; /* 必要最小限の幅に */
    text-align: left;
  }

  /* 4. 右列（選択肢）の幅調整 */
  .p-options-table-wrap td {
    width: auto; /* 残りのスペースを使う */
    text-align: center;
  }

  /* 5. 選択肢内の「価格」や「ラジオボタン」の配置 */
  .p-options-table-wrap label {
    display: block; /* タップしやすいようにブロック化 */
    margin-bottom: 0;
  }
  .p-options-table-wrap input[type="radio"] {
    margin: 0 0 4px 0; /* ボタンと価格の間隔 */
    transform: scale(1.2); /* ラジオボタンを少し大きく */
  }
  
  /* 6. はみ出し防止の安全策（横スクロール許可） */
  .p-options-table-wrap {
    overflow-x: auto;
    width: 100%;
    display: block;
  }
}

@media (max-width: 768px) {
  /* パンくずエリア全体の調整 */
  .breadcrumb-area {
    margin-bottom: 15px; /* 下の余白を調整 */
    font-size: 11px;     /* 文字を小さく */
    line-height: 1.4;    /* 行間を少し詰める */
  }

  /* リンク文字色を薄くする */
  .topicpath-nav a,
  .topicpath-nav .divider,
  .group-link {
    color: #999 !important; /* 薄いグレーにして目立たなくする */
  }
  
  /* タイトル（H1）の強調 */
  .p-title {
    margin-top: 20px;       /* パンくずとの距離を空ける */
    font-size: 1.4rem;      /* 必要であれば少し大きく */
    line-height: 1.3;
  }
}

/* --- 型番（キーワードタグ）のデザイン --- */
.p-hash-tag {
  font-size: 13px;
  color: #6ca889; /* ブランドカラーの緑 */
  margin-bottom: 16px;
  font-family: sans-serif;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.hash-mark {
  font-size: 1.2em; /* #だけ少し大きく */
  margin-right: 4px;
  opacity: 0.7;
}

.product-description ul.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.8em;
}

.product-description ul.feature-list li {
  position: relative;
  padding-left: 1.2em;
  margin-bottom: 1.4em;
}

.product-description ul.feature-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #b7c4b1; /* たま茶のハーブ調グリーン */
  border-radius: 50%;
  position: absolute;
  left: 0;
  top: 0.55em;
}

.bg_gray {
  display: inline-block;
  background: #f2f2f2;
  color: #555;
  font-size: 13px;
  padding: 4px 10px;
  margin: 24px 0 10px;
  letter-spacing: 0.05em;
}

/* 商品詳細の下に概要 */
.desc-lead{
  position: relative;
  margin: 0 auto 40px;
  max-width: 40em;
  font-size: 15px;
  line-height: 2.0;
  color: #555;
  letter-spacing: 0.06em;
  text-align: center;
  padding-bottom: 18px; /* 下線との距離 */
}

.desc-lead::after{
  content: "";
  display: block;
  width: 48px;          /* 短めが上品 */
  height: 1px;
  background: #bbb;     /* 薄めのグレー */
  margin: 16px auto 0;  /* 中央配置 */
}

@media (max-width: 768px){
  .desc-lead{
    font-size: 14px;
    line-height: 1.9;
    text-align: left;
  }
  .desc-lead::after{
    margin-left: 0;     /* スマホでは左寄せ */
  }
}

