/* ============================================
   Amazon風カルーセル + ギャラリーモーダル
   aks-gallery.css
   ============================================ */

/* --- カルーセルコンテナ --- */
.item-detail-photo {
  position: relative !important;
  width: 100% !important;
  overflow: hidden !important;
  background: #fff;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
}

/* スライドトラック */
.aks-track {
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -webkit-box-orient: horizontal !important;
  -webkit-box-direction: normal !important;
  -ms-flex-direction: row !important;
  flex-direction: row !important;
  -ms-flex-wrap: nowrap !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  /* 重なり防止：floatやposition継承をリセット */
  position: relative !important;
  top: auto !important;
  left: auto !important;
  float: none !important;
}

/* 各スライド */
.aks-slide {
  -webkit-box-flex: 0 !important;
  -ms-flex: 0 0 100% !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -webkit-box-align: center !important;
  -ms-flex-align: center !important;
  align-items: center !important;
  -webkit-box-pack: center !important;
  -ms-flex-pack: center !important;
  justify-content: center !important;
  cursor: zoom-in;
  /* 重なり防止 */
  position: relative !important;
  float: none !important;
  box-sizing: border-box !important;
}

.aks-slide img {
  width: 100% !important;
  height: auto !important;
  max-height: 100vw !important;
  object-fit: contain !important;
  display: block !important;
  pointer-events: none;
  /* 位置ズレ防止 */
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  float: none !important;
}

/* ドットインジケーター */
.aks-dots {
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -webkit-box-pack: center !important;
  -ms-flex-pack: center !important;
  justify-content: center !important;
  gap: 6px;
  padding: 8px 0 4px;
  position: relative !important;
  float: none !important;
  clear: both;
}

.aks-dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background: #ccc !important;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
  display: block !important;
  float: none !important;
}

.aks-dot.active {
  background: #c45500 !important;
  transform: scale(1.3);
}

/* PC（769px以上）は元のflicksimpleをそのまま使用 */
@media (min-width: 769px) {
  .aks-track,
  .aks-dots {
    display: none !important;
  }
}

/* ============================================
   ギャラリーモーダル
   ============================================ */
#aks-modal {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 9999 !important;
  background: rgba(0, 0, 0, 0.92) !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#aks-modal.open {
  display: flex !important;
}

.aks-modal-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1;
  box-sizing: border-box;
}

.aks-modal-close {
  background: none !important;
  border: none !important;
  color: #fff !important;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.aks-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 8px;
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}

.aks-modal-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: #111;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.aks-modal-thumb.selected {
  border-color: #c45500;
}

.aks-modal-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  display: block !important;
}

/* ============================================
   フルビュー
   ============================================ */
#aks-fullview {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 10000 !important;
  background: #000 !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#aks-fullview.open {
  display: flex !important;
}

#aks-fullview img {
  max-width: 100% !important;
  max-height: 90vh !important;
  object-fit: contain;
  width: auto !important;
  height: auto !important;
}

#aks-fullview-close {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  background: none !important;
  border: none !important;
  color: #fff !important;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}