.product-single-custom .item_detail .inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  max-width: 1000px;
  color: #444;
}

.product_image_area {
  flex: 0 0 66%;
  min-width: 300px;
}

.product_image_area .woocommerce-product-gallery {
  position: relative;
  margin-bottom: 20px;
}

.product_image_area .flex-viewport {
  background: #fff;
  width: 100%;
  height: auto !important;
  border: 1px solid #4444444D !important;
}

.product_image_area .woocommerce-product-gallery__image img {
  width: 100%;
  max-height: 390px !important;
  display: block;
  object-fit: cover;
  padding: 10px;
}

.product_image_area ol.flex-control-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 15px 0 0 0;
  list-style: none;
}

#contents article .woocommerce-product-gallery__wrapper a {
  display: inline;
}

#contents article .product_image_area ol li {
  padding: 0;
  margin: 0;
  background: none;
  border-left: none;
}

#contents article .product_image_area ol li:before {
  content: none;
}

.product_image_area ol.flex-control-thumbs li img {
  aspect-ratio: 1.41 / 1;
  cursor: pointer;
}

.product_image_area ol.flex-control-thumbs li img {
  width: 100%;
  height: auto;
  border: 1px solid #eee;
  border-radius: 2px;
  object-fit: cover;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.product_image_area ol.flex-control-thumbs li img.flex-active {
  opacity: 1;
}

/* 画像ズーム（🔍マーク）のボタンを右上に配置 */
.woocommerce-product-gallery__trigger {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  text-decoration: none;
  background: rgba(255,255,255,0.8);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
}

/* スライダーボタン */
.product_image_area .woocommerce-product-gallery {
  position: relative !important;
}

.custom-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: #A6B8C3;
  border-radius: 50%;
  z-index: 999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}

.custom-arrow:hover {
  opacity: 0.7;
}

.custom-arrow::before {
  content: '';
  width: 10px;
  height: 10px;
  border-top: 2px solid #444444;
  border-right: 2px solid #444444;
  display: block;
}

.arrow-prev {
  left: 10px;
}

.arrow-prev::before { 
  transform: rotate(-135deg); margin-left: 4px;
}

.arrow-next {
  right: 10px;
}

.arrow-next::before {
  transform: rotate(45deg); margin-right: 4px;
}

/* 右側：情報エリア */
.product_info_area {
  flex: 0 0 30%;
  text-align: left;
}

#contents article h1.product_title {
  font-size: 20px;
  font-weight: bold;
  margin: 40px 0 20px;
  line-height: 1.6;
  color: #444;
  position: relative;
}

#contents article .product_title:before {
  content: "";
  position: absolute;
  top: 2px; 
  left: 0;
  width: 5px;
  height: 1.4em;
  background: #a6b8c3;
  padding: 0; 
  margin-right: 0;
}

.price_display {
  font-size: 14px;
  text-align: right;
  margin-bottom: 20px;
}

.cart_action .single_add_to_cart_button {
  width: 100%;
  background-color: #444 !important;
  color: #fff !important;
  padding: 12px !important;
  border: none !important;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

.cart_action .single_add_to_cart_button:hover {
  opacity: 0.8;
}

/* 注釈テキスト */
.free_download_note {
  font-size: 12px;
  color: rgba(68, 68, 68, 0.8);
  margin-top: 10px;
  line-height: 1.5;
}

.product_description {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(68, 68, 68, 0.3);
  font-size: 14px;
  line-height: 1.8;
}

.product_meta_custom {
  margin-top: 20px;
  font-size: 14px;
  border-top: 1px solid rgba(68, 68, 68, 0.3);
  padding-top: 10px;
}

/* 関連商品エリア */
.related_products_area {
  margin: 0 100px 0 100px;
}
.related_products_area .inner {
  max-width: 1000px;
  margin: 60px auto;
}

.related_products_area .related.products > h2 {
  display: none;
}

.custom_related_title {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
  color: #444;
  margin-bottom: 30px;
}

.custom_related_title::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background: #e0e0e0;
  margin-left: 20px;
}

.related_products_area ul.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 35px;
  list-style: none;
  padding: 0;
}

.related_products_area ul.products li.product {
  width: 100%;
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.related_products_area ul.products li.product img {
  border: 1px solid #4444444D;
  width: 100%;
  height: auto;
  padding: 5px;
  aspect-ratio: 1.41 / 1;
  object-fit: cover;
}

.related_products_area ul.products li.product .woocommerce-loop-product__title {
  font-size: 16px;
  font-weight: bold;
  line-height: 1.6;
  color: #444;
  padding: 0;
}

.related_products_area ul.products li.product .price {
  text-align: right;
  font-size: 14px;
  color: #444;
  margin-top: auto;
  display: block;
}

.related_products_area ul.products li.product .button {
  display: none;
}

@media screen and (max-width: 768px) {
  .product-single-custom .item_detail .inner {
    flex-direction: column;
  }
  .product_image_area, .product_info_area {
    flex: 0 0 100%;
    width: 100%;
  }

  .product_image_area ol.flex-control-thumbs {
    gap: 0 10px;
  }

  .product_image_area .woocommerce-product-gallery__image img {
    height: auto !important;
  }

  #contents article h1.product_title {
    margin: 0 0 20px;
  }

  .related_products_area ul.products {
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px;
  }

  .custom_related_title {
    font-size: 18px;
  }
}

@media screen and (max-width: 480px) {
  .related_products_area {
    margin: 0 30px 0 30px;
  }
}