/* ===========================
   Reviews Section CSS
   =========================== */

/* --- Star Rating Display (readonly) --- */
.stars-display {
    display: inline-flex;
    gap: 1px;
    color: #f4c542;
    font-size: 1.1rem;
    line-height: 1;
}

.stars-display .star-empty {
    color: #ddd;
}

/* --- Star Rating Input (form) --- */
.star-rating-input {
    display: inline-flex;
    flex-direction: row;
    gap: 4px;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
    line-height: 1;
}

.star-rating-input .star-btn {
    color: #ddd;
    transition: color 0.1s, transform 0.1s;
    cursor: pointer;
}

.star-rating-input .star-btn.active {
    color: #f4c542;
}

.star-rating-input .star-btn:hover {
    color: #f4c542;
    transform: scale(1.15);
}

/* --- Rating Distribution Bar --- */
.rating-distribution {
    margin: 0.75rem 0;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    font-size: 0.875rem;
}

.rating-bar-label {
    width: 2rem;
    text-align: right;
    color: #555;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.rating-bar-track {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: #f4c542;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rating-bar-count {
    width: 1.5rem;
    color: #6c757d;
    font-size: 0.78rem;
    text-align: left;
    flex-shrink: 0;
}

/* --- Review Summary Header --- */
.reviews-summary {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.reviews-avg-score {
    text-align: center;
    flex-shrink: 0;
}

.reviews-avg-number {
    font-size: 3rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.reviews-avg-stars {
    font-size: 1.3rem;
    color: #f4c542;
    margin: 0.25rem 0;
}

.reviews-avg-count {
    font-size: 0.8rem;
    color: #6c757d;
}

.reviews-distribution {
    flex: 1;
    min-width: 180px;
}

/* --- Review Card --- */
.review-card {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.review-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.review-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.review-author-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

.review-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.review-author-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d3748;
}

.review-date {
    font-size: 0.8rem;
    color: #9ca3af;
}

.review-rating-stars {
    font-size: 1.15rem;
    color: #f4c542;
    flex-shrink: 0;
    letter-spacing: 1px;
}

.review-title {
    font-weight: 600;
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 0.4rem;
}

.review-content {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-word;
}

.review-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f4f8;
}

/* --- Review Form --- */
.review-form-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid #e8ecf0;
}

.review-form-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.25rem;
}

.star-rating-wrapper {
    margin-bottom: 1rem;
}

.star-rating-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #4a5568;
}

/* --- Empty state --- */
.reviews-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #9ca3af;
    font-size: 1rem;
}

.reviews-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

/* --- Login CTA --- */
.review-login-cta {
    background: #f0f4ff;
    border: 1.5px dashed #c3cfe2;
    border-radius: 10px;
    padding: 2rem 1rem;
    text-align: center;
    color: #5a6a7e;
}

/* --- Pending notice --- */
.review-pending-notice {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: #92400e;
    background: #fef3c7;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
}

/* --- Already reviewed notice --- */
.review-already-notice {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #065f46;
    font-size: 0.9rem;
}

/* --- Pagination --- */
.reviews-pagination {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* --- Comparison sidebar widget --- */
.comparison-widget .sidebar-title {
    margin-bottom: 12px;
}

.comparison-widget .comparison-hint {
    font-size: 0.82rem;
    color: var(--text-light, #666);
    margin-bottom: 12px;
}

/* --- Comparison form selects (sidebar widget + compare page) --- */
.comparison-widget .form-select,
.compare-form .form-select {
    width: 100%;
    border: 1.5px solid var(--border-color, #e0e0e0);
    border-radius: var(--radius-md, 8px);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text-dark, #333);
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: auto;
}

.comparison-widget .form-select:focus,
.compare-form .form-select:focus {
    border-color: var(--primary, #1e3a5f);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
    outline: none;
}

/* --- Comparison submit button (sidebar widget + compare page) --- */
.comparison-widget .btn-compare,
.compare-form .btn-compare {
    display: block;
    width: 100%;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    color: var(--primary, #1e3a5f);
    background: transparent;
    border: 2px solid var(--primary, #1e3a5f);
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.comparison-widget .btn-compare:hover,
.compare-form .btn-compare:hover {
    background: var(--primary, #1e3a5f);
    color: #fff;
}

/* --- Comparison table --- */
.comparison-table th {
    vertical-align: middle;
}

.comparison-table td {
    vertical-align: middle;
    padding: 0.85rem 1rem;
}

.comparison-table td i {
    margin-right: 0.5rem;
}

/* --- Responsive --- */
@media (max-width: 576px) {
    .reviews-summary {
        flex-direction: column;
        gap: 1rem;
    }

    .reviews-avg-score {
        width: 100%;
    }

    .star-rating-input {
        font-size: 1.75rem;
    }
}
