/**
 * PU Auto Reviews — Frontend Review Display Styles
 *
 * Styles for inline reviews, star summary, distribution bar chart,
 * verified badges, and review cards on product pages.
 *
 * @package PU_Auto_Reviews
 */

/* ═══════════════════════════════════════════
   Star Summary (near product title)
   ═══════════════════════════════════════════ */
.pu-ar-star-summary {
    margin: 4px 0 10px;
    line-height: 1;
}

.pu-ar-star-summary-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s ease;
}

.pu-ar-star-summary-link:hover {
    opacity: 0.8;
}

.pu-ar-stars {
    display: inline-flex;
    gap: 1px;
}

.pu-ar-star {
    font-size: 16px;
    line-height: 1;
}

.pu-ar-star-full {
    color: #f0a030;
}

.pu-ar-star-half {
    color: #f0a030;
    position: relative;
}

.pu-ar-star-empty {
    color: #ccc;
}

.pu-ar-rating-number {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.pu-ar-review-count {
    font-size: 13px;
    color: #555;
}

.pu-ar-star-summary-link:hover .pu-ar-review-count {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════
   Inline Reviews Section
   ═══════════════════════════════════════════ */
.pu-ar-reviews-section {
    max-width: 900px;
    margin: 40px auto 60px;
    padding: 0 15px;
    clear: both;
}

.pu-ar-reviews-heading {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 24px;
    padding: 0 0 12px;
    border-bottom: 2px solid #eee;
    color: #1a1a1a;
}

/* ═══════════════════════════════════════════
   Rating Distribution Bar Chart
   ═══════════════════════════════════════════ */
.pu-ar-distribution {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 30px;
}

.pu-ar-distribution-summary {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.pu-ar-distribution-average {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    flex-shrink: 0;
}

.pu-ar-big-rating {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    color: #1a1a1a;
}

.pu-ar-big-stars {
    margin-top: 6px;
    display: flex;
    gap: 2px;
}

.pu-ar-big-stars .pu-ar-star {
    font-size: 18px;
}

.pu-ar-total-count {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}

.pu-ar-distribution-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pu-ar-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.pu-ar-bar-row:hover {
    background: #eef3f8;
}

.pu-ar-bar-row.pu-ar-bar-active {
    background: #e3ecf5;
}

.pu-ar-bar-row.pu-ar-bar-dimmed {
    opacity: 0.3;
}

.pu-ar-bar-label {
    font-size: 13px;
    font-weight: 500;
    min-width: 32px;
    color: #555;
    white-space: nowrap;
}

.pu-ar-bar-track {
    flex: 1;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.pu-ar-bar-fill {
    display: block;
    height: 100%;
    background: #f0a030;
    border-radius: 5px;
    transition: width 0.4s ease;
    min-width: 0;
}

.pu-ar-bar-count {
    font-size: 13px;
    color: #777;
    min-width: 24px;
    text-align: right;
}

.pu-ar-filter-clear {
    display: block;
    margin-top: 12px;
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
    cursor: pointer;
}

.pu-ar-filter-clear:hover {
    text-decoration: underline;
    color: #135e96;
}

/* ═══════════════════════════════════════════
   Review List
   ═══════════════════════════════════════════ */
.pu-ar-review-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pu-ar-review-item {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.pu-ar-review-item:last-child {
    border-bottom: none;
}

.pu-ar-review-item.pu-ar-review-hidden {
    display: none;
}

.pu-ar-review-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.pu-ar-review-stars {
    display: inline-flex;
    gap: 1px;
}

.pu-ar-review-stars .pu-ar-star {
    font-size: 15px;
}

.pu-ar-review-author {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.pu-ar-review-date {
    font-size: 12px;
    color: #999;
    margin-left: auto;
}

.pu-ar-review-content {
    font-size: 14px;
    line-height: 1.65;
    color: #444;
}

.pu-ar-review-content p {
    margin: 0;
}

.pu-ar-no-reviews {
    font-size: 14px;
    color: #888;
    font-style: italic;
    padding: 20px 0;
}

/* ═══════════════════════════════════════════
   Verified Purchase Badge
   ═══════════════════════════════════════════ */
.pu-ar-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #0a8043;
    background: #e6f5ec;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.pu-ar-verified-badge svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   Review Form
   ═══════════════════════════════════════════ */
.pu-ar-review-form-wrap {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.pu-ar-form-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */
@media (max-width: 600px) {
    .pu-ar-distribution-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .pu-ar-distribution-average {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        min-width: auto;
    }

    .pu-ar-big-rating {
        font-size: 32px;
    }

    .pu-ar-big-stars {
        margin-top: 0;
    }

    .pu-ar-total-count {
        margin-top: 0;
    }

    .pu-ar-reviews-section {
        padding: 0 10px;
    }

    .pu-ar-review-header {
        gap: 6px;
    }

    .pu-ar-review-date {
        margin-left: 0;
        width: 100%;
    }
}
