/* ================= Reviews Section ================= */
.reviews-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.reviews-header .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reviews-header .section-title .fa-star { color: #f59e0b; }
.reviews-count { font-weight: 400; color: #6c757d; font-size: 0.85em; }

/* Aggregate summary */
.reviews-summary {
    display: flex;
    gap: 30px;
    margin: 20px 0;
    padding: 20px;
    background: #fafaf8;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.reviews-avg {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.avg-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2f3542;
    line-height: 1;
}

.avg-stars {
    color: #f59e0b;
    font-size: 0.9rem;
    margin: 6px 0;
}

.avg-count {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Star distribution */
.reviews-distribution { flex: 1; min-width: 200px; }

.dist-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.dist-label {
    width: 35px;
    font-size: 0.8rem;
    color: #6c757d;
    text-align: right;
}

.dist-label .fa-star { color: #f59e0b; font-size: 0.7rem; }

.dist-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.dist-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #eab308);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.dist-count {
    width: 25px;
    font-size: 0.75rem;
    color: #6c757d;
    text-align: right;
}

/* Review cards */
.reviews-list { margin-top: 20px; }

.review-card {
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #fff;
    transition: box-shadow 0.2s;
}

.review-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2C5F2D, #4a9c4e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.review-name { font-weight: 600; color: #2f3542; }

.review-verified {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #2C5F2D;
    margin-top: 2px;
}

.review-date { font-size: 0.8rem; color: #9ca3af; }
.review-stars { color: #f59e0b; font-size: 0.85rem; margin-bottom: 8px; }

.review-comment {
    color: #374151;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

/* Empty state */
.reviews-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.reviews-empty i { font-size: 2.5rem; margin-bottom: 12px; }
.reviews-empty p { margin: 4px 0; }
.reviews-empty-sub { font-size: 0.85rem; }

/* ================= Review Modal ================= */
.review-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.review-modal-overlay.active { opacity: 1; }

.review-modal {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    max-width: 480px;
    width: 90%;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.review-modal-overlay.active .review-modal { transform: translateY(0); }

.review-modal h3 {
    margin: 0 0 16px;
    font-size: 1.3rem;
    color: #2f3542;
}

.review-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
}

.review-form-product {
    font-weight: 600;
    color: #2C5F2D;
    margin: 0 0 4px;
}

.review-form-user {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0 0 20px;
}

/* Star input */
.review-star-input {
    display: flex;
    gap: 8px;
    font-size: 2rem;
    cursor: pointer;
    margin-bottom: 4px;
}

.review-star-input .star-btn { color: #d1d5db; transition: color 0.15s, transform 0.15s; }
.review-star-input .star-btn.hover { color: #fbbf24; transform: scale(1.15); }
.review-star-input .star-btn.selected { color: #f59e0b; }

.review-star-hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0 0 16px;
}

.review-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 16px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.review-textarea:focus {
    outline: none;
    border-color: #2C5F2D;
    box-shadow: 0 0 0 3px rgba(44,95,45,0.1);
}

.btn-submit-review {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #2C5F2D, #4a9c4e);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-submit-review:hover:not(:disabled) { opacity: 0.9; }
.btn-submit-review:active:not(:disabled) { transform: scale(0.98); }
.btn-submit-review:disabled { opacity: 0.5; cursor: not-allowed; }

/* ================= Review Banner ================= */
.review-banner {
    padding: 12px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    animation: reviewBannerIn 0.3s ease;
}

.review-banner-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.review-banner-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.review-banner-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

@keyframes reviewBannerIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= Order Review Buttons ================= */
.order-review-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #f59e0b, #eab308);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 6px;
}

.order-review-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.order-review-done {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #2C5F2D;
    margin-top: 6px;
}

.order-review-countdown {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
}

/* ================= Responsive ================= */
@media (max-width: 640px) {
    .reviews-summary { flex-direction: column; gap: 16px; }
    .reviews-avg { flex-direction: row; gap: 12px; }
    .avg-number { font-size: 2rem; }
    .review-star-input { font-size: 1.6rem; }
    .review-modal { padding: 20px; }
}
