@charset "UTF-8";
/* ============================================================
   かんたん見積もり（追従ボタン＋モーダル）
   footer.php / js/estimate-modal.js とセットで使用
============================================================ */

/* ---------- 追従ボタン（右下） ---------- */
.estimate-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  background: var(--primary-black, #222);
  color: #fff;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition: transform .2s ease, background-color .2s ease, opacity .3s ease;
}
.estimate-fab:hover {
  background: var(--color-accent-blue, #19A3A3);
  transform: translateY(-2px);
}
.estimate-fab:focus-visible {
  outline: 3px solid var(--color-accent-blue, #19A3A3);
  outline-offset: 3px;
}
.estimate-fab__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
/* モーダル表示中はボタンを隠す */
.is-estimate-open .estimate-fab {
  opacity: 0;
  pointer-events: none;
}

/* PAGE TOP ボタンと重ならないよう上にずらす */
.pagetop {
  bottom: calc(24px + 56px + 24px) !important;
}

/* ---------- モーダル ---------- */
.estimate-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s ease, visibility .3s ease;
}
.estimate-modal.is-open {
  visibility: visible;
  opacity: 1;
}
.estimate-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(34, 34, 34, 0.92);
}
.estimate-modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 28px 40px 40px;
  border-radius: 40px;
  background: #e8e8e8;
  transform: translateY(16px);
  transition: transform .3s ease;
}
.estimate-modal.is-open .estimate-modal__dialog {
  transform: translateY(0);
}
.estimate-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.estimate-modal__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary-black, #222);
}
.estimate-modal__close {
  position: relative;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
}
.estimate-modal__close::before,
.estimate-modal__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary-black, #222);
  transition: background-color .2s ease;
}
.estimate-modal__close::before { transform: translate(-50%, -50%) rotate(25deg); }
.estimate-modal__close::after  { transform: translate(-50%, -50%) rotate(-25deg); }
.estimate-modal__close:hover::before,
.estimate-modal__close:hover::after { background: var(--color-accent-blue, #19A3A3); }

.estimate-modal__body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 28px;
  background: #fff;
}

/* ---------- イントロ画面 ---------- */
.estimate-intro {
  height: 100%;
  overflow-y: auto;
  padding: 64px 48px 48px;
  text-align: center;
}
.estimate-intro__heading {
  margin-bottom: 32px;
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: var(--primary-black, #222);
}
.estimate-intro__text {
  font-size: 16px;
  font-weight: 500;
  line-height: 2;
  color: var(--primary-black, #222);
}
.estimate-intro__text + .estimate-intro__text {
  margin-top: 24px;
}
.estimate-intro__start {
  display: block;
  width: 100%;
  max-width: 620px;
  margin: 40px auto 0;
  padding: 26px 24px;
  border: none;
  border-radius: 8px;
  background: var(--color-accent-blue, #19A3A3);
  color: #fff;
  font-family: "Noto Sans JP", sans-serif;
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
}
.estimate-intro__start:hover {
  opacity: .85;
  transform: translateY(-1px);
}
.estimate-intro__note {
  margin-top: 24px;
  font-size: 12px;
  line-height: 1.7;
  color: #666;
}

.estimate-br-sp { display: none; }

/* ---------- 見積もりツール（iframe） ---------- */
.estimate-frame {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 60vh;
  border: 0;
}
.estimate-modal.is-started .estimate-intro { display: none; }
.estimate-modal.is-started .estimate-frame { display: block; }
.estimate-modal.is-started .estimate-modal__dialog { height: calc(100vh - 48px); height: calc(100dvh - 48px); }

/* 背景スクロール固定 */
html.is-estimate-open,
html.is-estimate-open body {
  overflow: hidden;
}

/* ---------- SP ---------- */
@media (max-width: 767px) {
  .estimate-fab {
    right: 12px;
    bottom: 12px;
    padding: 14px 18px;
    font-size: 14px;
  }
  .pagetop {
    bottom: calc(12px + 48px + 16px) !important;
  }
  .estimate-modal {
    padding: 12px;
  }
  .estimate-modal__dialog {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 16px 12px 12px;
    border-radius: 24px;
  }
  .estimate-modal.is-started .estimate-modal__dialog {
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
  }
  .estimate-modal__head {
    margin-bottom: 12px;
    padding: 0 8px;
  }
  .estimate-modal__body {
    border-radius: 18px;
  }
  .estimate-intro {
    padding: 40px 16px 32px;
  }
  .estimate-intro__text {
    font-size: 13px;
    line-height: 1.9;
    letter-spacing: 0.02em;
  }
  .estimate-br-sp { display: inline; }
  .estimate-intro__start {
    margin-top: 32px;
    padding: 20px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .estimate-fab,
  .estimate-modal,
  .estimate-modal__dialog { transition: none; }
}
