/* ==========================================================================
   WooCommerce Product Reviews Pro - Frontend Styles
   ========================================================================== */

:root {
    --wpr-primary:    #f97316;
    --wpr-primary-dk: #ea580c;
    --wpr-star:       #f59e0b;
    --wpr-star-empty: #d1d5db;
    --wpr-text:       #111827;
    --wpr-muted:      #6b7280;
    --wpr-border:     #e5e7eb;
    --wpr-bg:         #f9fafb;
    --wpr-white:      #ffffff;
    --wpr-verified:   #16a34a;
    --wpr-radius:     10px;
    --wpr-shadow:     0 1px 3px rgba(0,0,0,.08);
}

/* Wrapper */
.wpr-wrapper { font-family: inherit; color: var(--wpr-text); }

/* ===== SUMMARY ===== */
.wpr-summary {
    display: flex;
    gap: 32px;
    align-items: center;
    background: var(--wpr-bg);
    border: 1px solid var(--wpr-border);
    border-radius: var(--wpr-radius);
    padding: 24px 28px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.wpr-summary__score {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}
.wpr-summary__avg {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--wpr-primary);
}
.wpr-summary__total {
    font-size: .85rem;
    color: var(--wpr-muted);
    margin-top: 4px;
}
.wpr-summary__bars {
    flex: 1;
    min-width: 200px;
}
.wpr-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: opacity .15s;
}
.wpr-bar-row:hover { opacity: .7; }
.wpr-bar-row__label { font-size: .8rem; color: var(--wpr-muted); width: 32px; text-align: right; }
.wpr-bar-row__track {
    flex: 1;
    height: 8px;
    background: var(--wpr-border);
    border-radius: 99px;
    overflow: hidden;
}
.wpr-bar-row__fill {
    height: 100%;
    background: var(--wpr-star);
    border-radius: 99px;
    transition: width .4s ease;
}
.wpr-bar-row__count { font-size: .78rem; color: var(--wpr-muted); width: 30px; }

/* ===== STARS ===== */
.wpr-stars { display: inline-flex; gap: 2px; }
.wpr-star--full  { color: var(--wpr-star); }
.wpr-star--half  { color: var(--wpr-star); opacity: .6; }
.wpr-star--empty { color: var(--wpr-star-empty); }
.wpr-stars--lg .wpr-star { font-size: 1.4rem; }
.wpr-stars--sm .wpr-star { font-size: .85rem; }

/* ===== FILTERS ===== */
.wpr-filters {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}
.wpr-filters__group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.wpr-filters__group label { font-size: .875rem; color: var(--wpr-muted); white-space: nowrap; }
.wpr-filters__group select {
    border: 1px solid var(--wpr-border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: .875rem;
    background: var(--wpr-white);
    cursor: pointer;
}

/* ===== REVIEW ITEM ===== */
.wpr-review-item {
    border: 1px solid var(--wpr-border);
    border-radius: var(--wpr-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    background: var(--wpr-white);
    box-shadow: var(--wpr-shadow);
    transition: box-shadow .2s;
}
.wpr-review-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }

.wpr-review-item__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.wpr-review-item__author { display: flex; align-items: center; gap: 12px; }
.wpr-avatar { border-radius: 50%; width: 44px; height: 44px; }
.wpr-review-item__author-info strong { display: block; font-size: .95rem; }
.wpr-review-item__meta { text-align: right; }
.wpr-review-item__date { font-size: .8rem; color: var(--wpr-muted); display: block; margin-top: 4px; }

.wpr-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    border-radius: 99px;
    padding: 2px 8px;
    margin-top: 3px;
}
.wpr-badge--verified { background: #dcfce7; color: var(--wpr-verified); }

.wpr-review-item__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 8px;
}
.wpr-review-item__content { font-size: .9rem; line-height: 1.7; color: var(--wpr-text); }
.wpr-review-item__content p { margin: 0 0 8px; }

/* Criteria display */
.wpr-criteria-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    margin-top: 12px;
    padding: 12px;
    background: var(--wpr-bg);
    border-radius: 8px;
}
.wpr-criteria-display__row { display: flex; align-items: center; gap: 8px; }
.wpr-criteria-display__label { font-size: .78rem; color: var(--wpr-muted); flex: 1; }

/* Images */
.wpr-review-item__images { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.wpr-image-thumb { display: block; width: 72px; height: 72px; border-radius: 6px; overflow: hidden; border: 1px solid var(--wpr-border); }
.wpr-image-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.wpr-image-thumb:hover img { transform: scale(1.06); }

/* Votes */
.wpr-review-item__footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--wpr-border);
}
.wpr-helpful-label { font-size: .8rem; color: var(--wpr-muted); margin-right: 4px; }
.wpr-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--wpr-border);
    background: var(--wpr-white);
    border-radius: 99px;
    padding: 4px 14px;
    font-size: .8rem;
    cursor: pointer;
    transition: all .15s;
}
.wpr-vote-btn:hover { border-color: var(--wpr-primary); color: var(--wpr-primary); }
.wpr-vote-btn.voted { background: var(--wpr-primary); color: #fff; border-color: var(--wpr-primary); }
.wpr-vote-count { font-weight: 700; }

/* Replies */
.wpr-replies { margin-top: 14px; padding-left: 20px; border-left: 3px solid var(--wpr-primary); }
.wpr-reply { background: #fff7ed; border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; }
.wpr-reply strong { font-size: .875rem; }
.wpr-reply__badge {
    display: inline-block;
    margin-left: 6px;
    font-size: .68rem;
    background: var(--wpr-primary);
    color: #fff;
    border-radius: 99px;
    padding: 1px 7px;
    font-weight: 600;
}
.wpr-reply p { font-size: .875rem; margin: 6px 0 4px; }
.wpr-reply time { font-size: .75rem; color: var(--wpr-muted); }

/* ===== NO REVIEWS ===== */
.wpr-no-reviews { color: var(--wpr-muted); font-style: italic; padding: 20px 0; }

/* ===== PAGINATION ===== */
.wpr-pagination { text-align: center; margin: 20px 0; }

/* ===== FORM ===== */
.wpr-form-wrap {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 2px solid var(--wpr-border);
}
.wpr-form-wrap h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 20px; }

#wpr-form-messages .wpr-notice {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: .9rem;
}
.wpr-notice--success { background: #dcfce7; color: #15803d; }
.wpr-notice--error   { background: #fee2e2; color: #b91c1c; }

.wpr-field { margin-bottom: 16px; }
.wpr-field label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }
.wpr-field input[type="text"],
.wpr-field input[type="email"],
.wpr-field textarea {
    width: 100%;
    border: 1px solid var(--wpr-border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: .9rem;
    transition: border-color .15s;
    box-sizing: border-box;
}
.wpr-field input:focus,
.wpr-field textarea:focus { outline: none; border-color: var(--wpr-primary); box-shadow: 0 0 0 3px rgba(249,115,22,.15); }

.wpr-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Star picker */
.wpr-star-picker { display: inline-flex; gap: 4px; font-size: 2rem; cursor: pointer; }
.wpr-star-picker--sm { font-size: 1.1rem; }
.wpr-star-picker__star { color: var(--wpr-star-empty); transition: color .1s, transform .1s; }
.wpr-star-picker__star.active,
.wpr-star-picker__star.hover { color: var(--wpr-star); }
.wpr-star-picker__star:hover { transform: scale(1.2); }

/* Criteria group */
.wpr-criteria-group { margin-bottom: 16px; }
.wpr-criteria-group > label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 10px; }
.wpr-criteria-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    background: var(--wpr-bg);
    border-radius: 8px;
    margin-bottom: 8px;
}
.wpr-criteria-row span { flex: 1; font-size: .875rem; }

/* Image upload */
.wpr-image-upload { margin-top: 4px; }
.wpr-image-upload__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px dashed var(--wpr-border);
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: .875rem;
    color: var(--wpr-muted);
    transition: all .15s;
}
.wpr-image-upload__btn:hover { border-color: var(--wpr-primary); color: var(--wpr-primary); }
#wpr-image-input { display: none; }
.wpr-image-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.wpr-preview-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--wpr-border);
}
.wpr-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.wpr-preview-item__remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Buttons */
.wpr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    padding: 11px 24px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.wpr-btn--primary { background: var(--wpr-primary); color: #fff; }
.wpr-btn--primary:hover { background: var(--wpr-primary-dk); }
.wpr-btn--primary:disabled { opacity: .6; cursor: not-allowed; }
.wpr-btn--outline { background: transparent; border: 1px solid var(--wpr-border); color: var(--wpr-text); }
.wpr-btn--outline:hover { border-color: var(--wpr-primary); color: var(--wpr-primary); }

/* Spinner */
.wpr-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wpr-spin .6s linear infinite;
}
@keyframes wpr-spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 600px) {
    .wpr-summary { flex-direction: column; }
    .wpr-field-row { grid-template-columns: 1fr; }
    .wpr-filters { flex-direction: column; align-items: flex-start; }
    .wpr-review-item { padding: 14px 16px; }
}
