/* === TSR Public Styles (Shopee-like review) === */

/* Product Reviews Module (Woo comments) */
.rb-prm-module {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
    color: #222;
}

.rb-prm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.rb-prm-stars {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rb-prm-stars .rb-prm-star {
    font-size: 18px;
    color: #ffb400;
}

.rb-prm-star-empty {
    color: #ddd;
}

.rb-prm-avg-text {
    font-size: 14px;
    color: #333;
}

.rb-prm-total {
    font-size: 14px;
    color: #666;
}

.rb-prm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 12px;
}

.rb-prm-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .18s ease;
}

.rb-prm-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.rb-prm-card-image {
    position: relative;
    width: 100%;
    height: 221px;
    overflow: hidden;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rb-prm-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rb-prm-image-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.rb-prm-card-body {
    padding: 10px;
}

.rb-prm-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #444;
    margin-bottom: 6px;
}

.rb-prm-author {
    font-weight: 600;
}

.rb-prm-verified {
    color: #0b8043;
    font-weight: 700;
    margin-left: 6px;
}

.rb-prm-date {
    color: #888;
    font-size: 12px;
    margin-left: auto;
}

.rb-prm-card-rating {
    margin-bottom: 6px;
    font-size: 22px;
    color: #ffb400;
}

.rb-prm-card-content {
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
    min-height: 36px;
}

.rb-prm-product-info {
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #f3f3f3;
    padding-top: 8px;
}

.rb-prm-product-thumb {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
}

.rb-prm-product-title {
    font-size: 13px;
    color: #333;
}

/* Inline review images under Woo comment */
.rb-review-images-inline {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.rb-review-thumb {
    display: block;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #eee;
}

.rb-review-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox overlay for inline review images */
.rb-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rb-lightbox-overlay.active {
    display: flex;
}

.rb-lightbox-inner {
    position: relative;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rb-lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 6px;
}

.rb-lightbox-close,
.rb-lightbox-arrow {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    color: #fff;
    border: 0;
    font-size: 28px;
    cursor: pointer;
}

.rb-lightbox-prev {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.rb-lightbox-next {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.rb-lightbox-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    opacity: 0.9;
}

/* Preview thumbnails for upload */
.rb-review-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.rb-review-preview .rb-preview-item {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #eee;
    position: relative;
}

.rb-review-preview .rb-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rb-review-preview .rb-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 0;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

/* TSR CPT list layout */
.tsr-reviews-wrap {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
    color: #222;
    margin-top: 16px;
}

.tsr-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tsr-filter-bar button {
    border: 1px solid #ddd;
    background: #fafafa;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
}

.tsr-filter-bar button.active {
    background: #ffebcc;
    border-color: #ffbf66;
    color: #b36b00;
}

.tsr-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tsr-review-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fff;
}

.tsr-review-avatar img {
    border-radius: 50%;
}

.tsr-review-content {
    flex: 1;
}

.tsr-review-meta {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tsr-review-rating {
    color: #ffb400;
    font-size: 15px;
}

.tsr-verified {
    color: #0b8043;
    font-weight: 600;
}

.tsr-variation {
    font-size: 12px;
    color: #777;
}

.tsr-gallery a {
    display: inline-block;
    margin-right: 6px;
}

.tsr-gallery img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

.tsr-load-more {
    margin: 10px auto 0;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fafafa;
    cursor: pointer;
    font-size: 13px;
}

.tsr-submit-form input[type="text"],
.tsr-submit-form textarea,
.tsr-submit-form select {
    width: 100%;
    max-width: 420px;
}

/* Responsive */
@media (max-width: 992px) {
    .rb-prm-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rb-prm-card-image {
        height: 160px;
    }
}

@media (max-width: 600px) {
    .rb-prm-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rb-prm-card-image {
        height: 180px;
    }

    .tsr-review-item {
        flex-direction: column;
    }
}



/* === Woo Product Reviews Tab Layout (Shopee style) === */

.tsr-product-summary {
    margin-bottom: 18px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fff;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
}

.tsr-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.tsr-summary-rating {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tsr-summary-avg {
    font-size: 32px;
    font-weight: 700;
    color: #ff9800;
    line-height: 1;
}

.tsr-summary-stars {
    display: flex;
    gap: 2px;
    font-size: 20px;
}

.tsr-star-full {
    color: #ffb400;
}

.tsr-star-empty {
    color: #ddd;
}

.tsr-summary-meta {
    font-size: 13px;
    color: #555;
    display: flex;
    flex-direction: column;
}

.tsr-summary-action {
    margin-left: auto;
}

.tsr-summary-write-btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 20px;
    background: #ff9800;
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
}

.tsr-summary-write-btn:hover {
    background: #ff7c02;
    color: #fff;
}

/* phân bố sao */
.tsr-summary-bars {
    margin-top: 6px;
}

.tsr-summary-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 13px;
}

.tsr-summary-label {
    width: 52px;
    text-align: left;
}

.tsr-summary-bar {
    flex: 1;
}

.tsr-summary-bar-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #f1f1f1;
    overflow: hidden;
}

.tsr-summary-bar-fill {
    height: 100%;
    background: #ffb400;
    border-radius: 999px;
}

.tsr-summary-count {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 11px;
    color: #666;
}

/* 1 review item */
.tsr-review-box {
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fff;
    padding: 10px;
    margin-bottom: 10px;
}

.tsr-review-inner {
    display: flex;
    gap: 12px;
}

.tsr-review-left {
    width: 120px;
    flex-shrink: 0;
    position: relative;
}

.tsr-review-main-link {
    display: block;
    width: 100%;
    padding-top: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #eee;
}

.tsr-review-main-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tsr-review-img-badge {
    position: absolute;
    left: 6px;
    top: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Right side */
.tsr-review-right {
    flex: 1;
    font-size: 13px;
    color: #333;
}

.tsr-review-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.tsr-review-stars {
    display: flex;
    gap: 2px;
    font-size: 16px;
    color: #ffb400;
}

.tsr-review-date {
    font-size: 11px;
    color: #888;
}

.tsr-review-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.tsr-review-content-text {
    font-size: 13px;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 600px) {
    .tsr-summary-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tsr-review-inner {
        flex-direction: row;
        align-items: flex-start;
    }

    .tsr-review-left {
        width: 90px;
    }
}



/* === Override styles to match design mockup for header === */

.tsr-product-summary {
    margin-bottom: 24px;
    padding: 10px 0 20px;
    border: 0;
    border-bottom: 1px solid #e0e4f0;
    background: transparent;
}

.tsr-summary-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0b1b4f;
}

.tsr-summary-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 18px;
}

.tsr-summary-rating {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.tsr-summary-avg {
    font-size: 46px;
    font-weight: 700;
    color: #0b1b4f;
    line-height: 1;
}

.tsr-summary-rating-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tsr-summary-stars {
    display: flex;
    gap: 3px;
    font-size: 18px;
}

.tsr-star-full {
    color: #ffb400;
}

.tsr-star-empty {
    color: #e0e0e0;
}

.tsr-summary-meta-line {
    font-size: 13px;
    color: #4a4f63;
}

.tsr-summary-verified-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #e0f4ea;
    color: #1aab5e;
    font-size: 12px;
}

.tsr-summary-action {
    flex: 0 0 260px;
}

.tsr-summary-write-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 24px;
    border-radius: 40px;
    background: #233a82;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.tsr-summary-write-btn:hover {
    background: #1b2f6b;
    color: #fff;
}

/* Bars: align stars left column and bars right */
.tsr-summary-bars {
    margin-top: 4px;
}

.tsr-summary-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 13px;
}

.tsr-summary-label {
    width: 70px;
}

.tsr-summary-bar-track {
    background: #f0f2f7;
}

.tsr-summary-bar-fill {
    background: #233a82;
}

.tsr-summary-footer {
    margin-top: 8px;
}

.tsr-summary-view-all {
    font-size: 13px;
    color: #233a82;
    text-decoration: underline;
}

.tsr-summary-view-all:hover {
    color: #1b2f6b;
}

/* Responsive tweaks */
@media (max-width:768px) {
    .tsr-summary-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .tsr-summary-action {
        width: 100%;
    }
}

/* === SHOPEE STYLE HEADER + ITEM REVIEW === */

.tn-review-header-wrap {
    margin-bottom: 24px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.tn-review-title {
    font-size: 28px;
    font-weight: 700;
    color: #0b2157;
    margin: 0 0 16px;
}

.tn-review-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.tn-review-score-block {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tn-review-score-number {
    font-size: 48px;
    font-weight: 700;
    color: #0b2157;
    line-height: 1;
}

.tn-review-score-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.tn-review-stars-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tn-review-stars {
    display: flex;
    gap: 2px;
    font-size: 18px;
}

.tn-star-full {
    color: #ffb400;
}

.tn-star-empty {
    color: #d7d7d7;
}

.tn-review-score-text {
    font-size: 13px;
    color: #333;
}

.tn-review-verified-icon {
    font-size: 14px;
    color: #1abc9c;
}

.tn-review-based-on {
    font-size: 13px;
    color: #555;
}

.tn-review-header-cta {
    flex-shrink: 0;
}

.tn-review-write-btn {
    display: inline-block;
    padding: 10px 40px;
    border-radius: 999px;
    background: #1b2f80;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.tn-review-write-btn:hover {
    background: #12205a;
    color: #fff;
}

/* phân bố sao */
.tn-review-stars-summary {
    margin-top: 4px;
}

.tn-review-stars-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.tn-review-stars-label {
    width: 60px;
    font-size: 13px;
    color: #333;
}

.tn-review-stars-bar {
    flex: 1;
}

.tn-review-stars-bar-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #f1f1f1;
    overflow: hidden;
}

.tn-review-stars-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: #1b2f80;
}

.tn-review-stars-count {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 11px;
    color: #777;
}

/* link xem tất cả đánh giá */
.tn-review-seeall {
    margin-top: 8px;
}

.tn-review-seeall-link {
    font-size: 13px;
    text-decoration: underline;
    color: #0b2157;
}

/* item review */
.tn-review-item {
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fff;
}

.tn-review-inner {
    display: flex;
    gap: 12px;
}

.tn-review-left {
    width: 90px;
    flex-shrink: 0;
}

.tn-review-main-img-link {
    display: block;
    position: relative;
    padding-top: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #f7f7f7;
}

.tn-review-main-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tn-review-right {
    flex: 1;
    font-size: 13px;
    color: #333;
}

.tn-review-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.tn-review-date {
    font-size: 11px;
    color: #999;
}

.tn-review-author {
    font-weight: 600;
    margin-bottom: 4px;
}

.tn-review-content {
    font-size: 13px;
    line-height: 1.5;
}

/* mobile */
@media (max-width:600px) {
    .tn-review-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .tn-review-inner {
        flex-direction: row;
        align-items: flex-start;
    }

    .tn-review-left {
        width: 70px;
    }
}

/* Ẩn overlay lightbox custom nếu còn, để xài lightbox Flatsome */
.rb-lightbox-overlay {
    display: none !important;
}

#tsr-review-popup .tsr-main-slide {
    max-height: 420px;
    border-radius: 6px;
}

.tsr-gallery-thumb img:hover {
    opacity: 0.8;
    transform: scale(.95);
}

.rb-prm-popup-prev,
.rb-prm-popup-next {
    cursor: pointer;
    font-size: 26px;
    background: #fff;
    border-radius: 50%;
    width: 34px;
    height: 34px;
display: flex;
    align-items: center;
    justify-content: center;
}