/* LUT Before/After Comparison Styles - 商品画像ギャラリー風 */
.lut-comparison-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.lut-comparison-sub-wrapper {
  width: 60%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* 各比較アイテム */
.lut-comparison-item {
  position: relative;
  background: #f8f8f8;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16/9;
}

/* 画像サイズの制限 */
.lut-comparison-item .twentytwenty-wrapper {
  width: 100%;
  height: 100%;
}

.lut-comparison-item .twentytwenty-container {
  width: 100% !important;
  height: 100% !important;
}

/* タブレット・スマホ表示 - 商品画像と同じブレークポイント */
@media screen and (max-width: 768px) {
  .lut-comparison-wrapper {
    margin-top: 30px;
    padding: 0 15px;
  }

  .lut-comparison-sub-wrapper {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

/* さらに小さい画面 */
@media screen and (max-width: 480px) {
  .lut-comparison-sub-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.lut-comparison-label {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  padding: 15px 20px;
  text-align: center;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  color: #333;
}

/* TwentyTwenty Container - 重要なスタイル調整 */
.twentytwenty-wrapper {
  width: 100% !important;
  max-width: 100% !important;
}

.twentytwenty-container {
  position: relative !important;
  overflow: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
}

.twentytwenty-container img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
}

.twentytwenty-container img.twentytwenty-before {
  z-index: 20 !important;
}

.twentytwenty-container img.twentytwenty-after {
  z-index: 10 !important;
}

/* ハンドルとオーバーレイのカスタマイズ - より具体的なセレクタで上書き */
.lut-comparison-item .twentytwenty-container .twentytwenty-handle {
  z-index: 40 !important;
  width: 16px !important;  /* 円形サイズ */
  height: 16px !important;  /* 円形サイズ */
  margin-left: -8px !important;  /* 中央揃え調整（幅の半分） */
  margin-top: -8px !important;  /* 中央揃え調整（高さの半分） */
  top: 50% !important;
  cursor: col-resize !important;
  border-radius: 50% !important;  /* 円形に */
  background: transparent !important;  /* 透明背景 */
  border: 2px solid #fff !important;  /* ボーダーのみ */
  box-shadow: 0 0 6px rgba(0,0,0,0.4) !important;
}

/* ハンドルの中央の線を細く */
.lut-comparison-item .twentytwenty-handle:before,
.lut-comparison-item .twentytwenty-handle:after {
  width: 2px !important;
  background: #fff !important;
  box-shadow: 0 0 3px rgba(0,0,0,0.5) !important;
}

/* 左右の矢印をカスタマイズ */
.lut-comparison-item .twentytwenty-handle span.twentytwenty-left-arrow,
.lut-comparison-item .twentytwenty-handle span.twentytwenty-right-arrow {
  width: 0 !important;
  height: 0 !important;
  border: 7px solid transparent !important;
  position: absolute !important;
  top: 50% !important;
  margin-top: -7px !important;
}

.lut-comparison-item .twentytwenty-handle span.twentytwenty-left-arrow {
  border-right: 7px solid #fff !important;
  border-left: none !important;
  left: -2px !important;  /* 適度な間隔 */
}

.lut-comparison-item .twentytwenty-handle span.twentytwenty-right-arrow {
  border-left: 7px solid #fff !important;
  border-right: none !important;
  right: -2px !important;  /* 適度な間隔 */
}

.twentytwenty-overlay {
  z-index: 30 !important;
}


/* Loading state */
.lut-comparison-item.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Hover effect */
.lut-comparison-item {
  transition: all 0.3s ease;
}

.lut-comparison-item:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

/* Zoom button */
.lut-zoom-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 0;
}

.lut-zoom-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.lut-zoom-btn .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  line-height: 20px;
  color: #333;
  display: block;
}

/* Shortcode Version Styles */
.lut-comparison-shortcode {
  width: 100%;
}

.lut-comparison-shortcode .lut-comparison-item {
  width: 100%;
  max-width: 100%;
  position: relative;
  background: #f8f8f8;
  border-radius: 4px;
  overflow: hidden;
}

.lut-comparison-shortcode .lut-comparison-label {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  padding: 15px 20px;
  text-align: center;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  color: #333;
}

.lut-comparison-shortcode .twentytwenty-container {
  width: 100% !important;
  max-width: 100% !important;
}

/* Lightbox Styles */
.lut-lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.95);
  animation: fadeIn 0.3s;
}

.lut-lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lut-lightbox-close {
  position: absolute;
  top: 15px;
  right: 35px;
  font-size: 40px;
  font-weight: bold;
  color: #f1f1f1;
  cursor: pointer;
  z-index: 10000;
  transition: 0.3s;
}

.lut-lightbox-close:hover,
.lut-lightbox-close:focus {
  color: #bbb;
}

.lut-lightbox-content {
  position: relative;
  margin: auto;
  padding: 20px;
  width: 90%;
  max-width: 1200px;
  animation: slideIn 0.3s;
}

@keyframes slideIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lut-lightbox-container {
  position: relative;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
}

.lut-lightbox-container .twentytwenty-container {
  width: 100% !important;
  max-width: none !important;
}

.lut-lightbox-container img {
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .lut-lightbox-content {
    width: 95%;
    padding: 10px;
  }

  .lut-lightbox-close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }
}