/**
 * Products Page Swiper スタイル
 * コーポレートテーマと統合されたSwiperスタイル
 */

/* ================================
 * PC用タブナビゲーション
 * ================================ */
.products-tab-navigation {
  display: none; /* デフォルトは非表示 */
  position: sticky;
  top: 0;
  z-index: 1001;
  background: rgb(0 0 0 / 95%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  padding: 0;
  margin-bottom: 0;
}

.products-tab-navigation .tab-button {
  flex: 1;
  padding: 20px 15px;
  background: transparent;
  border: none;
  color: rgb(255 255 255 / 60%);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-tab-navigation .tab-button:hover {
  color: rgb(255 255 255 / 90%);
  background: rgb(255 255 255 / 5%);
}

.products-tab-navigation .tab-button.active {
  color: #fff;
  background: rgb(74 144 226 / 10%);
}

.products-tab-navigation .tab-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4a90e2, #63b8ff);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

/* PC表示時のタブモード */
@media (width >= 769px) {
  .products-tab-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1px;
    background: rgb(255 255 255 / 5%);
  }

  /* タブモード時はSwiperの高さを調整 */
  body.tab-mode #products-swiper {
    min-height: calc(100vh - 60px); /* タブバーの高さ分を引く */
  }

  /* PC画面ではドットナビゲーションを非表示 */
  .products-pagination-holder {
    display: none !important;
  }
}

/* ================================
 * Swiper基本レイアウト
 * ================================ */
#products-swiper {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background-color: var(--corporate-bg, #000);
  color: var(--corporate-text, #fff);
}

#products-swiper .swiper-wrapper {
  align-items: stretch;
}

#products-swiper .swiper-slide {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 60px 40px;
  box-sizing: border-box;
}

/* スライドコンテンツの余白調整 */
#products-swiper .slide-padded {
  padding: 80px 60px;
}

/* ブログパーツコンテナ */
#products-swiper .swiper-slide > div {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ================================
 * ページネーション（ドット）- モバイル専用
 * ================================ */

/* ================================
 * 一時的なプレースホルダー
 * （ブログパーツ設定後は削除可能）
 * ================================ */
.temp-placeholder {
  text-align: center;
  padding: 60px;
  background: linear-gradient(135deg, rgb(255 255 255 / 5%) 0%, rgb(255 255 255 / 2%) 100%);
  border-radius: 20px;
  border: 1px solid rgb(255 255 255 / 10%);
  max-width: 900px;
  margin: 0 auto;
  backdrop-filter: blur(10px);
}

.temp-placeholder h2 {
  color: var(--corporate-text, #fff);
  margin-bottom: 30px;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.temp-placeholder p {
  color: var(--corporate-text, #fff);
  opacity: 0.7;
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 15px;
}

.temp-placeholder p:last-child {
  color: #ff6b6b;
  opacity: 1;
  font-size: 0.95rem;
  margin-top: 30px;
  padding: 15px;
  background: rgb(255 107 107 / 10%);
  border-radius: 8px;
  border: 1px solid rgb(255 107 107 / 30%);
}

/* ================================
 * レスポンシブ対応
 * ================================ */

/* タブレット */
@media (width <= 1024px) {
  #products-swiper .swiper-slide {
    padding: 50px 30px;
  }

  #products-swiper .slide-padded {
    padding: 60px 40px;
  }

}

/* モバイル */
@media (width <= 768px) {
  #products-swiper .swiper-slide {
    padding: 40px 20px;
    min-height: calc(100vh - 60px); /* ヘッダー分を考慮 */
  }

  #products-swiper .slide-padded {
    padding: 40px 20px;
  }

  /* モバイルではページネーションをヘッダー下10vh位置に固定・中央寄せ */
  .products-pagination-holder {
    display: flex;
    position: fixed;
    top: calc(var(--swl-headerH, 60px) + 10px);
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    justify-content: center;
    opacity: 0; /* 初期状態は非表示、JavaScriptで制御 */
    transition: opacity 0.3s;
    z-index: 1000;
  }

  .products-pagination {
    position: static;
  }

  .products-pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    margin: 0 4px;
    background: #999;
    opacity: 1;
    transition: all 0.3s ease;
    cursor: pointer;
  }

  .products-pagination .swiper-pagination-bullet-active {
    background: #fff;
  }

  /* プレースホルダーのモバイル調整 */
  .temp-placeholder {
    padding: 40px 20px;
  }

  .temp-placeholder h2 {
    font-size: 1.8rem;
  }

  .temp-placeholder p {
    font-size: 1rem;
  }
}

/* 小型モバイル */
@media (width <= 480px) {
  #products-swiper .swiper-slide {
    padding: 30px 15px;
  }

  .temp-placeholder h2 {
    font-size: 1.5rem;
  }
}

/* ================================
 * アニメーション
 * ================================ */

/* スライド切り替えアニメーション */
.swiper-slide-active {
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* フェードイン効果 */
.products-pagination-holder {
  animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ================================
 * コーポレートテーマ統合
 * ================================ */
#body_wrap.corporate-theme-page #products-swiper {
  background-color: var(--corporate-bg);
  color: var(--corporate-text);
}

#body_wrap.corporate-theme-page .products-pagination {
  background: transparent;
  border: none;
}

#body_wrap.corporate-theme-page .products-pagination .swiper-pagination-bullet-active {
  background: var(--corporate-main);
  box-shadow: 0 0 10px var(--corporate-main);
}
