/**
 * Customer Review & Rating Block - Commons Styling
 * Scope class: .pos-review-block
 */

.pos-review-block {
    --rv-primary: #e11d48;
    --rv-primary-hover: #be123c;
    --rv-star: #f59e0b;
    --rv-star-empty: #e2e8f0;
    --rv-text: #1e293b;
    --rv-text-muted: #64748b;
    --rv-border: #e2e8f0;
    --rv-bg-card: #ffffff;
    --rv-bg-subtle: #f8fafc;
    --rv-success: #10b981;
    --rv-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--rv-text);
    margin: 24px 0;
    padding: 0;
    box-sizing: border-box;
}

.pos-review-block * {
    box-sizing: border-box;
}

/* Header & Summary Section */
.pos-review-container {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.pos-review-header {
    border-bottom: 1px solid var(--rv-border);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.pos-review-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-review-subtitle {
    font-size: 14px;
    color: var(--rv-text-muted);
    margin: 0;
}

/* Score Summary Box */
.pos-review-summary {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    padding: 24px 32px;
    border-radius: 12px;
    margin-bottom: 24px;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .pos-review-summary {
        grid-template-columns: 1fr;
        gap: 18px;
        text-align: center;
    }
}

.pos-score-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--rv-border);
    padding-right: 20px;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .pos-score-main {
        border-right: none;
        border-bottom: 1px solid var(--rv-border);
        padding-right: 0;
        padding-bottom: 16px;
    }
}

.pos-score-num {
    font-size: 46px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 8px;
}

.pos-score-out {
    font-size: 18px;
    color: var(--rv-text-muted);
    font-weight: 500;
}

.pos-stars-display {
    color: var(--rv-star);
    font-size: 18px;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.pos-score-desc {
    font-size: 13px;
    color: var(--rv-text-muted);
    font-weight: 500;
}

/* Progress Bars */
.pos-score-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pos-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--rv-text-muted);
}

.pos-bar-label {
    min-width: 48px;
    text-align: right;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.pos-bar-track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

.pos-bar-fill {
    height: 100%;
    background: var(--rv-star);
    border-radius: 99px;
    transition: width 0.6s ease;
}

.pos-bar-percent {
    min-width: 38px;
    font-weight: 500;
}



/* Filters */
.pos-review-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--rv-border);
}

.pos-filter-pill {
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pos-filter-pill:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.pos-filter-pill.active {
    background: #fee2e2;
    color: #e11d48;
    border-color: #fca5a5;
    font-weight: 600;
}

/* Reviews List */
.pos-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pos-review-card {
    background: #ffffff;
    border: 1px solid var(--rv-border);
    border-radius: 10px;
    padding: 18px 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    animation: posFadeIn 0.3s ease-out;
}

.pos-review-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.03);
}

@keyframes posFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pos-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pos-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pos-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    user-select: none;
    flex-shrink: 0;
}

.pos-user-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pos-user-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.pos-badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ecfdf5;
    color: #059669;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #a7f3d0;
}

.pos-card-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-card-stars {
    color: var(--rv-star);
    font-size: 14px;
    letter-spacing: 1px;
}

.pos-card-date {
    font-size: 12px;
    color: var(--rv-text-muted);
}

.pos-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 6px 0 6px 0;
}

.pos-card-comment {
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    margin: 0 0 12px 0;
}

/* Card Actions */
.pos-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px dashed #f1f5f9;
    font-size: 12px;
    color: var(--rv-text-muted);
}

.pos-helpful-btn {
    background: transparent;
    border: 1px solid var(--rv-border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.pos-helpful-btn:hover, .pos-helpful-btn.active {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* Shop Reply Box */
.pos-shop-reply {
    background: #f8fafc;
    border-left: 3px solid #10b981;
    border-radius: 0 8px 8px 0;
    padding: 12px 14px;
    margin-top: 12px;
    font-size: 13px;
}

.pos-reply-author {
    font-weight: 700;
    color: #065f46;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.pos-reply-text {
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

/* Load More / Bottom Actions */
.pos-review-bottom {
    text-align: center;
    margin-top: 24px;
}

.pos-btn-load-more {
    background: #ffffff;
    border: 1px solid var(--rv-border);
    color: #334155;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pos-btn-load-more:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Form Write Review Modal / Inline Box */
.pos-review-form-wrap {
    display: none;
    margin-top: 20px;
    background: #ffffff;
    border: 2px dashed #fca5a5;
    border-radius: 12px;
    padding: 20px;
    animation: posFadeIn 0.3s ease;
}

.pos-review-form-wrap.open {
    display: block;
}

.pos-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pos-form-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.pos-form-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #94a3b8;
}

.pos-form-close:hover {
    color: #e11d48;
}

.pos-form-stars-select {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

.pos-form-star-item {
    font-size: 26px;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}

.pos-form-star-item.active,
.pos-form-star-item:hover,
.pos-form-star-item.hovered {
    color: var(--rv-star);
    transform: scale(1.15);
}

.pos-form-group {
    margin-bottom: 12px;
}

.pos-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 640px) {
    .pos-form-row {
        grid-template-columns: 1fr;
    }
}

.pos-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--rv-border);
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pos-form-control:focus {
    border-color: #e11d48;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

.pos-form-control::placeholder {
    color: #94a3b8;
}

textarea.pos-form-control {
    resize: vertical;
    min-height: 85px;
}

.pos-form-btn-submit {
    background: #e11d48;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pos-form-btn-submit:hover {
    background: #be123c;
}

.pos-form-alert-success {
    display: none;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
}

/* Compatibility when embedded inside postInfo or tab panels */
.postInfo > .pos-review-block {
    max-width: 100% !important;
    margin: 0 !important;
}

.postInfo .pos-review-container {
    border: none;
    box-shadow: none;
    padding: 0;
}

/* ==============================================================
   MOBILE RESPONSIVE & PREMIUM TOUCH UX (Mode Mobile)
   ============================================================== */
@media (max-width: 767.98px) {
    .pos-review-block {
        margin: 16px 0 0 0;
    }

    .pos-review-container {
        padding: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    /* Seamless appearance when nested inside product tab panels on mobile */
    .product-desc-reviews-section .pos-review-container,
    .reviews-wrapper .pos-review-container {
        border: none;
        box-shadow: none;
        padding: 0;
    }

    /* Header */
    .pos-review-header {
        padding-bottom: 12px;
        margin-bottom: 14px;
    }

    .pos-review-title {
        font-size: 17px;
        gap: 7px;
        line-height: 1.35;
    }

    .pos-review-title i {
        font-size: 18px;
    }

    .pos-review-subtitle {
        font-size: 12px;
        line-height: 1.45;
        color: #64748b;
    }

    /* Score Summary Mobile 2-Zone Card */
    .pos-review-summary {
        display: grid;
        grid-template-columns: 115px 1fr;
        grid-template-areas: 
            "score bars"
            "action action";
        gap: 14px 12px;
        align-items: center;
        background: #f8fafc;
        border: 1px solid #f1f5f9;
        padding: 14px 12px;
        border-radius: 12px;
        margin-bottom: 16px;
        text-align: left;
    }

    .pos-score-main {
        grid-area: score;
        border-right: 1px solid #e2e8f0;
        border-bottom: none;
        padding-right: 10px;
        padding-bottom: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .pos-score-num {
        font-size: 34px;
        font-weight: 800;
        line-height: 1;
        margin-bottom: 3px;
        color: #0f172a;
    }

    .pos-score-out {
        font-size: 13px;
        font-weight: 600;
        color: #94a3b8;
    }

    .pos-stars-display {
        font-size: 12px;
        letter-spacing: 1px;
        margin-bottom: 4px;
        color: #f59e0b;
    }

    .pos-score-desc {
        font-size: 11px;
        line-height: 1.3;
        color: #64748b;
    }

    .pos-score-desc strong {
        display: none;
    }

    .pos-score-bars {
        grid-area: bars;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .pos-bar-row {
        gap: 6px;
        font-size: 11px;
        align-items: center;
    }

    .pos-bar-label {
        min-width: 28px;
        font-size: 11px;
        font-weight: 600;
        color: #475569;
    }

    .pos-bar-track {
        height: 6px;
        background: #e2e8f0;
        border-radius: 99px;
    }

    .pos-bar-percent {
        min-width: 28px;
        font-size: 10.5px;
        text-align: right;
        color: #64748b;
    }

    .pos-summary-action {
        grid-area: action;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        margin-top: 2px;
        padding-top: 10px;
        border-top: 1px dashed #e2e8f0;
    }

    .pos-btn-write {
        width: 100%;
        justify-content: center;
        padding: 11px 16px;
        font-size: 13.5px;
        font-weight: 600;
        border-radius: 8px;
        background: linear-gradient(135deg, #e11d48, #be123c);
        box-shadow: 0 3px 10px rgba(225, 29, 72, 0.22);
        touch-action: manipulation;
    }

    .pos-btn-write:active {
        transform: scale(0.98);
    }

    .pos-satisfaction-tip {
        font-size: 11.5px;
        text-align: center;
    }

    /* Filters horizontal scroll */
    .pos-review-filters {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding: 2px 2px 8px 2px;
        margin-bottom: 14px;
        scrollbar-width: none;
    }
    .pos-review-filters::-webkit-scrollbar {
        display: none;
    }
    .pos-filter-pill {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 99px;
        background: #f1f5f9;
        color: #475569;
        border: 1px solid #e2e8f0;
        touch-action: manipulation;
    }
    .pos-filter-pill.active {
        background: #fee2e2;
        color: #e11d48;
        border-color: #fca5a5;
        font-weight: 600;
    }
    .pos-filter-pill:active {
        transform: scale(0.96);
    }

    /* Review cards */
    .pos-reviews-list {
        gap: 12px;
    }

    .pos-review-card {
        padding: 14px 12px;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    }

    .pos-card-head {
        margin-bottom: 8px;
    }

    .pos-user-info {
        gap: 10px;
        width: 100%;
    }

    .pos-user-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .pos-user-meta {
        flex: 1;
        min-width: 0;
        gap: 3px;
    }

    .pos-user-name {
        font-size: 13.5px;
        font-weight: 700;
        flex-wrap: wrap;
        gap: 4px 6px;
        line-height: 1.3;
    }

    .pos-badge-verified {
        font-size: 10px;
        padding: 1px 6px;
        border-radius: 4px;
        line-height: 1.4;
    }

    .pos-card-rating {
        gap: 6px;
        align-items: center;
    }

    .pos-card-stars {
        font-size: 12px;
        letter-spacing: 0.5px;
    }

    .pos-card-date {
        font-size: 11px;
        color: #94a3b8;
    }

    .pos-card-title {
        font-size: 13.5px;
        margin: 6px 0 4px 0;
        line-height: 1.35;
    }

    .pos-card-comment {
        font-size: 13px;
        line-height: 1.55;
        color: #334155;
        margin: 0 0 10px 0;
        word-break: break-word;
    }

    .pos-shop-reply {
        padding: 10px 12px;
        margin-top: 10px;
        border-radius: 0 8px 8px 0;
        background: #f8fafc;
        border-left: 3px solid #10b981;
        font-size: 12px;
    }

    .pos-reply-author {
        font-size: 11.5px;
        font-weight: 700;
        margin-bottom: 3px;
    }

    .pos-reply-text {
        font-size: 12px;
        line-height: 1.45;
        color: #475569;
    }

    .pos-card-footer {
        padding-top: 8px;
        margin-top: 4px;
        border-top: 1px dashed #f1f5f9;
        font-size: 11px;
    }

    .pos-helpful-btn {
        padding: 4px 10px;
        font-size: 11px;
        border-radius: 6px;
        touch-action: manipulation;
    }

    .pos-btn-load-more {
        width: 100%;
        justify-content: center;
        padding: 11px 16px;
        font-size: 13px;
        border-radius: 8px;
        touch-action: manipulation;
    }

    .pos-btn-load-more:active {
        transform: scale(0.98);
    }

    /* Form Write Review */
    .pos-review-form-wrap {
        padding: 14px 12px;
        border-radius: 10px;
        margin-top: 14px;
        border: 1.5px dashed #fca5a5;
    }

    .pos-form-header {
        margin-bottom: 12px;
    }

    .pos-form-title {
        font-size: 15px;
    }

    .pos-form-stars-select {
        justify-content: center;
        gap: 8px;
        padding: 6px 0;
        margin-bottom: 12px;
    }

    .pos-form-star-item {
        font-size: 28px;
        padding: 4px;
        touch-action: manipulation;
    }

    .pos-form-row {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 10px;
    }

    .pos-form-control {
        padding: 10px 12px;
        font-size: 13.5px;
        border-radius: 8px;
        min-height: 42px;
    }

    textarea.pos-form-control {
        min-height: 80px;
    }

    .pos-form-btn-submit {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }

    .pos-form-btn-submit:active {
        transform: scale(0.98);
    }

    .pos-form-alert-success {
        padding: 10px 12px;
        font-size: 12.5px;
        border-radius: 8px;
    }
}

@media (max-width: 380px) {
    .pos-review-summary {
        grid-template-columns: 96px 1fr;
        padding: 12px 10px;
        gap: 10px 8px;
    }
    .pos-score-num {
        font-size: 30px;
    }
    .pos-stars-display {
        font-size: 11px;
        letter-spacing: 0.5px;
    }
    .pos-bar-label {
        min-width: 24px;
        font-size: 10px;
    }
    .pos-bar-percent {
        min-width: 24px;
        font-size: 10px;
    }
    .pos-form-star-item {
        font-size: 24px;
        padding: 2px;
    }
}


