/* ==========================================================================
   Rap_MyReview Premium Mobile-First Form Styles
   ========================================================================== */

/* Enable smooth natural scrolling */
html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

body.myreview-order-review {
    background-color: #f8fafc !important;
    height: auto !important;
    min-height: 100vh !important;
}

body.myreview-order-review .page-wrapper {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    background: transparent !important;
}

body.myreview-order-review .page-main {
    max-width: 620px !important;
    margin: 0 auto !important;
    padding: 12px 14px 40px 14px !important;
}

.rap-review-container {
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.rap-review-header {
    margin-bottom: 18px;
    text-align: center;
}

.rap-review-header .rap-title {
    font-size: 19px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.rap-card-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.rap-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    gap: 12px;
}

.rap-field-row + .rap-field-row {
    border-top: 1px dashed #f1f5f9;
}

.rap-field-label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    flex: 1;
}

/* Star Rating Widget */
.star-rating-widget {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
    -webkit-user-select: none;
}

.star-rating-widget input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.star-rating-widget label {
    font-size: 30px;
    color: #d1d5db;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.1s ease, color 0.15s ease;
    padding: 2px;
}

.star-rating-widget label.active {
    color: #f59e0b !important;
}

.star-rating-widget label:hover {
    transform: scale(1.15);
}

.rap-products-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.rap-product-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
}

.rap-product-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.rap-product-qty {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.rap-comment-wrap .rap-comment-textarea {
    width: 100%;
    min-height: 80px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13.5px;
    font-family: inherit;
    color: #1e293b;
    background: #ffffff;
    box-sizing: border-box;
    resize: vertical;
    transition: border-color 0.2s;
}

.rap-comment-wrap .rap-comment-textarea:focus {
    outline: none;
    border-color: #eb5202;
    box-shadow: 0 0 0 3px rgba(235, 82, 2, 0.15);
}

.rap-privacy-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.rap-privacy-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13.5px;
    color: #166534;
    margin: 0;
}

.rap-privacy-label input[type="checkbox"] {
    margin-top: 3px;
    width: 17px;
    height: 17px;
    accent-color: #16a34a;
    cursor: pointer;
}

.rap-privacy-text {
    line-height: 1.4;
    font-weight: 600;
}

.rap-privacy-hint {
    display: block;
    font-size: 12px;
    font-weight: normal;
    color: #15803d;
    margin-top: 2px;
}

.rap-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.rap-btn-cancel {
    flex: 1;
    text-align: center;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.rap-btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.rap-btn-submit {
    flex: 2;
    padding: 12px 20px;
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #eb5202 0%, #ff7324 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(235, 82, 2, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.rap-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(235, 82, 2, 0.4);
}

@media (max-width: 480px) {
    .rap-review-container {
        padding: 16px 14px;
    }
    .rap-field-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .star-rating-widget label {
        font-size: 28px;
    }
    .rap-form-actions {
        flex-direction: column-reverse;
    }
    .rap-btn-cancel, .rap-btn-submit {
        width: 100%;
        box-sizing: border-box;
    }
}

/* ==========================================================================
   PRODUCT DETAIL PAGE: Reviews Tab & Admin Reply
   ========================================================================== */
.rap-product-reviews-wrapper {
    clear: both !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 35px;
    padding: 24px 0 10px 0;
    border-top: 1px solid #e2e8f0;
}

.rap-reviews-headline {
    margin-bottom: 24px;
}

.rap-reviews-headline .rap-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px 0;
}

.rap-reviews-headline .rap-section-desc {
    color: #6b7280;
    font-size: 13.5px;
    margin: 0;
}

/* Dashboard Summary */
.rap-reviews-dashboard {
    display: grid;
    grid-template-columns: 200px 1fr 220px;
    gap: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.rap-score-card {
    text-align: center;
    border-right: 1px solid #e2e8f0;
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.rap-big-score {
    font-size: 46px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

.rap-score-stars {
    font-size: 22px;
    margin: 8px 0;
}

.rap-score-stars .star.filled {
    color: #f59e0b;
}

.rap-score-stars .star.empty {
    color: #cbd5e1;
}

.rap-total-count {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 500;
}

/* Aspects Card */
.rap-aspects-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 0 10px;
    border-right: 1px solid #e2e8f0;
}

.rap-aspect-item .aspect-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

.rap-aspect-item .aspect-title {
    color: #334155;
    font-weight: 600;
}

.rap-aspect-item .aspect-score {
    color: #0f172a;
    font-weight: 700;
}

.aspect-bar-bg {
    width: 100%;
    height: 7px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.aspect-bar-fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 4px;
}

.aspect-bar-fill.fill-delivery {
    background: #10b981;
}

.aspect-bar-fill.fill-cs {
    background: #3b82f6;
}

/* Breakdown Card */
.rap-breakdown-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding-left: 10px;
}

.rap-breakdown-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.rap-breakdown-row .star-label {
    min-width: 28px;
    color: #475569;
    font-weight: 600;
}

.breakdown-bar-bg {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.breakdown-bar-fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 3px;
}

.breakdown-count {
    min-width: 24px;
    color: #94a3b8;
    text-align: right;
}

/* Review Cards */
.rap-reviews-items {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.rap-review-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease;
}

.rap-review-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.rap-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rap-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rap-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rap-user-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rap-badge-verified {
    font-size: 11.5px;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 2px 8px;
    font-weight: 600;
}

.rap-review-time {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Ratings per aspect pill */
.rap-card-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.rating-pill {
    font-size: 12px;
    background: #f1f5f9;
    color: #334155;
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.rating-pill strong {
    color: #d97706;
}

/* Comment text */
.rap-card-comment {
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 14px;
}

/* Admin Reply Box */
.rap-admin-reply-box {
    background: #f8fafc;
    border-left: 3.5px solid #0284c7;
    border-radius: 0 8px 8px 0;
    padding: 14px 16px;
    margin-top: 14px;
    border-top: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.rap-admin-reply-box .reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.reply-badge {
    font-size: 11px;
    font-weight: 700;
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reply-admin-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
}

.reply-time {
    font-size: 12px;
    color: #94a3b8;
    margin-left: auto;
}

.reply-content {
    font-size: 13.5px;
    line-height: 1.55;
    color: #334155;
}

/* Empty State */
.rap-empty-reviews {
    text-align: center;
    padding: 48px 24px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
}

.rap-empty-reviews .empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.rap-empty-reviews h4 {
    font-size: 18px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.rap-empty-reviews p {
    font-size: 14px;
    max-width: 480px;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rap-reviews-dashboard {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .rap-score-card, .rap-aspects-card {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding-right: 0;
        padding-bottom: 16px;
    }
    .rap-rating-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .rap-rating-info {
        max-width: 100%;
    }
}

/* ==========================================================================
   MULTI-PRODUCT REVIEW & PRIVACY STYLES
   ========================================================================== */
.rap-section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 22px;
}

.rap-section-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.rap-service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .rap-service-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.rap-products-review-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rap-product-review-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 18px;
}

.rap-item-header {
    margin-bottom: 12px;
}

.rap-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rap-item-badge {
    font-size: 16px;
}

.rap-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}

.rap-item-qty {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.rap-item-rating-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.rap-item-rating-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
}

.rap-item-comment-row .rap-comment-textarea {
    width: 100%;
    min-height: 85px;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13.5px;
    color: #1e293b;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rap-item-comment-row .rap-comment-textarea:focus {
    border-color: #eb5202;
    box-shadow: 0 0 0 3px rgba(235, 82, 2, 0.15);
    outline: none;
}

/* Privacy Checkbox Card */
.rap-privacy-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.rap-privacy-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #166534;
    margin: 0;
}

.rap-privacy-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: #16a34a;
    cursor: pointer;
}

.rap-privacy-text {
    line-height: 1.4;
    font-weight: 600;
}

.rap-privacy-subtext {
    display: block;
    font-size: 12.5px;
    font-weight: 400;
    color: #15803d;
    margin-top: 2px;
}

/* ==========================================================================
   LISTING PRODUCT REVIEW SUMMARY (Stars in Catalog & Detail Page)
   ========================================================================== */
.product-item .rap-listing-reviews-summary,
.product-info-main .rap-listing-reviews-summary,
.rap-listing-reviews-summary {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin: 1px 0 2px 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    vertical-align: middle;
}

body .products-grid .product-item .product-item-name {
    margin: 0 0 2px 0 !important;
}

body .products-grid .product-item .product-item-name a {
    height: auto !important;
    min-height: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
}

.rap-listing-reviews-summary .rating-summary {
    display: inline-block;
    vertical-align: middle;
    overflow: visible !important;
}

.rap-listing-reviews-summary .rating-result {
    width: 88px !important;
    max-width: none !important;
    display: inline-block;
    position: relative;
    vertical-align: middle;
    overflow: hidden;
}

.rap-listing-reviews-summary .rating-result:before {
    font-size: 16px !important;
    line-height: 16px !important;
    height: 16px !important;
    letter-spacing: 2px !important;
    width: 88px !important;
    color: #c7c7c7 !important;
}

.rap-listing-reviews-summary .rating-result > span {
    display: block;
    overflow: hidden;
}

.rap-listing-reviews-summary .rating-result > span:before {
    font-size: 16px !important;
    line-height: 16px !important;
    height: 16px !important;
    letter-spacing: 2px !important;
    width: 88px !important;
    color: #f59e0b !important; /* Gold Stars - 100% full, no cut off */
}

.rap-listing-reviews-summary .reviews-actions {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin: 0 !important;
    padding: 0 !important;
}

.rap-listing-reviews-summary .action.view {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1;
}

.rap-listing-reviews-summary .action.view:hover .rap-rating-score,
.rap-listing-reviews-summary .action.view:hover .rap-review-qty {
    color: #eb5202;
}

.rap-listing-reviews-summary .rap-rating-score {
    font-weight: 700;
    color: #f59e0b;
    font-size: 13px;
    line-height: 1;
}

.rap-listing-reviews-summary .rap-review-qty {
    color: #64748b;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
}

.rap-listing-reviews-summary .rap-no-reviews-label {
    color: #94a3b8;
    font-size: 12px;
    font-style: italic;
}
