/* ===== MOBILE CONSULT COMMON ===== */
/* 모바일 메인 상담바를 기준으로 모든 페이지 통일 */

@media (max-width: 600px) {

  body.mobile-test-page .floating-consult,
  body.detail-page .detail-floating-consult {
    width: 540px !important;
    max-width: calc(100vw - 24px) !important;

    height: 78px !important;
    min-height: 78px !important;

    display: grid !important;
    grid-template-columns: 90px minmax(0, 1fr) 82px !important;
    grid-template-rows: 20px 36px !important;

    column-gap: 6px !important;
    row-gap: 6px !important;

    padding: 8px 10px !important;
    box-sizing: border-box !important;
    border-radius: 18px !important;
  }

  /* 개인정보 영역 */
  body.mobile-test-page .floating-consult > .agree,
  body.detail-page .detail-floating-consult > .agree {
    grid-column: 1 / 4 !important;
    grid-row: 1 !important;

    justify-self: start !important;
    align-self: center !important;

    margin: 0 !important;
    padding: 0 !important;
    gap: 4px !important;
  }

  /* 이름 */
  body.mobile-test-page .floating-consult > input[type="text"],
  body.detail-page .detail-floating-consult > input[type="text"] {
    grid-column: 1 !important;
    grid-row: 2 !important;

    width: 90px !important;
    min-width: 90px !important;

    height: 36px !important;
    min-height: 36px !important;

    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* 전화번호 */
  body.mobile-test-page .floating-consult > input[type="tel"],
  body.detail-page .detail-floating-consult > input[type="tel"] {
    grid-column: 2 !important;
    grid-row: 2 !important;

    width: 100% !important;
    min-width: 0 !important;

    height: 36px !important;
    min-height: 36px !important;

    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* 신청하기 */
  body.mobile-test-page .floating-consult > button[type="submit"],
  body.detail-page .detail-floating-consult > button[type="submit"] {
    grid-column: 3 !important;
    grid-row: 2 !important;

    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;

    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;

    margin: 0 !important;
    padding: 0 !important;

    font-size: 11px !important;
    box-sizing: border-box !important;
    border-radius: 999px !important;
  }
}

/* ===== MOBILE CONSULT INPUT / BUTTON HARD UNIFY ===== */
@media (max-width: 600px) {

  body.mobile-test-page .floating-consult > input[type="text"],
  body.detail-page .detail-floating-consult > input[type="text"] {
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;

    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;

    padding: 0 10px !important;
    margin: 0 !important;

    font-size: 15px !important;
    box-sizing: border-box !important;
  }

  body.mobile-test-page .floating-consult > input[type="tel"],
  body.detail-page .detail-floating-consult > input[type="tel"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;

    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;

    padding: 0 10px !important;
    margin: 0 !important;

    font-size: 15px !important;
    box-sizing: border-box !important;
  }

  body.mobile-test-page .floating-consult > input[type="text"]::placeholder,
  body.mobile-test-page .floating-consult > input[type="tel"]::placeholder,
  body.detail-page .detail-floating-consult > input[type="text"]::placeholder,
  body.detail-page .detail-floating-consult > input[type="tel"]::placeholder {
    font-size: 15px !important;
  }

  body.mobile-test-page .floating-consult > button[type="submit"],
  body.detail-page .detail-floating-consult > button[type="submit"] {
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;

    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;

    padding: 0 !important;
    margin: 0 !important;

    font-size: 11px !important;
    line-height: 36px !important;
    box-sizing: border-box !important;
  }
}

/* ===== PC CONSULT PHONE WIDTH 50% ===== */
@media (min-width: 601px) {
  body.mobile-test-page .floating-consult > input[type="tel"],
  body.detail-page .detail-floating-consult > input[type="tel"] {
    width: 50% !important;
    max-width: 50% !important;
    flex: 0 0 50% !important;
  }
}

/* ===== PC CONSULT PRIVACY BETWEEN PHONE AND SUBMIT ===== */
@media (min-width: 601px) {
  body.mobile-test-page .floating-consult,
  body.detail-page .detail-floating-consult {
    display: grid !important;
    grid-template-columns: 90px 170px auto 82px !important;
    align-items: center !important;
    column-gap: 8px !important;
  }

  /* 이름 */
  body.mobile-test-page .floating-consult > input[type="text"],
  body.detail-page .detail-floating-consult > input[type="text"] {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  /* 전화번호 */
  body.mobile-test-page .floating-consult > input[type="tel"],
  body.detail-page .detail-floating-consult > input[type="tel"] {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 170px !important;
    max-width: 170px !important;
  }

  /* 개인정보 수집 이용 동의 */
  body.mobile-test-page .floating-consult > .agree,
  body.detail-page .detail-floating-consult > .agree {
    grid-column: 3 !important;
    grid-row: 1 !important;

    margin: 0 !important;
    padding: 0 !important;

    white-space: nowrap !important;
    align-self: center !important;
  }

  /* 신청하기 */
  body.mobile-test-page .floating-consult > button[type="submit"],
  body.detail-page .detail-floating-consult > button[type="submit"] {
    grid-column: 4 !important;
    grid-row: 1 !important;
  }
}

/* ===== PC CONSULT COMPACT ALIGN FINAL ===== */
@media (min-width: 601px) {
  body.mobile-test-page .floating-consult,
  body.detail-page .detail-floating-consult {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;

    padding: 8px 10px !important;
    box-sizing: border-box !important;

    display: grid !important;
    grid-template-columns: 90px 170px auto 82px !important;
    grid-template-rows: 36px !important;

    align-items: center !important;
    column-gap: 8px !important;
    row-gap: 0 !important;
  }

  body.mobile-test-page .floating-consult > input[type="text"],
  body.detail-page .detail-floating-consult > input[type="text"],
  body.mobile-test-page .floating-consult > input[type="tel"],
  body.detail-page .detail-floating-consult > input[type="tel"],
  body.mobile-test-page .floating-consult > button[type="submit"],
  body.detail-page .detail-floating-consult > button[type="submit"] {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;

    margin: 0 !important;
    box-sizing: border-box !important;
    align-self: center !important;
  }

  body.mobile-test-page .floating-consult > .agree,
  body.detail-page .detail-floating-consult > .agree {
    height: 36px !important;
    min-height: 36px !important;

    display: flex !important;
    align-items: center !important;

    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  body.mobile-test-page .floating-consult .privacy-consent-link,
  body.detail-page .detail-floating-consult .privacy-consent-link {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
  }
}

/* ===== FLOATING TOP BUTTON ===== */
.floating-top-btn {
  position: fixed;
  right: 18px;
  bottom: 82px;

  width: 42px;
  height: 42px;

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

  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;

  background: #fff;
  color: #000;

  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);

  cursor: pointer;
  z-index: 4000;
}

.floating-top-btn svg {
  width: 18px;
  height: 18px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.floating-top-btn:hover {
  transform: translateY(-1px);
}

/* 모바일에서도 전화버튼 바로 위 */
@media (max-width: 600px) {
  .floating-top-btn {
    right: 14px;
    bottom: 76px;
  }
}

/* ===== FLOATING TOP BUTTON ALIGN WITH CALL BUTTON ===== */
.floating-top-btn {
  right: calc((100vw - min(600px, 100vw)) / 2 + 18px) !important;
  bottom: 148px !important;
}

/* 모바일에서도 동일한 우측 정렬 */
@media (max-width: 600px) {
  .floating-top-btn {
    right: 18px !important;
    bottom: 148px !important;
  }
}

/* ===== PC PRIVACY MODAL ALWAYS ON TOP ===== */
@media (min-width: 601px) {

  body.mobile-test-page .privacy-consent-modal,
  body.detail-page .privacy-consent-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 20000 !important;
  }

  body.mobile-test-page .privacy-consent-dialog,
  body.detail-page .privacy-consent-dialog {
    position: relative !important;
    z-index: 20001 !important;
  }
}

/* ===== PRIVACY MODAL ALWAYS ON TOP : PC + MOBILE ===== */
body.mobile-test-page .privacy-consent-modal,
body.detail-page .privacy-consent-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 30000 !important;
}

body.mobile-test-page .privacy-consent-dialog,
body.detail-page .privacy-consent-dialog {
  position: relative !important;
  z-index: 30001 !important;
}

/* 플로팅 버튼/헤더는 동의서보다 아래 */
body.mobile-test-page .floating-top-btn,
body.detail-page .floating-top-btn,
body.mobile-test-page .mobile-floating-call-btn,
body.detail-page .mobile-floating-call-btn,
body.mobile-test-page .site-header,
body.detail-page .site-header,
body.detail-page .nav-dropdown-menu {
  z-index: 5000 !important;
}
