/* =========================================================
   고객센터(contact-tabs 템플릿) 스타일 — 2026 토스 디자인 시스템 적용
   tokens.css 변수 기반. 기존 페이지 본문 인라인 <style>을 대체한다.
   대상: 묻고답하기(10622), FAQ(10615), OEM(10611)
   ========================================================= */

/* 스크롤 페이드인은 전역 공통(layout.css .js-motion .fade-in) 사용 */

/* ---------- 구분선 (카탈로그 페이지 사용) ---------- */
.divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin: 80px 0;
}

/* ---------- 탭 내비게이션 ---------- */
.tab-nav {
  margin-top: -27px;   /* 헤더에 붙임 (PC·모바일 공통) */
  margin-bottom: 15px;
  z-index: 100;
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: center;
  gap: 0;
  transition: box-shadow 0.3s;
}
.tab-nav.fixed {
  margin-top: 0 !important;
  position: fixed !important;
  top: 91px !important;  /* 헤더 높이 */
  left: 0 !important;
  width: 100% !important;
  z-index: 9999;
  background: var(--color-canvas);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.tab-nav a {
  position: relative;
  padding: 20px 40px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-muted);
  text-decoration: none;
  word-break: keep-all;
  transition: color 0.3s;
}
.tab-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}
.tab-nav a:hover,
.tab-nav a.active {
  color: var(--color-foreground);
}
.tab-nav a.active::after {
  width: 100%;
}
@media (max-width: 768px) {
  .tab-nav a {
    padding: 16px 12px;
    font-size: 12px;
  }
  .tab-nav.fixed {
    top: 61px !important;  /* 모바일 헤더 높이 */
  }
}

/* =========================================================
   묻고 답하기 - Contact Form 7
   (!important는 layout.css의 .form_box 계열 규칙 방어용)
   ========================================================= */
.ys-contact-wrap .ys-contact,
.ys-contact-wrap form.wpcf7-form {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.ys-contact {
  font-family: var(--font-sans);
  color: var(--color-body);
  box-sizing: border-box;
}
.ys-contact *,
.ys-contact *::before,
.ys-contact *::after { box-sizing: border-box; }

/* 약관 동의 박스 */
.ys-contact .agree_box {
  width: 100%;
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button-large);
  padding: 16px 20px;
  margin: 0 0 35px 0 !important;
  text-align: center;
}
.ys-contact .agree_box .agree_desc { display: none; }
.ys-contact .agree_box .agree_check {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-body);
  text-align: center !important;
}
.ys-contact .agree_box input[type="checkbox"] {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 8px;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.ys-contact .agree_box .wpcf7-list-item { margin: 0; }
.ys-contact .agree_box .wpcf7-list-item-label { vertical-align: middle; cursor: pointer; }

/* "연락하기" 헤더 */
.ys-contact .form_title {
  display: block;
  width: 100%;
  text-align: center;
  margin: 0 0 30px 0;
  padding: 0 0 8px 0;
  border-bottom: none;
  background: transparent;
}
.ys-contact .form_title h2 {
  font-size: var(--type-h3-size);
  font-weight: 700;
  color: var(--color-foreground);
  margin: 0;
  letter-spacing: -0.3px;
  background: transparent;
}

/* 폼 본체 */
.ys-contact .form_box {
  display: block !important;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* form_info / form_desc 세로 스택 */
.ys-contact .form_info,
.ys-contact .form_desc {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
  gap: 14px;
  margin: 0 0 14px 0;
}

/* 입력 카드 — 토스 텍스트필드(box형):
   회색 채움 + 테두리 없음 → 포커스 시 흰 배경 + 시그니처 블루 테두리 */
.ys-contact .ys-input-box {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100%;
  background: var(--color-surface);
  border: 1.5px solid transparent !important;
  border-radius: var(--radius-button-large);
  padding: 12px 16px !important;
  transition: border-color .15s ease, background .15s ease;
  margin: 0 !important;
  gap: 6px;
  position: relative;
}
.ys-contact .ys-input-box:focus-within {
  background: var(--color-canvas);
  border-color: var(--color-primary) !important;
}
.ys-contact .ys-input-box.has-error,
.ys-contact .ys-input-box:has(.wpcf7-not-valid-tip) { border-color: var(--color-danger) !important; }

/* 자동 삽입 p태그·CF7 span 래퍼 레이아웃 무력화 */
.ys-contact .ys-input-box > p,
.ys-contact .ys-input-box > span.wpcf7-form-control-wrap {
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  position: static;
}

/* 라벨 — 포커스 시 시그니처 블루 */
.ys-contact .ys-span {
  display: block;
  width: 100%;
  font-weight: 600;
  color: var(--color-muted);
  font-size: 13px;
  margin: 0 !important;
  padding: 0;
  transition: color .15s ease;
}
.ys-contact .ys-input-box:focus-within .ys-span { color: var(--color-primary); }

/* 필수 별표 */
.ys-contact .ys-req {
  color: var(--color-danger) !important;
  font-weight: 700 !important;
  margin-left: 2px !important;
  font-style: normal !important;
  position: static !important;
  float: none !important;
  display: inline !important;
  line-height: inherit !important;
}

/* 입력 필드 초기화 (테두리 중복 방지) */
.ys-contact input[type="text"],
.ys-contact input[type="tel"],
.ys-contact input[type="email"],
.ys-contact select,
.ys-contact textarea {
  width: 100% !important;
  min-width: 0;
  max-width: 100%;
  border: none !important;
  background: transparent !important;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--color-foreground);
  padding: 4px 0 !important;
  outline: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  box-sizing: border-box;
}

/* select 화살표 */
.ys-contact select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%238b95a1' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 24px !important;
  cursor: pointer;
}

/* textarea */
.ys-contact textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

/* 에러 메시지 */
.ys-contact .wpcf7-not-valid-tip {
  display: block;
  width: 100%;
  font-size: 12px;
  color: var(--color-danger) !important;
  font-weight: 500;
  margin: 6px 0 0 0 !important;
  padding: 0;
  background: transparent;
  line-height: 1.4;
  position: static;
  white-space: normal;
}

/* CF7 전체 응답 메시지 */
.ys-contact .wpcf7-response-output {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  margin: 20px 0 0;
  text-align: center;
}

/* reCAPTCHA */
.ys-contact .recaptcha_box {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0 20px 0;
  clear: both;
}
.ys-contact .recaptcha_box .wpcf7-form-control-wrap {
  display: flex !important;
  justify-content: center;
  width: auto !important;
  flex: none;
}
.ys-contact .g-recaptcha { display: inline-block; }

/* 제출 버튼 — 시그니처 블루 */
.ys-contact .submit_btn {
  width: 100%;
  text-align: center;
  margin-top: 25px;
  clear: both;
}
.ys-contact .submit_btn input[type="submit"],
.ys-contact .wpcf7-submit {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-button-large);
  padding: 15px 60px;
  cursor: pointer;
  letter-spacing: 0;
  transition: background .15s ease;
}
.ys-contact .submit_btn input[type="submit"]:hover {
  background: var(--color-primary-hover);
}
.ys-contact .submit_btn input[type="submit"][disabled] {
  background: var(--color-surface);
  color: var(--color-muted);
  cursor: default;
}

/* 반응형 */
@media (max-width: 640px) {
  .ys-contact .form_title h2 { font-size: 20px; }
  .ys-contact .ys-input-box { padding: 12px 14px !important; }
  .ys-contact .ys-span { font-size: 13px; }
  .ys-contact input,
  .ys-contact select,
  .ys-contact textarea { font-size: 14px; }
  .ys-contact .submit_btn input[type="submit"] {
    width: 100%;
    padding: 14px 0;
  }
  .ys-contact .recaptcha_box {
    transform: scale(0.9);
    transform-origin: center;
  }
}
