/* ============================================================
   TBG Reviews Pro - CSS
   ============================================================ */

:root {
    --tbg-gold:     #f5a623;
    --tbg-gold-dk:  #d4881a;
    --tbg-blue:     #1a73e8;
    --tbg-text:     #1a1a1a;
    --tbg-muted:    #777;
    --tbg-border:   #e5e5e5;
    --tbg-bg:       #fafafa;
    --tbg-white:    #fff;
    --tbg-radius:   8px;
    --tbg-shadow:   0 2px 12px rgba(0,0,0,.08);
}

/* ============================================================
   WRAPPER TỔNG
   ============================================================ */
.tbg-reviews-wrap {
    font-family: inherit;
    color: var(--tbg-text);
    margin-top: 20px;
}

.tbg-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--tbg-text);
    border-left: 3px solid var(--tbg-gold);
    padding-left: 12px;
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tbg-review-count { color: var(--tbg-muted); font-weight: 400; font-size: .9rem; }

/* ============================================================
   GRID 3 Ô
   ============================================================ */
.tbg-grid-wrap {
    display: flex;
    border: 1px solid var(--tbg-border);
    border-radius: var(--tbg-radius);
    overflow: hidden;
    margin-bottom: 28px;
    background: var(--tbg-white);
    box-shadow: var(--tbg-shadow);
}

.tbg-col { padding: 18px 20px; box-sizing: border-box; }

/* Ô 1 - Điểm TB */
.tbg-col-avg {
    flex: 0 0 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--tbg-border);
    text-align: center;
    gap: 4px;
    background: linear-gradient(160deg, #fffdf7 0%, #fff8e7 100%);
}
.tbg-avg-num {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--tbg-gold);
    line-height: 1;
    letter-spacing: -1px;
}
.tbg-avg-stars { display: flex; gap: 1px; }
.tbg-s         { font-size: 1rem; line-height: 1; }
.tbg-s-full    { color: var(--tbg-gold); }
.tbg-s-half    { color: var(--tbg-gold); opacity: .5; }
.tbg-s-empty   { color: #ddd; }
.tbg-avg-label { font-size: .6rem; font-weight: 700; color: var(--tbg-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.tbg-avg-meta  { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tbg-avg-total { font-size: .7rem; color: var(--tbg-muted); }
.tbg-avg-sold  { font-size: .7rem; color: var(--tbg-muted); margin-top: 1px; }

.tbg-sold-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff4e5;
    color: #b45309;
    font-size: .8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin: 6px 0 10px;
}

/* Khi JS chuyển badge vào cùng dòng với sao đánh giá */
.woocommerce-product-rating.tbg-rating-has-sold {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.tbg-sold-badge.tbg-sold-badge--inline {
    margin: 0;
}

/* Ô 2 - Thanh thống kê */
.tbg-col-bars {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    border-right: 1px solid var(--tbg-border);
    padding: 16px 24px;
}
.tbg-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tbg-bar-label {
    flex: 0 0 30px;
    white-space: nowrap;
    font-size: .82rem;
    font-weight: 700;
    color: var(--tbg-text);
    text-align: right;
}
.tbg-bar-star { color: var(--tbg-gold); }

.tbg-bar-track {
    flex: 1 1 auto;
    height: 10px;
    background: #ebebeb;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}
.tbg-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 20px;
    background: #ebebeb;
    transition: width 1s cubic-bezier(.4,0,.2,1);
    display: block;
}
.tbg-bar-fill.tbg-bar-has-value {
    background: linear-gradient(90deg, var(--tbg-gold), var(--tbg-gold-dk));
}

.tbg-bar-pct { flex: 0 0 32px; font-size: .78rem; font-weight: 700; color: var(--tbg-text); text-align: right; }
.tbg-bar-sep { font-size: .75rem; color: #ccc; }
.tbg-bar-cnt { font-size: .75rem; color: var(--tbg-muted); min-width: 68px; }

/* Ô 3 - CTA */
.tbg-col-cta {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.tbg-cta-text { margin: 0; font-size: .75rem; color: var(--tbg-muted); text-align: center; line-height: 1.4; }
.tbg-cta-l1, .tbg-cta-l2 { display: block; white-space: nowrap; }
.tbg-btn-cta {
    background: var(--tbg-white);
    border: 2px solid var(--tbg-blue);
    border-radius: var(--tbg-radius);
    color: var(--tbg-blue);
    font-size: .82rem;
    font-weight: 800;
    padding: 12px 16px;
    cursor: pointer;
    text-align: center;
    line-height: 1.6;
    letter-spacing: .3px;
    transition: all .2s;
}
.tbg-btn-cta:hover { background: var(--tbg-blue); color: var(--tbg-white); }

/* Chặn style nút mặc định của theme (Flatsome: uppercase, min-height, margin...) */
.tbg-reviews-wrap button.tbg-btn-cta,
.tbg-reviews-wrap button.tbg-like-btn {
    min-height: 0; margin: 0; box-shadow: none; text-shadow: none; width: auto;
}
.tbg-reviews-wrap button.tbg-like-btn { text-transform: none; letter-spacing: 0; line-height: 1.4; }

/* ============================================================
   MODAL
   ============================================================ */
.tbg-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.tbg-modal-overlay.is-open { display: flex; }

.tbg-modal-inner {
    background: var(--tbg-white);
    border-radius: 12px;
    padding: 32px 36px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,.22);
    animation: tbgModalIn .25s ease;
    box-sizing: border-box;
}
@keyframes tbgModalIn {
    from { opacity:0; transform:translateY(-16px) scale(.97); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}
.tbg-modal-close {
    position: absolute;
    top: 12px; right: 14px;
    background: none; border: none;
    font-size: 1.2rem; cursor: pointer;
    color: #999; padding: 4px 8px;
    border-radius: 4px;
    transition: all .15s;
}
.tbg-modal-close:hover { color: #333; background: #f0f0f0; }

/* Form bên trong modal */
#tbg-modal-form-wrap .comment-reply-title {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    border-left: 3px solid var(--tbg-gold);
    padding-left: 12px;
    margin-bottom: 20px !important;
    display: block;
}
#tbg-modal-form-wrap .comment-reply-title small { display: none !important; }
#tbg-modal-form-wrap label {
    font-size: .85rem;
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
    color: var(--tbg-text);
}
#tbg-modal-form-wrap input[type="text"],
#tbg-modal-form-wrap input[type="email"],
#tbg-modal-form-wrap textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--tbg-border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: .9rem;
    font-family: inherit;
    transition: border-color .2s;
    background: var(--tbg-white);
}
#tbg-modal-form-wrap input:focus,
#tbg-modal-form-wrap textarea:focus {
    border-color: var(--tbg-gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(245,166,35,.12);
}
#tbg-modal-form-wrap textarea { resize: vertical; min-height: 90px; }

/* Upload ảnh trong modal */
.tbg-upload-wrap { margin-top: 12px; }
.tbg-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--tbg-bg);
    border: 1.5px dashed var(--tbg-border);
    border-radius: 6px;
    padding: 8px 16px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s;
}
.tbg-upload-label:hover { border-color: var(--tbg-gold); }
#tbg-img-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tbg-preview-item { position: relative; width: 72px; height: 72px; }
.tbg-preview-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1px solid var(--tbg-border); }
.tbg-preview-remove {
    position: absolute; top: -6px; right: -6px;
    background: #e74c3c; color: #fff;
    border: none; border-radius: 50%;
    width: 18px; height: 18px;
    font-size: .7rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* Star picker trong modal */
.tbg-star-picker { display: flex; flex-direction: row-reverse; justify-content: flex-end; margin-bottom: 14px; }
.tbg-star-picker input[type="radio"] { display: none; }
.tbg-star-picker label {
    font-size: 1.8rem !important;
    color: #ddd !important;
    cursor: pointer !important;
    padding: 0 2px !important;
    transition: color .15s, transform .15s !important;
    display: block !important;
    margin: 0 !important;
}
.tbg-star-picker input:checked ~ label,
.tbg-star-picker label:hover,
.tbg-star-picker label:hover ~ label {
    color: var(--tbg-gold) !important;
    transform: scale(1.2) !important;
}

.tbg-modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    border-left: 3px solid var(--tbg-gold);
    padding-left: 12px;
    margin: 0 0 20px;
}
.tbg-modal-field { margin: 0 0 14px; }
.tbg-field-stars label { margin-bottom: 8px; display: block; font-size:.85rem; font-weight:700; }
.tbg-field-submit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tbg-submit-btn {
    background: var(--tbg-gold);
    color: #fff; border: none;
    border-radius: 6px;
    padding: 11px 28px;
    font-size: .95rem; font-weight: 700;
    cursor: pointer; transition: background .2s;
}
.tbg-submit-btn:hover   { background: var(--tbg-gold-dk); }
.tbg-submit-btn:disabled { opacity: .6; cursor: not-allowed; }
.tbg-submit-msg { font-size: .88rem; }
.tbg-msg-success { color: #27ae60; }
.tbg-msg-error   { color: #e74c3c; }

#tbg-modal-form-wrap input[type="submit"],
#tbg-modal-form-wrap #submit {
    background: var(--tbg-gold) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 11px 28px !important;
    font-size: .95rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background .2s !important;
}
#tbg-modal-form-wrap input[type="submit"]:hover,
#tbg-modal-form-wrap #submit:hover { background: var(--tbg-gold-dk) !important; }

/* ============================================================
   DANH SÁCH REVIEW
   ============================================================ */
.tbg-comment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.tbg-review-item  { list-style: none; }

.tbg-review-box {
    display: flex;
    gap: 10px;
    background: var(--tbg-white);
    border: 1px solid var(--tbg-border);
    border-radius: 6px;
    padding: 10px 12px;
    transition: box-shadow .2s;
}
.tbg-review-box:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }

.tbg-review-avatar img {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--tbg-gold);
    flex-shrink: 0;
}

.tbg-review-content { flex: 1; min-width: 0; }

.tbg-review-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 10px;
    margin-bottom: 4px;
}
.tbg-review-who    { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.tbg-phone-tail    { font-size: .7rem; color: #555; background: #f2f4f7; border-radius: 3px; padding: 1px 6px; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.tbg-review-meta   { display: flex; align-items: center; gap: 8px; }
.tbg-review-author { font-size: .82rem; font-weight: 700; color: var(--tbg-text); }
.tbg-verified      { font-size: .68rem; font-style: normal; color: #1e8e4f; background: #eafaf1; border-radius: 3px; padding: 1px 6px; }
.tbg-review-stars  { display: inline-flex; gap: 0; }
.tbg-review-stars .tbg-s { font-size: .78rem; }
.tbg-review-date   { font-size: .68rem; color: var(--tbg-muted); }
.tbg-review-text { font-size: .82rem; line-height: 1.55; color: #444; margin-bottom: 6px; overflow-wrap: anywhere; }
.tbg-review-text p { margin: 0 0 .4em; }
.tbg-review-text p:last-child { margin-bottom: 0; }
.tbg-review-images { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.tbg-review-img    { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--tbg-border); cursor: pointer; transition: opacity .2s; }
.tbg-review-img:hover { opacity: .85; }
.tbg-like-btn {
    background: none; border: 1px solid var(--tbg-border);
    border-radius: 20px; padding: 2px 8px;
    font-size: .72rem; cursor: pointer; color: var(--tbg-muted);
    transition: all .2s; display: inline-flex; align-items: center; gap: 3px;
}
.tbg-like-btn:hover, .tbg-like-btn.liked {
    border-color: var(--tbg-gold); color: var(--tbg-gold-dk);
    background: #fff8ec;
}
.tbg-like-count { font-weight: 700; }
.tbg-review-footer { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.tbg-review-footer:empty { display: none; }
.tbg-reply-wrap a {
    font-size: .72rem; color: var(--tbg-blue);
    text-decoration: none; white-space: nowrap;
}
.tbg-reply-wrap a:hover { text-decoration: underline; }

/* Inline reply form dưới review */
.tbg-inline-reply-wrap {
    margin: 8px 0 0 44px;
    background: var(--tbg-bg);
    border: 1px solid var(--tbg-border);
    border-radius: 6px;
    padding: 10px 12px;
    animation: tbgFadeIn .2s ease;
}
.tbg-inline-reply-form { display: flex; flex-direction: column; gap: 6px; }
.tbg-reply-input {
    border: 1.5px solid var(--tbg-border); border-radius: 5px;
    padding: 7px 10px; font-size: .82rem; font-family: inherit;
    width: 100%; box-sizing: border-box;
}
.tbg-reply-input:focus { border-color: var(--tbg-gold); outline: none; }
.tbg-reply-textarea {
    border: 1.5px solid var(--tbg-border); border-radius: 5px;
    padding: 7px 10px; font-size: .82rem; font-family: inherit;
    resize: vertical; min-height: 64px;
    width: 100%; box-sizing: border-box;
}
.tbg-reply-textarea:focus { border-color: var(--tbg-gold); outline: none; }
.tbg-reply-actions { display: flex; gap: 6px; }
.tbg-reply-submit {
    background: var(--tbg-gold); color: #fff; border: none;
    border-radius: 5px; padding: 6px 16px;
    font-size: .82rem; font-weight: 700; cursor: pointer;
}
.tbg-reply-submit:hover { background: var(--tbg-gold-dk); }
.tbg-reply-cancel {
    background: none; border: 1px solid var(--tbg-border);
    border-radius: 5px; padding: 6px 12px;
    font-size: .82rem; cursor: pointer; color: var(--tbg-muted);
}
.tbg-reply-msg { font-size: .8rem; color: #27ae60; }

/* Reply lồng nhau */
.tbg-comment-list .children {
    list-style: none;
    padding: 0 0 0 44px;
    margin: 4px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tbg-comment-list .children .tbg-review-box {
    background: #f9f9f9;
    border-color: #ececec;
}

.tbg-no-reviews {
    text-align: center; color: var(--tbg-muted); font-style: italic;
    padding: 32px; border: 2px dashed var(--tbg-border);
    border-radius: var(--tbg-radius); font-size: .9rem;
}

/* ============================================================
   ẢNH KHÁCH HÀNG
   ============================================================ */
.tbg-customer-images { margin-bottom: 20px; }
.tbg-img-title { display: block; font-size: .9rem; margin-bottom: 10px; color: var(--tbg-text); }
.tbg-img-list  { display: flex; flex-wrap: wrap; gap: 8px; }
.tbg-img-item img {
    width: 72px; height: 72px; object-fit: cover;
    border-radius: 6px; border: 1px solid var(--tbg-border);
    cursor: pointer; transition: opacity .2s, transform .2s;
}
.tbg-img-item img:hover { opacity: .85; transform: scale(1.05); }

/* ============================================================
   HỎI ĐÁP
   ============================================================ */
.tbg-qa-wrap { margin-top: 32px; }

.tbg-qa-form-wrap { margin-bottom: 16px; }
.tbg-qa-form      { background: var(--tbg-bg); border: 1px solid var(--tbg-border); border-radius: var(--tbg-radius); padding: 16px 18px; }

.tbg-qa-fields { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.tbg-qa-radio  { display: flex; gap: 12px; align-items: center; }
.tbg-qa-radio label { font-size: .85rem; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.tbg-qa-input  { border: 1.5px solid var(--tbg-border); border-radius: 6px; padding: 8px 12px; font-size: .88rem; font-family: inherit; flex: 1; min-width: 140px; }
.tbg-qa-input:focus { border-color: var(--tbg-gold); outline: none; }

.tbg-qa-content-wrap { position: relative; }
.tbg-qa-textarea {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid var(--tbg-border);
    border-radius: 6px; padding: 10px 12px;
    font-size: .9rem; font-family: inherit;
    resize: vertical; min-height: 80px;
    transition: border-color .2s;
}
.tbg-qa-textarea:focus { border-color: var(--tbg-gold); outline: none; }
.tbg-qa-form-actions { display: flex; gap: 8px; margin-top: 10px; }
.tbg-qa-submit {
    background: var(--tbg-gold); color: #fff;
    border: none; border-radius: 6px;
    padding: 9px 22px; font-size: .88rem;
    font-weight: 700; cursor: pointer;
    transition: background .2s;
}
.tbg-qa-submit:hover { background: var(--tbg-gold-dk); }
.tbg-qa-cancel {
    background: var(--tbg-white); color: var(--tbg-muted);
    border: 1px solid var(--tbg-border); border-radius: 6px;
    padding: 9px 16px; font-size: .85rem; cursor: pointer;
}

.tbg-qa-search-wrap { margin-bottom: 16px; }
.tbg-qa-search-input {
    width: 100%; max-width: 320px; box-sizing: border-box;
    border: 1.5px solid var(--tbg-border);
    border-radius: 20px; padding: 8px 16px;
    font-size: .88rem; font-family: inherit;
    transition: border-color .2s;
}
.tbg-qa-search-input:focus { border-color: var(--tbg-gold); outline: none; }

.tbg-qa-list    { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.tbg-qa-item    { list-style: none; }
.tbg-qa-children { list-style: none; padding: 0 0 0 44px; margin: 10px 0 0; display: flex; flex-direction: column; gap: 10px; }
.tbg-qa-empty   { color: var(--tbg-muted); font-style: italic; font-size: .9rem; text-align: center; padding: 20px; }

.tbg-qa-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.tbg-qa-avatar {
    width: 36px; height: 36px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--tbg-gold), var(--tbg-gold-dk));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 800; color: #fff;
}
.tbg-qa-body    { flex: 1; }
.tbg-qa-name    { font-size: .9rem; font-weight: 700; color: var(--tbg-text); }
.tbg-qa-gender  { font-size: .72rem; border-radius: 3px; padding: 1px 6px; margin-left: 4px; }
.tbg-male       { background: #e8f4fd; color: #1a73e8; }
.tbg-female     { background: #fce4ec; color: #e91e63; }
.tbg-qa-content { font-size: .88rem; line-height: 1.65; color: #444; margin: 6px 0; }
.tbg-qa-meta    { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--tbg-muted); }
.tbg-qa-reply-btn { color: var(--tbg-blue); cursor: pointer; text-decoration: none; font-weight: 600; }
.tbg-qa-reply-btn:hover { text-decoration: underline; }
.tbg-qa-time    { color: var(--tbg-muted); }

/* Reply form inline */
.tbg-qa-reply-form-wrap {
    margin-top: 10px;
    background: var(--tbg-bg);
    border: 1px solid var(--tbg-border);
    border-radius: 6px;
    padding: 12px 14px;
    animation: tbgFadeIn .2s ease;
}
@keyframes tbgFadeIn { from { opacity:0; } to { opacity:1; } }

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 768px) {
    .tbg-grid-wrap  { flex-direction: column; }
    .tbg-col-avg    { flex: none; border-right: none; border-bottom: 1px solid var(--tbg-border); }
    .tbg-col-bars   { flex: none; border-right: none; border-bottom: 1px solid var(--tbg-border); }
    .tbg-col-cta    { flex: none; border-bottom: none; }
    .tbg-modal-inner { padding: 22px 18px; }
}

/* ============================================================
   RESPONSIVE — ĐIỆN THOẠI (≤ 600px)
   ============================================================ */
@media (max-width: 600px) {
    .tbg-reviews-wrap { margin-top: 12px; }
    .tbg-section-title { font-size: .95rem; margin-bottom: 12px; }

    /* --- Khung thống kê --- */
    .tbg-grid-wrap { margin-bottom: 20px; border-radius: 12px; }

    /* Ô điểm: số to bên trái, sao + số đánh giá + đã bán bên phải */
    .tbg-col-avg {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        align-items: center;
        justify-items: start;
        column-gap: 14px;
        row-gap: 4px;
        padding: 16px 18px;
        text-align: left;
    }
    .tbg-avg-num   { grid-row: 1 / 3; font-size: 2.6rem; }
    .tbg-avg-stars { grid-column: 2; align-self: end; }
    .tbg-avg-stars .tbg-s { font-size: 1.15rem; }
    .tbg-avg-label { display: none; }
    .tbg-avg-meta  { grid-column: 2; align-self: start; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 0; }
    .tbg-avg-total, .tbg-avg-sold { font-size: .8rem; margin: 0; }
    .tbg-avg-sold::before { content: "•"; margin: 0 6px; color: #ccc; }
    .tbg-avg-sold  { color: #b45309; font-weight: 600; }

    /* Thanh sao: 5★ ▬▬▬▬ 49 */
    .tbg-col-bars  { padding: 14px 18px; gap: 8px; }
    .tbg-bar-row   { gap: 10px; }
    .tbg-bar-label { flex-basis: 26px; font-size: .8rem; white-space: nowrap; }
    .tbg-bar-track { height: 8px; }
    .tbg-bar-pct, .tbg-bar-sep, .tbg-bar-unit { display: none; }
    .tbg-bar-cnt   { min-width: 28px; flex: 0 0 auto; text-align: right; font-size: .78rem; font-weight: 600; color: var(--tbg-muted); }

    /* Nút viết đánh giá: 1 dòng, full chiều ngang */
    .tbg-col-cta   { flex-direction: row; justify-content: space-between; gap: 12px; padding: 12px 18px 16px; }
    .tbg-cta-text  { text-align: left; font-size: .8rem; flex: 1 1 auto; }
    .tbg-cta-l1, .tbg-cta-l2 { display: inline; }
    .tbg-reviews-wrap button.tbg-btn-cta {
        flex: 0 0 auto;
        background: var(--tbg-blue); color: #fff;
        border-radius: 99px; padding: 10px 18px;
        font-size: .82rem; line-height: 1.2; white-space: nowrap;
        box-shadow: 0 4px 12px rgba(26,115,232,.25);
    }

    /* --- Ảnh khách hàng: vuốt ngang --- */
    .tbg-img-list { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
    .tbg-img-item { flex: 0 0 auto; scroll-snap-align: start; }
    .tbg-img-item img { width: 64px; height: 64px; }
    .tbg-img-item img:hover { transform: none; }

    /* --- Từng đánh giá: avatar + tên cùng hàng --- */
    .tbg-comment-list { gap: 8px; }
    .tbg-review-box  { flex-direction: row; gap: 10px; padding: 12px; border-radius: 10px; }
    .tbg-review-box:hover { box-shadow: none; }
    .tbg-review-avatar img { width: 36px; height: 36px; }
    .tbg-review-header { flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 6px; }
    .tbg-review-author { font-size: .88rem; }
    .tbg-review-text { font-size: .88rem; line-height: 1.6; }
    .tbg-review-img  { width: 64px; height: 64px; border-radius: 6px; }
    .tbg-review-footer { gap: 14px; }
    .tbg-reviews-wrap button.tbg-like-btn { padding: 4px 10px; font-size: .75rem; }
    .tbg-reply-wrap a { font-size: .75rem; padding: 4px 0; display: inline-block; }

    /* Trả lời lồng nhau: thụt ít lại cho đỡ hẹp */
    .tbg-comment-list .children { padding-left: 16px; border-left: 2px solid #f0e2c4; margin-left: 18px; }
    .tbg-inline-reply-wrap { margin-left: 0; }

    /* --- Hỏi đáp --- */
    .tbg-qa-wrap { margin-top: 24px; }
    .tbg-qa-form { padding: 12px; }
    .tbg-qa-fields { flex-direction: column; gap: 8px; }
    .tbg-qa-input { min-width: 0; width: 100%; box-sizing: border-box; }
    .tbg-qa-input, .tbg-qa-textarea, .tbg-qa-search-input { font-size: 16px; } /* tránh iPhone tự zoom khi gõ */
    .tbg-qa-search-input { max-width: none; }
    .tbg-qa-children { padding-left: 16px; }
    .tbg-qa-box { gap: 10px; }

    /* Modal: dạng bảng trượt từ dưới lên */
    .tbg-modal-overlay { align-items: flex-end; padding: 0; }
    .tbg-modal-inner { max-width: none; max-height: 92vh; border-radius: 16px 16px 0 0; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); }
    #tbg-modal-form-wrap input[type="text"],
    #tbg-modal-form-wrap input[type="email"],
    #tbg-modal-form-wrap input[type="tel"],
    #tbg-modal-form-wrap textarea { font-size: 16px; }
}

/* ============================================================
   SỐ ĐÁNH GIÁ CẠNH DÃY SAO (thẻ sản phẩm)
   ============================================================ */
.tbg-loop-rating { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; max-width: 100%; }
.tbg-loop-rating .star-rating { margin: 0 !important; display: inline-block; float: none; }
.tbg-loop-rating .tbg-loop-count,
.price-wrapper .tbg-loop-rating a.tbg-loop-count,
.product-small .tbg-loop-rating a.tbg-loop-count { font-size: 12px !important; font-weight: 400 !important; line-height: 1; color: #888 !important; text-decoration: none !important; white-space: nowrap; }
.tbg-loop-count:hover { color: var(--tbg-gold-dk) !important; }
.text-center .tbg-loop-rating, .box-text.text-center .tbg-loop-rating { justify-content: center; }

/* ============================================================
   ẢNH / VIDEO TRONG ĐÁNH GIÁ + LIGHTBOX (v1.2.7)
   ============================================================ */
.tbg-media { position: relative; display: inline-block; line-height: 0; border-radius: 6px; overflow: hidden; }
.tbg-media video { object-fit: cover; background: #111; display: block; }
.tbg-img-item video { width: 72px; height: 72px; border-radius: 6px; }
.tbg-review-images video.tbg-review-img { width: 48px; height: 48px; }
.tbg-play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
    font-size: 11px; line-height: 26px; text-align: center; padding-left: 2px; box-sizing: border-box; pointer-events: none;
}

.tbg-lb { position: fixed; inset: 0; z-index: 1000000; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.9); }
.tbg-lb.is-open { display: flex; animation: tbgFadeIn .15s ease; }
.tbg-lb__stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 64px 70px; box-sizing: border-box; }
.tbg-lb__media { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #000; }
.tbg-lb button { all: unset; box-sizing: border-box; cursor: pointer; color: #fff; text-align: center; }
.tbg-lb .tbg-lb__close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; font-size: 30px; line-height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); z-index: 2; }
.tbg-lb .tbg-lb__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 32px; line-height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); z-index: 2; }
.tbg-lb .tbg-lb__close:hover, .tbg-lb .tbg-lb__nav:hover { background: rgba(255,255,255,.25); }
.tbg-lb .tbg-lb__prev { left: 12px; }
.tbg-lb .tbg-lb__next { right: 12px; }
.tbg-lb.is-single .tbg-lb__nav { display: none; }
.tbg-lb__bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); color: #eee; font-size: 13px; line-height: 1.4; display: flex; gap: 10px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.tbg-lb__cnt { flex: none; font-weight: 700; }
.tbg-lb__cap { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
html.tbg-lb-lock, html.tbg-lb-lock body { overflow: hidden; }
@media (max-width: 600px) {
    .tbg-lb__stage { padding: 56px 8px 70px; }
    .tbg-lb .tbg-lb__nav { width: 36px; height: 36px; font-size: 26px; line-height: 33px; background: rgba(0,0,0,.35); }
    .tbg-lb .tbg-lb__prev { left: 6px; } .tbg-lb .tbg-lb__next { right: 6px; }
    .tbg-img-item video { width: 64px; height: 64px; }
    .tbg-review-images video.tbg-review-img { width: 64px; height: 64px; }
}
