.faq {
  padding-bottom: 78px;
  /* 전체 컨테이너 부드러운 전환 */
  transition: opacity 0.3s ease-in-out;
}

/* 전체 FAQ 타이틀 */
.faq__title {
  font-size: 18px;
  padding: 24px 16px 16px;
  text-align: center;
  font-weight: bold;
}

/* 검색 영역 */
.faq__search {
  display: flex;
  gap: 8px;
  padding: 20px 15px 0 15px;
  align-items: center;
  background-color: unset;
}
.faq__search input {
  flex: 1;
  height: 30px;
  padding: 0 12px;
  font-size: 14px;
  /*border: 1px #979797;*/
  color: #979797;
}

.faq__search-box {
  display: flex;
  align-items: center;
  border: 1px solid #979797;
  padding: 2px 8px;
  background-color: #fff;
  flex: 1;
}

.faq__search-box .text-field {
  flex: 1;
  border: none !important;
}

.faq__search img {
  margin-left: 8px;
}

.faq__search .text-field {
  border-radius: unset;
}

/* 카테고리 필터 영역 */
.faq__categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px 20px;
  text-align: center;
}
.faq__category {
  font-size: 13px;
  padding: 8px 4px;
  border: 1px solid #ccc;
  border-radius: 20px;
  background-color: #fff;
  color: #333;
  cursor: pointer;
}
.faq__category.active {
  background-color: #000;
  color: #fff;
  border-color: #000;
}

/* FAQ 리스트 - 깜빡임 방지를 위한 부드러운 전환 */
.faq-list {
  list-style: none;
  margin: 0;
  padding: 0;
  opacity: 1;
  transition: opacity 0.2s ease-in-out;
}

/* 로딩 중일 때 투명도 조절 */
.faq-list.loading {
  opacity: 0.7;
}

.faq-list__content-wrap {
  border-bottom: 1px solid #eee;
  transition: all 0.3s ease-in-out;
  cursor: pointer;
  /* 컨텐츠 변경 시 부드러운 전환 */
  transform: translateZ(0); /* GPU 가속을 위한 속성 */
}

/* 호버 효과 추가 */
.faq-list__content-wrap:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.faq-list__question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.6rem;
  gap: 0.8rem;
  font-size: 1.4rem;
  color: #111;
  transition: background-color 0.2s ease;
}

.faq-list__question-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.faq-list__question-content {
  width: 90%;
}

.faq-list__category {
  font-size: 1.2rem;
  color: #999;
  margin-bottom: 0.2rem;
}

.faq-list__q {
  font-size: 1.4rem;
  font-weight: bold;
  color: #000;
}

.faq-list__text {
  font-size: 1.5rem;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 답변 영역 - 부드러운 애니메이션 */
.faq-list__answer {
  background-color: #fafafa;
  padding: 1.6rem;
  font-size: 1.4rem;
  color: #333;
  line-height: 1.6;
  border-top: 1px solid #ddd;
  /* 답변 펼침/접힘 애니메이션 */
  animation: slideDown 0.3s ease-in-out;
  overflow: hidden;
}

/* 답변 슬라이드 애니메이션 */
@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 100rem;
    padding-top: 1.6rem;
    padding-bottom: 1.6rem;
  }
}

/* 답변 로딩 상태 */
.answer-loading {
  padding: 1.6rem;
  text-align: center;
  color: #666;
  font-style: italic;
  animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
  }
}

/* 토글 버튼 개선 */
.faq-list__toggle {
  font-size: 3rem;
  border: none;
  background: none;
  color: #000;
  cursor: pointer;
  line-height: 1;
  transition: all 0.3s ease;
  transform: translateZ(0); /* GPU 가속 */
}

.faq-list__content-wrap.is-open .faq-list__toggle {
  color: #000;
  transform: rotate(45deg); /* X 모양으로 회전 */
}

/* 아이콘 회전 효과 개선 */
.faq-list__content-wrap.is-open .arrow {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.arrow {
  transition: transform 0.3s ease;
}

.faq-list__category-tag {
  font-size: 1.2rem;
  color: #999; /* 회색으로 설정 */
  margin-bottom: 1rem;
}

.faq-list__q-img {
  width: 1.4rem;
  height: 1.5rem;
  object-fit: contain;
}

/* 표 컨테이너: 바깥 테두리만 */
.faq__table-category {
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;           /* 사방 1px 외곽선 */
  margin: 1.6rem;
  font-size: 1.4rem;
}

/* 행 */
.faq__category-row {
  display: flex;
}

/* 셀 기본: 선 없음 */
.faq__table-cell {
  flex: 1;
  padding: 1.2rem;
  text-align: center;
  background-color: #fff;
  color: #111;
  cursor: pointer;
  transition: background-color 0.2s ease; /* 속성 최소화 */
  box-sizing: border-box;
  /* border-right/bottom 주지 않음 */
}

/* 내부 구분선(겹치지 않도록 ‘한쪽만’) */
.faq__category-row + .faq__category-row .faq__table-cell {
  /* 첫 행을 제외한 나머지 행의 셀에만 위쪽 선 */
  border-top: 1px solid #ddd;
}
.faq__category-row .faq__table-cell + .faq__table-cell {
  /* 각 행의 첫 셀을 제외한 나머지 셀에만 왼쪽 선 */
  border-left: 1px solid #ddd;
}

.faq__table-cell {
  transition: color 90ms linear, background-color 10ms linear; /* 0.09s */
}
.faq__table-cell:hover,
.faq__table-cell.active {
  background-color: #000;
  color: #fff;
}

/* 빈 리스트 */
.empty-list {
  min-height: 10rem; /* 최소 높이 보장 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-list,
.empty-list {
  transition: none; /* 빈 상태일 때는 애니메이션 제거 */
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.faq__empty-message {
  text-align: center;
  color: #999;
  font-size: 1.4rem;
  padding: 4rem 1.6rem;
  animation: fadeIn 0.5s ease-in-out;
}

/* 페이지네이션 */
.faq__pagination {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin: 2.4rem 0;
}

.faq__page-btn {
  border: none;
  background: none;
  font-size: 1.4rem;
  color: #888;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.faq__page-btn:hover {
  color: #000;
}

.faq__page-btn.active {
  font-weight: bold;
  color: #000;
  text-decoration: underline;
}

/* 로딩 스켈레톤 개선 */
.faq-list .list-skeleton {
  padding: 2rem;
}

/* 추가 로딩 스켈레톤 (무한 스크롤용) */
.faq-list-additional {
  margin-top: 1.6rem;
  opacity: 0.7;
  animation: fadeIn 0.3s ease-in-out;
}

/* 무한 스크롤 로더 개선 */
.infinite-scroll-loader {
  display: flex;
  justify-content: center;
  padding: 2rem;
  transition: opacity 0.3s ease;
}

/* 스켈레톤 애니메이션 개선 */
.skeleton {
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: -46.8rem 0;
  }
  100% {
    background-position: 46.8rem 0;
  }
}

/* GPU 가속을 위한 전체적인 최적화 */
.faq-list__content-wrap,
.faq-list__toggle,
.faq__table-cell {
  will-change: transform;
}

/* 반응형 개선 */
@media (max-width: 768px) {
  .faq__title {
    font-size: 1.6rem;
    padding: 2rem 1.6rem 1.2rem;
  }

  .faq__search {
    padding: 1.6rem 1.2rem 0 1.2rem;
  }

  .faq__table-category {
    margin: 1.2rem;
  }

  .faq__table-cell {
    padding: 1rem 0.8rem;
    font-size: 1.3rem;
  }

  .faq-list__question {
    padding: 1.2rem;
  }

  .faq-list__answer {
    padding: 1.2rem;
  }
}

