@charset "utf-8";

/* B3 — 후기 (개요 패널 + 대표 후기 + 전체 모달)
   정본 규격: .claude/skills/style/item-detail-page.md
   2026-09-10 기획팀 QA 로 프로토타입 V2.2 레이아웃으로 교체 — 가로 캐러셀 → 세로 대표 후기 리스트.
   `.item-review__card-top` / `__stars` / `__when` / `__name` 은 모달 행(itemDetailReviewRows)이
   함께 쓰므로 남긴다. */

.item-review__empty,
.item-qna__empty {
    padding: 30px 0;
    color: var(--tp-gray);
    font-size: 14px;
    text-align: center;
}

/* ===== 섹션 헤더 ===== */
.item-review__head,
.item-qna__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.item-review__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--tp-text);
}

.item-review__title span,
.item-qna__title span {
    color: var(--tp-gray);
    font-weight: 600;
}

.item-review__desc,
.item-qna__desc {
    margin-top: 8px;
    color: var(--tp-gray);
    font-size: 13px;
}

/* ===== 개요 (점수 패널 + AI 패널) ===== */
.item-review__overview {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 26px;
}

/* AI 요약이 없으면 점수 패널이 한 줄을 통째로 쓰지 않도록 폭을 제한한다.
   판정은 서버(뷰)가 modifier 로 내린다 — `:has()` 는 구형 앱 WebView 에서 규칙 전체를 무효화한다. */
.item-review__overview--solo { grid-template-columns: 210px; }

.item-review__score-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px;
    border: 1px solid var(--tp-line);
    border-radius: 16px;
    background: #fff;
    text-align: center;
}

.item-review__score-num {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1.5px;
}

.item-review__score-num small {
    color: var(--tp-gray);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
}

.item-review__score-panel .item-review__score-stars {
    margin-top: 9px;
    color: var(--tp-star);
    font-size: 16px;
    letter-spacing: 2px;
}

.item-review__score-panel .item-review__score-cnt {
    margin-top: 5px;
    color: var(--tp-gray);
    font-size: 12px;
}

.item-review__recommend {
    width: 100%;
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid var(--tp-line);
    color: #53606f;
    font-size: 12px;
}

.item-review__recommend b {
    color: var(--tp-text);
    font-size: 14px;
}

.item-review__ai {
    position: relative;
    padding: 20px 22px;
    border: 1px solid #dce6f5;
    border-radius: 16px;
    background: linear-gradient(135deg, #f5f8ff, #fbfcff 62%, #f4faf8);
    overflow: hidden;
}

.item-review__ai::after {
    position: absolute;
    right: 18px;
    top: 4px;
    color: rgba(32, 102, 217, .07);
    font-size: 88px;
    line-height: 1;
    content: "✦";
}

.item-review__ai-title {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.item-review__ai-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border-radius: 9px;
    background: linear-gradient(135deg, #1b6fe5, #725de8);
    box-shadow: 0 5px 12px rgba(42, 92, 196, .2);
    color: #fff;
}

.item-review__ai-based {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px solid var(--tp-line);
    border-radius: 999px;
    background: #fff;
    color: var(--tp-gray);
    font-size: 11px;
    font-weight: 600;
}

.item-review__ai-para {
    position: relative;
    z-index: 1;
    margin-top: 13px;
    color: #3d4856;
    font-size: 15px;
    line-height: 1.8;
}

/* ===== 대표 후기 ===== */
.item-review__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--tp-line);
}

.item-review__toolbar h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.item-review__highlight {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 21px 2px;
    border-bottom: 1px solid var(--tp-line);
}

.item-review__highlight-main { min-width: 0; }

.item-review__highlight-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--tp-gray);
    font-size: 12px;
}

.item-review__highlight-name {
    color: #374151;
    font-weight: 700;
}

.item-review__highlight-text {
    margin-top: 9px;
    color: #303844;
    font-size: 15px;
    line-height: 1.6;
}

.item-review__highlight-photos {
    display: flex;
    gap: 7px;
    align-self: center;
    cursor: pointer;
}

.item-review__highlight-photo {
    position: relative;
    width: 88px;
    height: 88px;
}

.item-review__highlight-photo img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 11px;
    background: var(--tp-bg);
    object-fit: cover;
}

.item-review__highlight-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(0, 0, 0, .48);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.item-review__card-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.item-review__stars {
    color: var(--tp-star);
    font-size: 14px;
    letter-spacing: 1px;
}

.item-review__star--off { color: #d3d6db; }

.item-review__when {
    color: var(--tp-gray);
    font-size: 13px;
}

.item-review__name {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 700;
}

.item-review__all,
.item-qna__all {
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--tp-line);
    border-radius: 8px;
    background: #303844;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.item-review__all:hover,
.item-qna__all:hover { background: var(--tp-bg); color:#303844}

/* 행 수정·삭제 — 서버가 canEdit 로 판정한 행에만 렌더된다 */
.item-review__acts,
.item-qna__acts {
    margin-left: auto;
    display: inline-flex;
    gap: 6px;
}

.item-qna__acts {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.item-review__act,
.item-qna__act {
    padding: 4px 12px;
    border: 1px solid var(--tp-line);
    border-radius: 4px;
    background: #fff;
    color: var(--tp-gray);
    font-size: 12px;
    cursor: pointer;
}

.item-review__act:hover,
.item-qna__act:hover { color: var(--tp-text); background: var(--tp-bg); }

.item-review__act:disabled,
.item-qna__act:disabled { opacity: .5; cursor: default; }

/* 후기 쓰기 — 섹션 헤더 우측. 후기 0건에서도 헤더에 그대로 남는다 */
.item-review__write {
    margin-left: auto;
    padding: 8px 16px;
    border: 1px solid var(--tp-blue);
    border-radius: 8px;
    background: #fff;
    color: var(--tp-blue);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.item-review__write:hover { background: var(--tp-blue-tint); }

/* 모달 안 더보기 — 섹션 하단 전체보기와 같은 아웃라인형이되 폭·여백만 다르다 */
.item-review__more,
.item-qna__more {
    display: block;
    width: 100%;
    margin: 16px 0 4px;
    padding: 13px;
    border: 1px solid var(--tp-line);
    border-radius: 12px;
    background: #fff;
    color: var(--tp-text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

.item-review__more:hover,
.item-qna__more:hover { background: var(--tp-bg); }

.item-review__more:disabled,
.item-qna__more:disabled { color: var(--tp-gray); cursor: default; }

/* ===== 전체 모달 ===== */
.item-review__modal,
.item-qna__modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(20, 30, 55, .5);
}

.item-review__modal--open,
.item-qna__modal--open { display: flex; }

/* 작성·수정 폼은 전체 모달 위에서 열린다.
   bk_on(paw.php:432)이 컨테이너에 z-index:99 를 인라인으로 박으므로 !important 로만 이길 수 있다.
   백드롭 #bk(z-index:9)는 건드리지 않는다 — 올리면 같은 레이어를 쓰는 예약폼 오버레이가 뒤로 밀린다. */
#item_mid_bottom_content_review_div,
#item_mid_bottom_content_qna_div,
#item_mid_bottom_content_qna_edit_div { z-index: 330 !important; }

.item-review__modal-box,
.item-qna__modal-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 680px;
    height: 92vh;
    border-radius: 18px 18px 0 0;
    background: #fff;
}

.item-review__modal-head,
.item-qna__modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--tp-line);
    /* 앱 노치 대응 */
    padding-top: calc(var(--safeAreaTop2, 0px) + 18px);
    padding-top: calc(var(--safeAreaTop1, 0px) + 18px);
}

.item-review__modal-head h3,
.item-qna__modal-head h3 { font-size: 17px; font-weight: 800; }

.item-review__modal-x,
.item-qna__modal-x {
    border: 0;
    background: none;
    color: #555;
    font-size: 22px;
    cursor: pointer;
}

.item-review__modal-body,
.item-qna__modal-body {
    padding: 20px;
    overflow-y: auto;
    padding-bottom: calc(var(--safeAreaBottom2, 0px) + 20px);
    padding-bottom: calc(var(--safeAreaBottom1, 0px) + 20px);
}

.item-review__summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 18px;
    padding: 22px 24px;
    border-radius: 14px;
    background: var(--tp-bg);
}

.item-review__score { min-width: 130px; text-align: center; }

.item-review__score-big {
    font-size: 46px;
    font-weight: 800;
    line-height: 1;
}

.item-review__score-big small {
    color: var(--tp-gray);
    font-size: 20px;
    font-weight: 600;
}

.item-review__score-stars {
    margin-top: 6px;
    color: var(--tp-star);
    font-size: 18px;
    letter-spacing: 2px;
}

.item-review__score-cnt {
    margin-top: 4px;
    color: var(--tp-gray);
    font-size: 13px;
}

.item-review__dist {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    min-width: 240px;
}

.item-review__dist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 12px;
}

.item-review__dist-lbl { width: 36px; color: #888; }

.item-review__dist-bar {
    flex: 1;
    height: 8px;
    overflow: hidden;
    border-radius: 4px;
    background: #e3e7ee;
}

.item-review__dist-bar > i {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--tp-star);
}

.item-review__dist-c { width: 34px; color: #888; text-align: right; }

.item-review__row {
    padding: 18px 0;
    border-bottom: 1px solid var(--tp-line);
}

.item-review__row-text {
    margin-top: 4px;
    color: #333;
    font-size: 15px;
    line-height: 1.6;
}

.item-review__photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    cursor: pointer;
}

.item-review__photos img {
    display: block;
    width: 92px;
    height: 92px;
    border-radius: 8px;
    object-fit: cover;
}

/* EXIF 회전이 빠진 썸네일 보정 — 컨트롤러가 원본 Orientation 으로 붙인다. 박스가 정사각이라 제자리 회전이다 */
.item-review__photo--rotate-90 { transform: rotate(90deg); }
.item-review__photo--rotate-180 { transform: rotate(180deg); }
.item-review__photo--rotate-270 { transform: rotate(270deg); }

@media (min-width: 781px) {
    .item-review__modal,
    .item-qna__modal { align-items: center; }

    .item-review__modal-box,
    .item-qna__modal-box { height: 86vh; border-radius: 18px; }
}

@media (max-width: 780px) {
    .item-review__overview,
    .item-review__overview--solo { grid-template-columns: minmax(0, 1fr); }
    .item-review__score-panel { padding: 18px; }
    .item-review__highlight { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .item-review__highlight-photos { align-self: flex-start; }
}

@media (max-width: 540px) {
    .item-review__title { font-size: 18px; letter-spacing: -0.02em;}
    .item-review__highlight-photo { width: 76px; height: 76px; }
}
