/* メインスライダーのラッパー */
.main-slider-wrapper {
  margin: 20px 0;
  position: relative;
}

/* メインFlexSliderのスタイル */
.flexslider.main-image-slider {
  margin: 0;
  background: transparent;
  border: none;
  position: relative;
  border-radius: 0;
  box-shadow: none;
  padding-bottom: 0;
}

.flexslider.main-image-slider .slides {
  zoom: 1;
  margin: 0;
  padding: 0;
}

.flexslider.main-image-slider .slides li {
  margin: 0;
  padding: 0;
}

.flexslider.main-image-slider .slides .zoomItemPic-slider {
  display: block;
  cursor: pointer;
  text-decoration: none;
}

.flexslider.main-image-slider .slides img.main-slide-img {
  width: 100%;
  height: auto;
  display: block;
  -moz-user-select: none;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.flexslider.main-image-slider .slides .zoomItemPic-slider:hover img.main-slide-img {
  opacity: 0.95;
}

/* 常時表示の半透明矢印（オーバーレイ） */
.flexslider.main-image-slider .flex-direction-nav {
  margin: 0 !important;
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 15;
}

.flexslider.main-image-slider .flex-direction-nav a {
  text-decoration: none;
  display: block;
  width: 45px;
  height: 45px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 16;
  overflow: hidden;
  opacity: 0.3; /* 常時半透明で表示 */
  cursor: pointer;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border-radius: 50%;
  pointer-events: auto;
  -webkit-transition: all 0.3s ease-in-out;
  -moz-transition: all 0.3s ease-in-out;
  -ms-transition: all 0.3s ease-in-out;
  -o-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
}

.flexslider.main-image-slider .flex-direction-nav a:before {
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: bold;
  display: inline-block;
  color: white;
  line-height: 45px;
  text-align: center;
  width: 100%;
}

.flexslider.main-image-slider .flex-direction-nav .flex-prev:before {
  content: '＜';
}

.flexslider.main-image-slider .flex-direction-nav .flex-next:before {
  content: '＞';
}

.flexslider.main-image-slider .flex-direction-nav .flex-prev {
  left: 15px;
}

.flexslider.main-image-slider .flex-direction-nav .flex-next {
  right: 15px;
}

/* ホバー時に矢印を少し濃くする */
.flexslider.main-image-slider .flex-direction-nav .flex-prev:hover,
.flexslider.main-image-slider .flex-direction-nav .flex-next:hover {
  opacity: 0.7;
  background: rgba(0, 0, 0, 0.6);
}

/* ページネーションを完全に非表示 */
.flexslider.main-image-slider .flex-control-nav {
  display: none !important;
}

/* カスタムサムネイル表示エリア */
.custom-thumbnails-container {
  margin-top: 20px;
  padding: 0;
}

.custom-thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  max-width: 100%;
  overflow: visible;
}

.custom-thumb-item {
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: #f8f8f8;
  transition: all 0.3s ease;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.custom-thumb-item:hover {
  border-color: #ccc;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.custom-thumb-item:hover img {
  opacity: 0.9;
}

.custom-thumb-item.active {
  border-color: #333;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.custom-thumb-item.active img {
  opacity: 1;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .flexslider.main-image-slider .flex-direction-nav .flex-prev {
    left: 10px;
  }

  .flexslider.main-image-slider .flex-direction-nav .flex-next {
    right: 10px;
  }

  .flexslider.main-image-slider .flex-direction-nav a {
    width: 38px;
    height: 38px;
    opacity: 0.25; /* モバイルではさらに薄く */
  }

  .flexslider.main-image-slider .flex-direction-nav a:before {
    line-height: 38px;
    font-size: 16px;
  }

  /* サムネイルを4個並びに変更 */
  .custom-thumbnails-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .flexslider.main-image-slider .flex-direction-nav a {
    width: 32px;
    height: 32px;
    opacity: 0.2;
  }

  .flexslider.main-image-slider .flex-direction-nav a:before {
    line-height: 32px;
    font-size: 14px;
  }

  .flexslider.main-image-slider .flex-direction-nav .flex-prev {
    left: 8px;
  }

  .flexslider.main-image-slider .flex-direction-nav .flex-next {
    right: 8px;
  }

  /* サムネイルを3個並びに変更 */
  .custom-thumbnails-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .custom-thumbnails-container {
    margin-top: 15px;
  }
}