.slide-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: #fff;
  overflow-y: auto;
  z-index: 9999;
  transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch; /* iOSでのスクロールを滑らかに */
}

@media (min-width: 900px) {
  .slide-panel {
    width: calc(100% - 500px);
    right: -80%;
    top: 100px;
    height: calc(100% - 100px);
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
  }
  .slide-panel .txt_content {
    flex: 1;
    min-height: 0;
    height: auto;
  }
}

@media screen and (max-width: 900px) {
  .slide-panel {
    top: 70px;
    height: calc(100% - 70px);
    min-height: calc(100vh - 70px);
  }
}

.slide-panel.active {
  right: 0;
}

.slide-panel-close {
  position: absolute;
  top: 120px;
  right: 90px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  z-index: 1001;
}

@media screen and (max-width: 900px) {
  .slide-panel-close {
    display: none;
  }
}

.slide-panel-close:before,
.slide-panel-close:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: #b0b0b0;
  transition: background 0.3s ease;
}

.slide-panel-close:before {
  transform: rotate(45deg);
}

.slide-panel-close:after {
  transform: rotate(-45deg);
}

.slide-panel-close:hover:before,
.slide-panel-close:hover:after,
.slide-panel-close.will-close:before,
.slide-panel-close.will-close:after {
  background: #000;
}

body.panel-open {
  overflow: hidden;
}

#slide-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9997;
  cursor: pointer;
}

/* モバイル向け調整 */
@media (max-width: 767px) {
  .slide-panel-close {
    top: 20px;
    right: 20px;
  }

  /* モバイルでのスクロールを改善 */
  .slide-panel {
    -webkit-overflow-scrolling: touch;
  }
}

/* ローディングアニメーション */
#loading {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 9999;
}

#loading div {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #333;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* アニメーション無効化クラス */
.no-animation {
  transition: none !important;
  animation: none !important;
}

