body {
  margin: 0;
  font-family: sans-serif;
  background: #f9f9f9;
  padding-bottom: 60px;
}

.photo-gallery {
  width: 100%;
  max-width: 400px;
  margin: 20px auto 0;
}

.main-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3; /* 横:縦 = 4:3 */
  overflow: hidden;
  border-radius: 8px;
  background-color: #ddd; /* 画像読み込み失敗時にグレー表示 */
}

.main-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 画像を枠いっぱいに表示 */
  display: block;
  border-radius: 8px;
  user-select: none;
  pointer-events: none;
}

/* 戻るボタン */
.btn-back {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(128, 128, 128, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.btn-back img {
  width: 20px;
  height: 20px;
}

/* ギフトボタン */
.btn-gift {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(128, 128, 128, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  color: white;
  font-size: 12px;
}

.btn-gift img {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}

/* サムネイルリスト */
.thumbnail-list {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch; /* スムーズスクロール対応 */
}

.thumbnail-list img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.7;
  border: 2px solid transparent;
  transition: opacity 0.3s ease, border-color 0.3s ease;
  flex-shrink: 0;
  user-select: none;
}

.thumbnail-list img.active,
.thumbnail-list img:hover {
  opacity: 1;
  border-color: #007bff;
}

.info {
  padding: 10px;
}

/* ショップ名スタイル */
.shop {
  width: 80%;
  font-size: 12px; /* モバイル向けにフォントサイズを調整 */
  color: #545454;
}

/* 商品詳細ページのスタイル */
.product-details {
  padding: 10px;
}

.product-info {
  margin-bottom: 20px;

  h1 {
    font-size: 14px; /* モバイル向けにフォントサイズを調整 */
    margin: 10px 0 5px 0;
    font-weight: bold;
    color: #333;
  }
}

.rating {
  display: flex;
  font-size: 16px;
  align-items: center;
  padding: 0 5px 10px;

}

.rating-value {
  font-weight: bold;
  color: #ffb906;
}

.review-count {
  color: #666666;
  font-size: 16px;
}

.star {
  font-size: 16px;
  color: #c4c4c4;
  margin-right: -2px;
  letter-spacing: -1px;
}

.star.full {
  color: #ffb906;
}

.star.half {
  background: linear-gradient(to right, #ffb906 50%, #c4c4c4 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.star.empty {
  color: #c4c4c4;
}

/* 価格のスタイル */
.product-info p2 {
  color: #e74c3c; /* 価格の色を赤に */
  font-weight: bold;
  font-size: 20px; /* モバイル向けにフォントサイズを調整 */
  padding: 10px 0px 10px 5px;
}

/* 通常スタイル */
.product-info p3 {
  font-size: 12px; /* モバイル向けにフォントサイズを調整 */
  color: #333333;
  padding: 10px 0px 10px 5px;
}

/* 強調スタイル */
.product-info p4 {
  font-size: 16px; /* モバイル向けにフォントサイズを調整 */
  font-weight: bold;
  color: #333333;
  margin: 5px 0;
  padding: 10px 0px 10px 5px;
}

/* 固定バー */
.buy-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid #ccc;
  text-align: center;
  padding: 12px 0;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
  z-index: 20;
}

/* rakutenボタン */
.buy-button {
  background-color: #AC0517;
  border: 2px solid #AC0517;
  border-radius: 30px;
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  
  /* 追加部分 */
  width: 80%;
  justify-content: center;
  margin: 0 auto;
  display: flex; /* inline-flex → flex に変更 */
  color: #FFF;
  text-decoration: none;
}

.buy-button img {
  width: 30px;
  height: 30px;
}

.buy-button span {
  font-size: 16px;
  font-weight: bold;
}

/* タブレット・PC用レイアウト補強 */
@media screen and (min-width: 768px) {
  #productDetailContainer {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 30px;
  }

  .main-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像を枠いっぱいに表示 */
    display: block;
    border-radius: 8px;
    user-select: none;
    pointer-events: none;
  }

  /* 戻るボタン */
  .btn-back {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(128, 128, 128, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
  }

  .btn-back img {
    width: 20px;
    height: 20px;
  }

  .photo-gallery {
    max-width: 50%;
    margin: 0;
  }

  .info {
    max-width: 50%;
    padding: 0;
  }

  .product-info h1 {
    font-size: 20px;
  }

  .product-info p2 {
    font-size: 24px;
  }

  .product-info p3,
  .product-info p4 {
    font-size: 14px;
  }

}

