/* -----------------------------
  フローティングボタン
----------------------------- */
/* フローティング共通 */
.mobile-br {
  display: none;
}


.floating-wrapper {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.floating-wrapper.show {
  opacity: 1;
  visibility: visible;
}
/* 親：位置だけ */
.floating-btn {
  position: fixed;
  right: 20px;
  z-index: 5000;
  text-decoration: none;
}

/* 外側：hoverの拡大担当 */
.btn-outer {
  display: inline-block;
  transition: transform 0.2s ease;
}

/* 内側：ボヨン担当 */
.btn-inner {
  display: inline-block;
  font-weight: 700;
  opacity: 0.8;
  color: #fff;
  font-size: clamp(0.5rem, 5vw, 1.2rem);
  background-color: #000;
  padding: 10px 15px;
  border-radius: 8px;

  animation: floatBounce 6s infinite;
  transform-origin: center;
  will-change: transform;

  transition: opacity 0.2s ease, background-color 0.2s ease;
}

/* hover：外側だけ拡大 */
.floating-btn:hover .btn-outer {
  transform: scale(1.2);
}

/* hover時：内側のアニメ止める */
.floating-btn:hover .btn-inner {
  animation-play-state: paused;
  opacity: 1;
}

/* ボヨン */
@keyframes floatBounce {
  0%, 90%, 100% {
    transform: scale(1);
  }
  93% {
    transform: scale(1.12);
  }
  96% {
    transform: scale(0.95);
  }
  98% {
    transform: scale(1.05);
  }
}



/* コミッションOpenボタン */
.commission-open-btn{
  bottom: 50%;
}


/* トップボタン */
.top-btn{
  bottom: 60px;
  padding: 10px 15px;   
  display: flex;
  flex-direction: column; /* 縦方向に並べる */
  justify-content: center;
  align-items: center;
  border-radius: 8px;

  background-color: rgba(255, 255, 255, 0.7); /* 70%の白背景 */
  color: #333333; /* 濃いめのグレー文字 */
  border: 2px solid #333333; /* 濃いめのグレー縁取り */
  font-weight: 700;
  text-decoration: none; /* ホバー時のアンダーラインを消す */
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1rem;
}
.top-btn:hover {
  text-decoration: none;
  background-color: rgba(255, 255, 255, 0.9); /* 少し明るくなる */
}


/* 無料見積もりボタン */
.free-estimate-btn{
  bottom: calc(50vh + 40px);
}

/* お問い合わせ */
.floating-contact-btn{
  bottom: calc(50vh - 40px);
}


@media (max-width: 600px) {

  .mobile-br{
    display: inline;
  }

  /* 親は触らない（ここがポイント） */
  .floating-btn {
    right: 0;
  }

  /* 見た目は全部 inner に */
  .btn-inner {
    width: 40px;
    min-height: 80px;
    padding: 6px 2px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    font-size: 0.7rem;
    line-height: 1.2rem;

    text-align: center;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow: hidden;

    writing-mode: vertical-rl;
    text-orientation: mixed;

    border-radius: 8px 0 0 8px;
  }

  /* 個別調整 */
  .commission-open-btn .btn-inner {
    line-height: 2.5rem;
  }

  .free-estimate-btn {
    top: calc(50% - 50px);
    bottom: auto;
  }

  .floating-contact-btn {
    top: calc(50% + 50px);
    bottom: auto;
  }

  /* topボタンは別物なのでそのまま */
  .top-btn {
    width: 15px;
    height: 15px;
    padding: 10px 10px;
    min-height: 0;
    writing-mode: horizontal-tb;
    border-radius: 8px;
    right: 5px;
  }
}