/* ════════════════════════════════════════════
   FAQ 페이지  (모바일 우선 · 360px ~ 1280px)
   ════════════════════════════════════════════ */

/* ── 서브 타이틀 ─────────────────────────── */
.faq-sub-title {
    padding: 32px 16px 24px;
    text-align: center;
    background: #faf8f6;
    border-bottom: 1px solid #ede5e0;
}

.faq-sub-title p {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #b5837c;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.faq-sub-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    margin: 0;
}

/* ── 레이아웃 ────────────────────────────── */
#faq-main {
    padding: 28px 16px 48px;
    background: #fff;
}

.faq-wrap {
    max-width: 1080px;
    margin: 0 auto;
}

/* ════════════════════════════════════════════
   검색 폼
   ════════════════════════════════════════════ */
.faq-search {
    margin-bottom: 20px;
}

/* 입력 필드 + 검색 버튼 행 */
.faq-search__row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.faq-search__field {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    background: #faf8f6;
    transition: border-color 0.2s, background 0.2s;
}

.faq-search__field:focus-within {
    border-color: #b5837c;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(181, 131, 124, 0.1);
}

/* 장식용 돋보기 아이콘 */
.faq-search__icon {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    pointer-events: none;
    flex-shrink: 0;
    transition: color 0.2s;
}

.faq-search__field:focus-within .faq-search__icon {
    color: #b5837c;
}

.faq-search__icon svg {
    width: 17px;
    height: 17px;
}

.faq-search__input {
    width: 100%;
    padding: 12px 44px 12px 42px;
    border: none;
    background: none;
    font-size: 14px;
    color: #1a1a1a;
    outline: none;
    line-height: 1.4;
}

.faq-search__input::placeholder {
    color: #bbb;
}

.faq-search__input::-webkit-search-cancel-button,
.faq-search__input::-webkit-search-decoration {
    display: none;
}

.faq-search__clear {
    position: absolute;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e0d8d5;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.faq-search__clear:hover {
    background: #b5837c;
    color: #fff;
}

.faq-search__clear svg {
    width: 11px;
    height: 11px;
}

/* 검색 버튼 */
.faq-search__btn {
    flex-shrink: 0;
    padding: 0 18px;
    border: none;
    border-radius: 10px;
    background: #b5837c;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.2s;
}

.faq-search__btn:hover {
    background: #9e6e67;
}

.faq-search__count {
    margin: 8px 0 0;
    font-size: 12px;
    color: #999;
    padding-left: 2px;
}

.faq-search__term {
    color: #b5837c;
    font-weight: 600;
}

/* ── 카테고리 탭 래퍼 (모바일 페이드 마스크) ── */
.faq-tabs-outer {
    position: relative;
    margin-bottom: 24px;
}

.faq-tabs-outer::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 52px;
    background: linear-gradient(to right, rgba(255,255,255,0), #fff 80%);
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ── 카테고리 탭 (360px: 가로 스크롤) ─── */
.faq-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.faq-tabs::-webkit-scrollbar {
    display: none;
}

.faq-tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 50px;
    background: #fff;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.faq-tab:hover {
    border-color: #b5837c;
    color: #b5837c;
}

.faq-tab.is-active {
    background: #b5837c;
    border-color: #b5837c;
    color: #fff;
    font-weight: 600;
}

/* ── FAQ 목록 ────────────────────────────── */
.faq-list {
    display: flex;
    flex-direction: column;
}

/* ── FAQ 항목 ────────────────────────────── */
.faq-item {
    border-bottom: 1px solid #ede5e0;
}

/* PHP가 표시할 항목만 렌더링하므로 :first-child 사용 가능 */
.faq-item:first-child {
    border-top: 1px solid #ede5e0;
}

/* 질문 버튼 */
.faq-item__q {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    user-select: none;
    -webkit-user-select: none;
}

.faq-item__q:hover .faq-item__q-text {
    color: #b5837c;
}

.faq-item__q-label {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #b5837c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.faq-item__q-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.6;
    letter-spacing: -0.2px;
    transition: color 0.2s;
}

/* 검색 결과 카테고리 뱃지 */
.faq-item__cat-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #b5837c;
    background: #faf8f6;
    border: 1px solid #ede5e0;
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 8px;
    vertical-align: middle;
    white-space: nowrap;
}

.faq-item__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #aaa;
    margin-top: 3px;
    transition: transform 0.3s ease, color 0.2s;
}

.faq-item__icon svg {
    width: 100%;
    height: 100%;
}

/* 열린 상태 */
.faq-item__q[aria-expanded="true"] .faq-item__icon {
    transform: rotate(180deg);
    color: #b5837c;
}

.faq-item__q[aria-expanded="true"] .faq-item__q-label {
    background: #3d2e2a;
}

/* 답변 패널 */
.faq-item__a {
    overflow: hidden;
    height: 0;
    transition: height 0.32s ease;
}

.faq-item__a-inner {
    display: flex;
    gap: 10px;
    padding: 4px 0 24px;
}

.faq-item__a-label {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0ebe8;
    color: #b5837c;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.faq-item__a-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.8;
    letter-spacing: -0.2px;
    white-space: pre-line;
    padding-top: 4px;
}

/* ── 검색어 강조 ─────────────────────────── */
mark.faq-hl {
    background: #fff0c0;
    color: inherit;
    border-radius: 3px;
    padding: 1px 4px;
    font-weight: inherit;
    margin: 0 1px;
}

/* ════════════════════════════════════════════
   결과 요약 (총 N건)
   ════════════════════════════════════════════ */
.faq-result-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #aaa;
    letter-spacing: -0.1px;
}

.faq-result-range {
    color: #888;
}

.faq-result-sep {
    color: #ccc;
}

.faq-result-total strong {
    color: #b5837c;
    font-weight: 700;
}

/* ════════════════════════════════════════════
   페이지네이션
   ════════════════════════════════════════════ */
.faq-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 32px;
}

.faq-page-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #555;
    text-decoration: none;
    flex-shrink: 0;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.faq-page-arrow svg {
    width: 16px;
    height: 16px;
}

.faq-page-arrow:hover {
    border-color: #b5837c;
    color: #b5837c;
}

.faq-page-arrow.is-disabled {
    color: #ccc;
    border-color: #eee;
    cursor: default;
    pointer-events: none;
}

.faq-page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.faq-page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.faq-page-num:hover {
    border-color: #b5837c;
    color: #b5837c;
}

.faq-page-num.is-active {
    background: #b5837c;
    border-color: #b5837c;
    color: #fff;
    font-weight: 700;
    cursor: default;
    pointer-events: none;
}

.faq-page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 34px;
    color: #aaa;
    font-size: 13px;
    user-select: none;
    -webkit-user-select: none;
}

/* ════════════════════════════════════════════
   빈 상태
   ════════════════════════════════════════════ */
.faq-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 56px 20px;
    text-align: center;
}

.faq-empty__icon {
    width: 56px;
    height: 56px;
    color: #d9ceca;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-empty__icon svg {
    width: 100%;
    height: 100%;
}

.faq-empty__title {
    font-size: 15px;
    font-weight: 700;
    color: #555;
    margin: 0 0 8px;
    letter-spacing: -0.2px;
}

.faq-empty__desc {
    font-size: 13px;
    color: #aaa;
    line-height: 1.7;
    margin: 0 0 22px;
}

.faq-empty__reset {
    display: inline-block;
    padding: 9px 24px;
    border: 1.5px solid #b5837c;
    border-radius: 50px;
    background: none;
    color: #b5837c;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.faq-empty__reset:hover {
    background: #b5837c;
    color: #fff;
}

/* ════════════════════════════════════════════
   반응형
   ════════════════════════════════════════════ */

/* ── 480px 이상 ──────────────────────────── */
@media (min-width: 480px) {
    .faq-sub-title { padding: 36px 20px 28px; }
    .faq-sub-title h1 { font-size: 22px; }

    #faq-main { padding: 32px 20px 56px; }

    .faq-search__input { font-size: 14px; }

    .faq-tabs { gap: 7px; margin-bottom: 28px; }
    .faq-tab { padding: 7px 14px; }

    .faq-item__q { gap: 12px; padding: 17px 0; }
    .faq-item__q-text { font-size: 14px; }
    .faq-item__a-inner { gap: 12px; padding-bottom: 22px; }
    .faq-item__a-text { font-size: 14px; }
}

/* ── 768px 이상: 탭 줄바꿈 ───────────────── */
@media (min-width: 768px) {
    .faq-sub-title { padding: 48px 20px 32px; }
    .faq-sub-title p { font-size: 12px; }
    .faq-sub-title h1 { font-size: 26px; }

    #faq-main { padding: 44px 20px 64px; }

    .faq-search { margin-bottom: 24px; }
    .faq-search__row { gap: 10px; }
    .faq-search__input { padding: 14px 46px 14px 44px; font-size: 15px; }
    .faq-search__icon { width: 44px; }
    .faq-search__icon svg { width: 19px; height: 19px; }
    .faq-search__clear { right: 12px; width: 26px; height: 26px; }
    .faq-search__btn { padding: 0 22px; font-size: 15px; }
    .faq-search__count { font-size: 13px; }

    /* 탭 줄바꿈 허용 */
    .faq-tabs-outer {
        margin-bottom: 36px;
    }
    .faq-tabs-outer::after {
        display: none; /* 줄바꿈 시 페이드 불필요 */
    }
    .faq-tabs {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 0;
        gap: 8px;
    }
    .faq-tab { padding: 8px 18px; font-size: 13px; }

    .faq-item__q { gap: 14px; padding: 20px 2px; }
    .faq-item__q-label,
    .faq-item__a-label { width: 26px; height: 26px; font-size: 12px; }
    .faq-item__q-text { font-size: 15px; }
    .faq-item__icon { width: 19px; height: 19px; margin-top: 3px; }

    .faq-item__a-inner { gap: 14px; padding: 0 2px 22px; }
    .faq-item__a-text { font-size: 14px; }

    .faq-empty { padding: 72px 20px; }
    .faq-empty__icon { width: 64px; height: 64px; }
    .faq-empty__title { font-size: 16px; }
    .faq-empty__desc { font-size: 14px; }
}

/* ── 1024px 이상 ─────────────────────────── */
@media (min-width: 1024px) {
    .faq-sub-title { padding: 56px 20px 36px; }
    .faq-sub-title h1 { font-size: 28px; }

    #faq-main { padding: 52px 20px 72px; }

    .faq-tabs { margin-bottom: 40px; }

    .faq-item__q { gap: 16px; padding: 22px 4px; }
    .faq-item__q-label,
    .faq-item__a-label { width: 28px; height: 28px; font-size: 13px; }
    .faq-item__q-text { font-size: 16px; letter-spacing: -0.3px; }
    .faq-item__icon { width: 20px; height: 20px; margin-top: 4px; }

    .faq-item__a-inner { gap: 16px; padding: 0 4px 24px; }
    .faq-item__a-text { font-size: 15px; }
}

/* ── 1280px 이상 ─────────────────────────── */
@media (min-width: 1280px) {
    .faq-sub-title { padding: 60px 20px 40px; }
    .faq-sub-title h1 { font-size: 30px; }

    #faq-main { padding: 60px 20px 80px; }
}
