/* ========================================
   REVIEWS — سیستم نظرات
   ======================================== */

.ip-reviews {
    padding: 40px 0;
    background: #f8fafc;
    margin: 40px 0;
}

.ip-reviews-title {
    font-size: 24px;
    margin: 0 0 30px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============ Summary ============ */
.ip-reviews-summary {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    background: white;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ip-reviews-avg {
    text-align: center;
    padding: 20px 0;
    border-left: 1px solid #e2e8f0;
}
.ip-reviews-avg strong {
    display: block;
    font-size: 56px;
    color: #6366f1;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}
.ip-reviews-avg .ip-stars {
    font-size: 22px;
    margin: 10px 0;
}
.ip-reviews-avg span {
    color: #64748b;
    font-size: 13px;
}

.ip-rating-bar-row {
    display: grid;
    grid-template-columns: 50px 1fr 40px;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
}
.ip-rating-bar-label { color: #64748b; font-weight: 600; }
.ip-rating-bar-track {
    height: 10px;
    background: #f1f5f9;
    border-radius: 5px;
    overflow: hidden;
}
.ip-rating-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    transition: width 0.3s;
    border-radius: 5px;
}
.ip-rating-bar-count { color: #64748b; text-align: left; font-weight: 600; }

/* ============ Add Review Button ============ */
.ip-add-review-wrapper {
    text-align: center;
    margin: 20px 0;
}
.ip-add-review-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.ip-add-review-btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* ============ Review Form ============ */
.ip-review-form-wrap {
    background: white;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.08);
}
.ip-review-form-wrap h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #0f172a;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.ip-star-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 16px;
}
.ip-star-input input { display: none; }
.ip-star-input label {
    font-size: 32px;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}
.ip-star-input label:hover,
.ip-star-input label.hover {
    color: #fbbf24;
    transform: scale(1.15);
}
.ip-star-input input:checked ~ label {
    color: #fbbf24;
}

#ip-review-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    line-height: 1.7;
    margin-bottom: 14px;
}
#ip-review-form textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ip-form-msg { margin-top: 12px; font-size: 13px; }

/* ============ Reviews List ============ */
.ip-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ip-review-item {
    background: white;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.ip-review-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.ip-review-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.ip-review-avatar img {
    border-radius: 50%;
    display: block;
}
.ip-review-user {
    flex: 1;
    min-width: 0;
}
.ip-review-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.ip-review-name strong {
    font-size: 14px;
    color: #0f172a;
    font-weight: 700;
}
.ip-badge-buyer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #dcfce7;
    color: #166534;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.ip-badge-admin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eef2ff;
    color: #4f46e5;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.ip-stars {
    display: inline-flex;
    gap: 2px;
    font-size: 16px;
}
.ip-stars.small { font-size: 14px; }
.ip-stars span { color: #d1d5db; }
.ip-stars span.active { color: #fbbf24; }
.ip-rating-num {
    color: #64748b;
    font-size: 12px;
    margin-right: 6px;
    font-weight: 600;
}

.ip-review-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ip-review-date {
    color: #94a3b8;
    font-size: 12px;
}
.ip-delete-review {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.ip-delete-review:hover {
    background: #fee2e2;
    color: #ef4444;
}

.ip-review-body {
    font-size: 14px;
    line-height: 1.8;
    color: #334155;
    margin-bottom: 14px;
}
.ip-review-body p { margin: 0 0 8px; }
.ip-review-body p:last-child { margin-bottom: 0; }

/* ============ Actions ============ */
.ip-review-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

.ip-reply-toggle,
.ip-view-replies {
    background: none;
    border: none;
    color: #6366f1;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ip-reply-toggle:hover,
.ip-view-replies:hover {
    background: #eef2ff;
    color: #4f46e5;
}

/* ============ Reply Form ============ */
.ip-reply-form-wrap {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.ip-reply-to {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
}
.ip-reply-to strong { color: #0f172a; }

.ip-reply-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    line-height: 1.7;
    margin-bottom: 10px;
}
.ip-reply-form textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ip-reply-form-actions {
    display: flex;
    gap: 8px;
}

/* ============ Replies List ============ */
.ip-replies-list {
    margin-top: 16px;
    padding-right: 24px;
    border-right: 3px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ip-review-reply {
    background: #f8fafc;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}
.ip-review-reply .ip-review-body {
    font-size: 13px;
    margin-bottom: 0;
}

/* ============ Buttons ============ */
.ip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.ip-btn-primary { background: #6366f1; color: white; }
.ip-btn-primary:hover { background: #4f46e5; color: white; }
.ip-btn-outline {
    background: transparent;
    color: #6366f1;
    border: 2px solid #6366f1;
}
.ip-btn-outline:hover { background: #6366f1; color: white; }
.ip-btn-sm { padding: 8px 16px; font-size: 13px; }

.ip-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============ Alerts ============ */
.ip-alert-success,
.ip-alert-error,
.ip-alert-info {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    margin: 8px 0;
}
.ip-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-right: 4px solid #10b981;
}
.ip-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-right: 4px solid #ef4444;
}
.ip-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-right: 4px solid #3b82f6;
}

/* ============ Empty ============ */
.ip-empty-reviews {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    border: 2px dashed #e2e8f0;
}
.ip-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}
.ip-empty-reviews p {
    color: #64748b;
    font-size: 15px;
    margin: 0;
}

/* ============ Login Required ============ */
.ip-login-to-review {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.ip-login-to-review a {
    color: #6366f1;
    font-weight: 700;
    text-decoration: none;
}
.ip-login-to-review a:hover {
    text-decoration: underline;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
   .ip-reviews-summary {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    .ip-reviews-avg {
        border-left: none;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 20px;
    }
    .ip-reviews-avg strong { font-size: 42px; }
    .ip-reply-form-actions { flex-direction: column; }
    .ip-reply-form-actions .ip-btn { width: 100%; }
    .ip-replies-list { padding-right: 12px; }
    .ip-review-name { gap: 6px; }
    .ip-badge-buyer, .ip-badge-admin { font-size: 10px; padding: 2px 8px; }
}