/* ══════════════════════════════════════════════
   WP Reviews Pro — Frontend (Loox / BK Reviews style)
══════════════════════════════════════════════ */

.wpr-widget { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #1a1a2e; }

/* ══ SUMMARY ══ */
.wpr-summary {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    padding: 24px;
    background: #fafafa;
    border-radius: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.wpr-summary-score { text-align: center; min-width: 100px; }
.wpr-summary-avg { font-size: 52px; font-weight: 800; line-height: 1; color: #1a1a2e; }
.wpr-summary-count { font-size: 12px; color: #888; margin-top: 4px; }

.wpr-summary-bars { flex: 1; min-width: 180px; }
.wpr-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    cursor: pointer;
}
.wpr-bar-row:hover .wpr-bar-track { background: #e5e7eb; }
.wpr-bar-label { font-size: 12px; color: #555; width: 28px; flex-shrink: 0; }
.wpr-bar-track { flex: 1; height: 10px; background: #f1f1f1; border-radius: 5px; overflow: hidden; }
.wpr-bar-fill  { height: 100%; background: linear-gradient(90deg, #f59e0b, #fbbf24); border-radius: 5px; transition: width .3s; }
.wpr-bar-count { font-size: 11px; color: #888; width: 24px; text-align: right; }

/* Stars — base */
.wpr-stars     { display: inline-flex; align-items: center; gap: 1px; }
.wpr-stars svg { flex-shrink: 0; }

/* ── Star filter ── */
.wpr-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.wpr-filter-btn {
    padding: 5px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    transition: .15s;
}
.wpr-filter-btn:hover { border-color: #f59e0b; color: #f59e0b; }
.wpr-filter-btn.active { background: #f59e0b; border-color: #f59e0b; color: #fff; }

/* ══ GRID ══ */
.wpr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ══ CARD ══ */
.wpr-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    transition: box-shadow .2s, transform .2s;
}
.wpr-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.08); transform: translateY(-2px); }

/* Card header */
.wpr-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.wpr-card-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.wpr-card-meta { flex: 1; min-width: 0; }
.wpr-card-name { font-weight: 700; font-size: 14px; color: #1a1a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpr-card-info { font-size: 11px; color: #888; margin-top: 2px; }
.wpr-flag { font-size: 14px; }
.wpr-dot { color: #ccc; margin: 0 2px; }
.wpr-card-stars { margin-left: auto; flex-shrink: 0; }

/* Verified badge */
.wpr-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    margin-bottom: 8px;
}

/* Card title */
.wpr-card-title { font-size: 14px; font-weight: 700; color: #1a1a2e; margin-bottom: 6px; }

/* Card body */
.wpr-card-body {
    font-size: 13px;
    color: #444;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}
.wpr-card-body.expanded { -webkit-line-clamp: unset; overflow: visible; }

/* Card photos */
.wpr-card-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.wpr-thumb {
    width: 68px; height: 68px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform .15s, opacity .15s;
    border: 2px solid #f0f0f0;
}
.wpr-thumb:hover { transform: scale(1.05); opacity: .9; }

/* Card footer */
.wpr-card-footer { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.wpr-helpful {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: .15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.wpr-helpful:hover:not(:disabled) { border-color: #6366f1; color: #6366f1; }
.wpr-helpful:disabled { opacity: .55; cursor: default; }
.wpr-helpful-count { color: #94a3b8; }

/* ══ LOAD MORE ══ */
.wpr-loadmore-wrap { text-align: center; margin: 8px 0 24px; }
.wpr-loadmore {
    padding: 12px 36px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: .2s;
}
.wpr-loadmore:hover { border-color: #6366f1; color: #4f46e5; background: #eef2ff; }
.wpr-loadmore:disabled { opacity: .5; cursor: wait; }

/* Empty state */
.wpr-empty { text-align: center; color: #94a3b8; padding: 40px; font-size: 14px; }

/* ══ LIGHTBOX ══ */
.wpr-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wpr-lb-img-wrap { max-width: 90vw; max-height: 90vh; }
.wpr-lb-img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 4px; display: block; }
.wpr-lb-close, .wpr-lb-prev, .wpr-lb-next {
    position: absolute;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 44px; height: 44px;
    font-size: 24px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.wpr-lb-close:hover, .wpr-lb-prev:hover, .wpr-lb-next:hover { background: rgba(255,255,255,.3); }
.wpr-lb-close { top: 16px; right: 16px; font-size: 28px; }
.wpr-lb-prev  { left: 16px; top: 50%; transform: translateY(-50%); font-size: 28px; }
.wpr-lb-next  { right: 16px; top: 50%; transform: translateY(-50%); font-size: 28px; }

/* ══ PRODUCT STARS (below title) ══ */
.wpr-product-stars {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 12px;
    flex-wrap: wrap;
}
.wpr-product-stars .wpr-stars { display: inline-flex; align-items: center; gap: 1px; }
.wpr-product-stars-avg {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
}
.wpr-product-stars-count {
    font-size: 13px;
    color: #6366f1;
    text-decoration: none;
    cursor: pointer;
}
.wpr-product-stars-count:hover { text-decoration: underline; }
.wpr-product-stars-empty {
    margin: 4px 0 12px;
}
.wpr-product-stars-empty-txt {
    font-size: 13px;
    color: #94a3b8;
}
.wpr-product-stars-link {
    color: #6366f1;
    text-decoration: none;
}
.wpr-product-stars-link:hover { text-decoration: underline; }

/* ══ REVIEW FORM ══ */
.wpr-review-form-wrap {
    margin-top: 40px;
    padding: 28px 32px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
}
.wpr-form-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e8e8e8;
}

/* Star picker */
.wpr-form-stars-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}
.wpr-form-stars-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}
.wpr-form-stars {
    display: flex;
    gap: 4px;
}
.wpr-form-star {
    font-size: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: #d1d5db;
    padding: 0;
    line-height: 1;
    transition: color .1s, transform .1s;
}
.wpr-form-star:hover,
.wpr-form-star.wpr-form-star-hover  { color: #fbbf24; transform: scale(1.15); }
.wpr-form-star.wpr-form-star-active { color: #f59e0b; }

/* Fields */
.wpr-form-fields { display: flex; flex-direction: column; gap: 14px; }
.wpr-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .wpr-form-row { grid-template-columns: 1fr; } }
.wpr-form-field { display: flex; flex-direction: column; gap: 5px; }
.wpr-form-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.wpr-req { color: #ef4444; }
.wpr-opt { font-weight: 400; color: #94a3b8; font-size: 11px; }
.wpr-finput {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a2e;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.wpr-finput:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
    outline: none;
}
textarea.wpr-finput { resize: vertical; min-height: 100px; }

/* Submit row */
.wpr-form-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.wpr-form-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    font-family: inherit;
}
.wpr-form-submit:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.wpr-form-submit:disabled { opacity: .6; cursor: wait; }
.wpr-form-notice {
    font-size: 12px;
    color: #94a3b8;
}

/* Messages */
.wpr-form-msg {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}
.wpr-form-msg-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.wpr-form-msg-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ══ RESPONSIVE ══ */
@media (max-width: 600px) {
    .wpr-summary { flex-direction: column; gap: 16px; }
    .wpr-grid { grid-template-columns: 1fr; }
    .wpr-review-form-wrap { padding: 20px 16px; }
}
