/* Product Review Widget Styles */

.pr-container {
    width: 100%;
}

/* ===== Summary Section ===== */
.pr-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pr-summary-stats {
    flex: 0 0 auto;
}

.pr-avg-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.pr-avg-number {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.pr-avg-stars .pr-star {
    display: inline-flex;
    align-items: center;
}

.pr-avg-stars .pr-star svg {
    width: 18px;
    height: 18px;
}

.pr-total-label {
    font-size: 14px;
    color: #666;
}

.pr-bars {
    max-width: 350px;
}

.pr-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.pr-bar-label {
    font-size: 13px;
    color: #666;
    width: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.pr-bar-star {
    width: 13px;
    height: 13px;
}

.pr-bar-star path {
    fill: #f0a30a;
}

.pr-bar {
    flex: 1;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.pr-bar-fill {
    height: 100%;
    background-color: #f0a30a;
    border-radius: 4px;
    transition: width 0.3s;
}

.pr-bar-count {
    font-size: 13px;
    color: #666;
    width: 28px;
    text-align: right;
    flex-shrink: 0;
}

.pr-summary-action {
    flex-shrink: 0;
    padding-top: 40px;
}

.pr-write-btn {
    background-color: #f0a30a;
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.pr-write-btn:hover {
    opacity: 0.85;
}

/* ===== Stars ===== */
.pr-star {
    display: inline-flex;
    align-items: center;
}

.pr-star svg {
    display: block;
}

.pr-star.filled svg path {
    fill: #f0a30a;
}

.pr-star.empty svg path {
    fill: #d0d0d0;
}

/* ===== Filters Row ===== */
.pr-filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.pr-display-count {
    font-size: 14px;
    color: #666;
}

.pr-filters {
    display: flex;
    gap: 12px;
}

.pr-filter-group select {
    padding: 8px 32px 8px 14px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23666' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 120px;
}

.pr-filter-group select:focus {
    outline: none;
    border-color: #999;
}

/* ===== Review Grid ===== */
.pr-grid {
    column-count: 4;
    column-gap: 16px;
    margin-bottom: 30px;
}

.pr-no-reviews {
    text-align: center;
    color: #999;
    padding: 40px 0;
    column-span: all;
}

/* ===== Review Card ===== */
.pr-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    break-inside: avoid;
    margin-bottom: 16px;
}

.pr-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pr-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

.pr-author-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pr-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pr-verified {
    color: #4CAF50;
    font-size: 10px;
}

.pr-date {
    font-size: 12px;
    color: #999;
}

.pr-card-stars .pr-star svg {
    width: 16px;
    height: 16px;
}

.pr-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
}

.pr-card-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}


/* Review Images */
.pr-card-images {
    margin: -16px -16px 12px -16px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.pr-card-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.pr-card-img + .pr-card-img {
    margin-top: 4px;
}

.pr-card-img:hover {
    transform: scale(1.05);
}

/* Card Footer */
.pr-card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 8px;
    font-size: 12px;
    color: #999;
}

.pr-helpful-text {
    font-size: 12px;
    color: #999;
}

.pr-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 12px;
    padding: 2px 4px;
    transition: color 0.2s;
}

.pr-vote-btn:hover {
    color: #333;
}

.pr-vote-btn svg {
    vertical-align: middle;
}

.pr-vote-count {
    font-size: 12px;
}

/* ===== Load More ===== */
.pr-load-more-wrap {
    text-align: center;
    margin-bottom: 20px;
}

.pr-load-more-btn {
    padding: 10px 40px;
    background: #fff;
    border: 1px solid #ddd;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.pr-load-more-btn:hover {
    border-color: #f0a30a;
    background: #f0a30a;
    color: #fff;
}

/* ===== Modal ===== */
.pr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.pr-modal.active {
    display: flex;
}

.pr-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.pr-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    padding: 30px 40px;
    z-index: 1;
}

.pr-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    outline: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.pr-modal-close:hover {
    color: #333;
    background: none;
}

.pr-modal-title {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 25px 0;
    color: #333;
}

.pr-modal-product {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 25px;
}

.pr-modal-product img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
}

.pr-modal-product span {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

/* Review Form */
.pr-review-form .pr-form-row {
    display: flex;
    gap: 16px;
}

.pr-review-form .pr-form-row .pr-form-group {
    flex: 1;
}

.pr-review-form .pr-form-group {
    margin-bottom: 20px;
}

.pr-review-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.pr-review-form label .required {
    color: #e74c3c;
}

.pr-review-form input[type="text"],
.pr-review-form input[type="email"],
.pr-review-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.pr-review-form input:focus,
.pr-review-form textarea:focus {
    outline: none;
    border-color: #f0a30a;
}

.pr-review-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Rating Select */
.pr-rating-select {
    display: flex;
    gap: 6px;
}

.pr-rating-star {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.15s;
    line-height: 1;
}

.pr-rating-star svg {
    width: 28px;
    height: 28px;
}

.pr-rating-star svg path {
    fill: #d0d0d0;
    transition: fill 0.15s;
}

.pr-rating-star.active svg path,
.pr-rating-star.hover svg path {
    fill: #f0a30a;
}

/* Image Upload */
.pr-image-upload {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.pr-upload-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    background: #fff;
}

.pr-upload-trigger:hover {
    border-color: #333;
    background-color: #fafafa;
}

.pr-upload-text {
    font-size: 14px;
    color: #333;
}

.pr-image-upload .pr-upload-hint {
    display: block !important;
    font-size: 13px;
    color: #999;
    font-style: italic;
    margin-top: 4px;
}

.pr-upload-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pr-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
}

.pr-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.pr-preview-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
}

/* Submit */
.pr-form-submit {
    margin-top: 10px;
}

.pr-modal-submit {
    width: 100%;
    padding: 14px;
    background: #f0a30a;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.pr-modal-submit:hover {
    opacity: 0.85;
}

.pr-modal-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pr-form-message {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
}

.pr-form-message.success {
    color: #4CAF50;
}

.pr-form-message.error {
    color: #e74c3c;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .pr-grid {
        column-count: 3;
    }
}

@media (max-width: 767px) {
    .pr-summary {
        flex-direction: column;
        gap: 20px;
    }

    .pr-summary-action {
        padding-top: 0;
    }

    .pr-grid {
        column-count: 2;
    }

    .pr-filters-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .pr-modal-content {
        padding: 20px;
        width: 95%;
    }

    .pr-review-form .pr-form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .pr-grid {
        column-count: 1;
    }
}

/* ===== Customer Photos ===== */
.pr-customer-photos {
    flex: 1;
    padding-left: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pr-photos-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.pr-photos-grid {
    display: flex;
    gap: 8px;
}

.pr-photo-item {
    width: 75px;
    height: 75px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.pr-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.pr-photo-item:hover img {
    transform: scale(1.1);
}

.pr-photo-more::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.pr-photo-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    z-index: 1;
}

/* ===== Lightbox ===== */
.pr-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.9);
}

.pr-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pr-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.pr-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    line-height: 1;
    outline: none;
}

.pr-lightbox-prev,
.pr-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.pr-lightbox-prev svg,
.pr-lightbox-next svg {
    stroke: #fff;
}

.pr-lightbox-prev {
    left: 50px;
}

.pr-lightbox-next {
    right: 50px;
}

.pr-lightbox-content {
    display: flex;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    z-index: 5;
}

.pr-lightbox-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100% - 320px);
}

.pr-lightbox-image img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.pr-lightbox-info {
    width: 320px;
    background: #fff;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 80vh;
    overflow-y: auto;
}

.pr-lightbox-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pr-lightbox-header .pr-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    font-size: 16px;
}

.pr-lightbox-header .pr-author-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.pr-lightbox-header .pr-date {
    font-size: 12px;
    color: #999;
    display: block;
}

.pr-lightbox-stars .pr-star {
    display: inline-flex;
}

.pr-lightbox-stars .pr-star svg {
    width: 14px;
    height: 14px;
}

.pr-lightbox-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.pr-lightbox-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.pr-lightbox-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.pr-card-images:hover .pr-card-img {
    cursor: pointer;
}

@media (max-width: 900px) {
    .pr-lightbox-content {
        flex-direction: column;
        max-width: 95%;
    }

    .pr-lightbox-image {
        max-width: 100%;
    }

    .pr-lightbox-info {
        width: 100%;
        max-height: 40vh;
    }

    .pr-lightbox-prev {
        left: 20px;
    }

    .pr-lightbox-next {
        right: 20px;
    }

    .pr-summary {
        flex-wrap: wrap;
    }

    .pr-customer-photos {
        flex: 0 0 100%;
        padding: 20px 0 0 0 !important;
        order: 3;
    }

    .pr-summary-action {
        order: 2;
    }
}
