/* =============================================================
   고객리뷰 페이지 + 상품 리뷰 탭 공용 스타일
   레퍼런스: tamushin-q.co.kr/board/review/
============================================================= */

/* ─── 리뷰 페이지 헤더 ─── */
.rv-header {
    background: #f7f7f7;
    border-bottom: 1px solid var(--color-border);
    padding: 32px 0;
}
.rv-header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}
.rv-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-navy);
    margin-bottom: 4px;
}
.rv-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
}
.rv-subtitle strong {
    color: var(--color-primary);
    font-weight: 700;
}

/* ─── 바디 ─── */
.rv-body {
    padding: 0 0 80px;
}
.rv-body-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── 탭 네비 ─── */
.rv-tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 32px;
    margin-top: 32px;
}
.rv-tab-btn {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rv-tab-btn.is-active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}
.rv-tab-count {
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}
.rv-tab-content { display: none; }
.rv-tab-content.is-active { display: block; }

/* ─── 포토 그리드 ─── */
.rv-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ─── 리뷰 카드 ─── */
.rv-card {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #fff;
}
.rv-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}
.rv-card-img {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
}
.rv-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.rv-card:hover .rv-card-img img {
    transform: scale(1.05);
}
.rv-card-img-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
}
.rv-card-info {
    padding: 14px;
}
.rv-card-stars {
    display: flex;
    gap: 1px;
    margin-bottom: 6px;
}
.rv-star { font-size: 14px; color: #ddd; }
.rv-star.on { color: #F5A623; }

.rv-card-text {
    font-size: 13px;
    color: #444;
    line-height: 1.55;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rv-card-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}
.rv-card-product {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}
.rv-card-product-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}
.rv-card-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.rv-card-product-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rv-card-product-rating {
    font-size: 11px;
    color: var(--color-text-muted);
}
.rv-card-product-rating strong {
    color: var(--color-primary);
    font-weight: 700;
}

/* ─── 일반리뷰 목록 ─── */
.rv-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.rv-list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 20px 24px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: #fff;
}
.rv-list-left { flex: 1; min-width: 0; }
.rv-list-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 8px;
}
.rv-list-rating-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    margin-left: 4px;
}
.rv-list-content {
    font-size: 15px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 10px;
}
.rv-list-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--color-text-muted);
}
.rv-list-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    width: 80px;
}
.rv-list-product-thumb {
    width: 72px !important;
    height: 72px !important;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}
.rv-list-product-name {
    font-size: 11px;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.4;
    word-break: keep-all;
}

/* ─── 빈 상태 ─── */
.rv-empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--color-text-muted);
}
.rv-empty p { font-size: 16px; margin-bottom: 8px; }
.rv-empty-sub { font-size: 14px; }

/* ─── 모달 오버레이 ─── */
.rv-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.rv-modal-overlay.is-open {
    display: flex;
}
.rv-modal-wrap {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    max-width: 860px;
    width: 92%;
    max-height: 90vh;
}
.rv-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 20px;
    color: #fff;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.rv-modal-close:hover { background: rgba(0,0,0,0.8); }

.rv-modal-body {
    display: flex;
    max-height: 90vh;
}

/* 모달 좌: 이미지 */
.rv-modal-gallery {
    position: relative;
    flex: 0 0 55%;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rv-modal-img-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}
.rv-modal-img-wrap img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}
.rv-modal-img-counter {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 20px;
}
.rv-modal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.rv-modal-arrow:hover { background: rgba(255,255,255,0.4); }
.rv-modal-prev { left: 10px; }
.rv-modal-next { right: 10px; }

/* 모달 우: 정보 */
.rv-modal-info {
    flex: 1;
    padding: 28px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rv-modal-product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}
.rv-modal-product-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}
.rv-modal-product-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-navy);
    line-height: 1.4;
}
.rv-modal-stars {
    display: flex;
    gap: 2px;
    margin-top: 4px;
}
.rv-modal-stars .rv-star { font-size: 16px; }
.rv-modal-author {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}
.rv-modal-date {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: -8px;
}
.rv-modal-content {
    font-size: 15px;
    color: #444;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* ─── 리뷰 폼 이미지 업로드 ─── */
.review-img-upload-wrap {
    margin-bottom: 16px;
}
.review-img-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1.5px dashed var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.review-img-label:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.review-img-input { display: none; }
.review-img-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.review-img-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

/* ─── 상품 페이지 리뷰 탭 내부 스타일 ─── */
.sp-reviews-wrap {
    padding: 8px 0;
}
.sp-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}
.sp-review-item {
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: #fff;
}
.sp-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.sp-review-stars { display: flex; gap: 2px; }
.sp-review-stars .rv-star { font-size: 15px; }
.sp-review-meta {
    font-size: 13px;
    color: var(--color-text-muted);
    display: flex;
    gap: 8px;
}
.sp-review-text {
    font-size: 15px;
    color: #333;
    line-height: 1.75;
    margin-bottom: 12px;
    white-space: pre-wrap;
}
.sp-review-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.sp-review-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: opacity 0.2s;
}
.sp-review-img:hover { opacity: 0.85; }

/* 리뷰 평균 요약 */
.sp-review-summary {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 28px;
    border: 1px solid var(--color-border);
}
.sp-review-avg-score {
    font-size: 52px;
    font-weight: 900;
    color: var(--color-navy);
    line-height: 1;
}
.sp-review-avg-stars { display: flex; gap: 3px; margin-bottom: 4px; }
.sp-review-avg-stars .rv-star { font-size: 20px; }
.sp-review-avg-count {
    font-size: 13px;
    color: var(--color-text-muted);
}
.sp-review-no-reviews {
    text-align: center;
    padding: 48px 0;
    color: var(--color-text-muted);
    font-size: 15px;
}

/* ─── 리뷰 작성 폼 ─── */
.sp-review-form-wrap {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}
.sp-review-form-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 20px;
}
.sp-review-form-wrap .comment-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}
.sp-review-form-wrap .comment-form input[type="text"],
.sp-review-form-wrap .comment-form input[type="email"],
.sp-review-form-wrap .comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 15px;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
    margin-bottom: 16px;
}
.sp-review-form-wrap .comment-form input:focus,
.sp-review-form-wrap .comment-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}
.sp-review-form-wrap .comment-form textarea { resize: vertical; min-height: 120px; }
.sp-review-form-wrap .comment-form-comment { margin-bottom: 8px; }
.sp-review-form-wrap .stars { margin-bottom: 16px; }
.sp-review-form-wrap .stars a { font-size: 24px; color: #ddd; text-decoration: none; }
.sp-review-form-wrap .stars a:hover,
.sp-review-form-wrap .stars a.active { color: #F5A623; }

/* ─── 페이지네이션 ─── */
.rv-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.rv-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.2s;
    background: #fff;
}
.rv-page-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.rv-page-btn.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    font-weight: 700;
}

/* ─── 홈 리뷰 그리드 ─── */
.home-review-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 28px 0 32px;
}
.home-rv-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
    cursor: pointer;
}
.home-rv-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.home-rv-card:hover img { transform: scale(1.04); }
.home-rv-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: flex-end;
    padding: 12px;
}
.home-rv-card:hover .home-rv-card-overlay { opacity: 1; }
.home-rv-card-text {
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* 일반리뷰 카드 (텍스트형) */
.home-rv-card-text-only {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: default;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.home-rv-card-text-only .home-rv-stars { display: flex; gap: 2px; font-size: 14px; }
.home-rv-card-text-only .home-rv-stars .rv-star { font-size: 14px; }
.home-rv-card-text-only .home-rv-body {
    font-size: 13px;
    color: #444;
    line-height: 1.6;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}
.home-rv-card-text-only .home-rv-author {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: auto;
}
@media (max-width: 768px) {
    .home-review-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── 반응형 ─── */
@media (max-width: 1024px) {
    .rv-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .rv-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .rv-modal-body { flex-direction: column; }
    .rv-modal-gallery { flex: none; min-height: 240px; }
    .rv-modal-info { padding: 20px 16px; }
    .rv-list-item { flex-direction: column; }
    .rv-list-product { flex-direction: row; width: auto; }
    .sp-review-summary { flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 480px) {
    .rv-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .rv-tab-btn { padding: 12px 16px; font-size: 13px; }
}
