/*
Product Reviews Enhanced Styling
Matches the design from the provided image
*/

/* CSS Variables for Product Reviews */
:root {
    /* Review Colors */
    --review-border: #E9E9E9;
    --review-border-light: #f0f0f0;
    --review-border-dark: #d0d0d0;
    --review-border-darker: #ddd;
    
    /* Text Colors */
    --review-text-primary: #111827;
    --review-text-secondary: #666;
    --review-text-muted: #999;
    --review-text-light: #9ca3af;
    --review-text-dark: #1a1a1a;
    --review-text-medium: #4a4a4a;
    --review-text-gray: #495057;
    --review-text-gray-dark: #6c757d;
    --review-text-dark-blue: #2c3e50;
    --review-text-neutral: #333;
    
    /* Background Colors */
    --review-bg-light: #f8f9fa;
    --review-bg-neutral: #E5E7EB;
    --review-bg-white: #fff;
    
    /* Status Colors */
    --review-success: #28a745;
    --review-success-light: #d4edda;
    --review-success-dark: #155724;
    --review-success-bg: #e8f5e8;
    --review-success-green: #2e7d32;
    
    --review-danger: #dc3545;
    --review-danger-light: #f8d7da;
    --review-danger-dark: #721c24;
    --review-danger-bg: #ffebee;
    --review-danger-red: #d32f2f;
    
    --review-info: #1976d2;
    --review-info-light: #e3f2fd;
    --review-info-dark: #0c5460;
    
    /* Star/Rating Colors */
    --review-star-orange: #ffa500;
    
    /* Featured/Accent Colors */
    --review-accent-orange: #ff6b35;
    --review-accent-gradient-start: #fff;
    --review-accent-gradient-end: #fef9f7;
    --review-featured-bg: #FCF3E0;
    
    /* Border Colors */
    --review-border-gray: #d2d6dc;
    --review-border-light-gray: #e9ecef;
    --review-border-input: #e5e5e5;
    --review-border-search: #D2D6DC;
    
    /* Button Colors */
    --review-btn-primary: #252F3F;
    --review-btn-secondary: #007cba;
    --review-btn-text: #444444;
    --review-btn-border: #e5e5e5;
    
    /* Modal Colors */
    --review-modal-overlay: rgba(0, 0, 0, 0.85);
    --review-modal-bg: rgba(255, 255, 255, 0.9);
    --review-modal-content: rgba(255, 255, 255, 1);
    
    /* Shadow Colors */
    --review-shadow-light: rgba(0, 0, 0, 0.05);
    --review-shadow-medium: rgba(0, 0, 0, 0.1);
    --review-shadow-dark: rgba(0, 0, 0, 0.15);
    --review-shadow-focus: rgba(59, 130, 246, 0.1);
    --review-shadow-secondary: rgba(0, 124, 186, 0.1);
    --review-shadow-danger: rgba(220, 53, 69, 0.1);
}

/* Review Summary Section - Main Container */
.review-summary-section {
    padding: 24px;
    display: flex;
    gap: 50px;
}

.review-summary-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    max-width: 480px;
}

/* Overall Rating Display */
.average-rating {
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rating-number {
    font-size: 30px;
    font-weight: 600;
    line-height: 1;
    color: var(--review-text-primary);
    line-height: 1;
    margin-bottom: 0;
}

.rating-top {
    font-size: 14px;
}

.rating-stars .star-rating {
    font-size: 18px;
}

.rating-count {
    font-size: 14px;
    color: var(--review-text-secondary);
    margin-top: 4px;
}

/* Rating Breakdown Bars */
.rating-breakdown {
    flex: 1;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    text-align: right;
}

.rating-label {
    font-size: 14px;
    color: var(--review-text-secondary);
}

.rating-bar {
    flex: 1;
    height: 16px;
    background: var(--review-bg-neutral);
    border-radius: 2px;
    overflow: hidden;
}

.rating-fill {
    height: 100%;
    background: var(--review-star-orange);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rating-row .rating-count {
    font-size: 13px;
    color: var(--review-text-secondary);
    min-width: 20px;
    text-align: right;
    margin-top: 0;
}

/* Recommendation Circle */
.recommendation-stats {
    text-align: center;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.circle-progress {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--review-bg-neutral);
}

.circle-text {
    z-index: 2;
    text-align: center;
}

.circle-text .percentage {
    display: block;
    font-size: 22px;
    font-weight: 600;
    color: var(--review-btn-text);
    line-height: 1;
    letter-spacing: -0.55px;
}

.recommendation-text {
    color: var(--review-btn-text);
}

/* Write Review Button */
.single-product .write-review-btn {
    color: var(--review-btn-primary);
    border: none;
    padding: 14px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    background: var(--review-bg-white, #fff);
    border: 2px solid var(--review-btn-primary);
    min-width: 320px;
}

.single-product .write-review-btn:hover {
    background: var(--review-btn-primary);
    color: var(--review-bg-white);
}

/* Enhanced Review Form Fields */
.bitprice-review-custom-fields {
    margin: 25px 0;
    padding: 25px;
    background: var(--review-bg-light);
    border-radius: 12px;
    border: 1px solid var(--review-border-light-gray);
}

.bitprice-review-custom-fields h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--review-text-dark-blue);
}

/* Recommendation Field Styling */
.recommendation-only-row {
    margin-bottom: 30px;
}

.recommendation-field {
    margin-bottom: 0;
}

.recommendation-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.recommendation-option {
    flex: 1;
    min-width: 200px;
    position: relative;
    cursor: pointer;
    margin: 0;
}

/* Image Upload Row Styling */
.image-upload-row {
    margin-bottom: 20px;
}

.image-upload-field {
    width: 100%;
}

.recommendation-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.recommendation-option .option-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border: 2px solid var(--review-border-light-gray);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    transform: translateY(0);
    box-shadow: 0 2px 4px var(--review-shadow-light);
}

.recommendation-option:hover .option-content {
    border-color: var(--review-btn-secondary);
    background: var(--review-bg-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--review-shadow-medium);
}

.recommendation-option.selected .option-content {
    transform: translateY(0);
    box-shadow: 0 4px 16px var(--review-shadow-dark);
}

/* Recommend Option (Yes) */
.recommendation-option.recommend input:checked + .option-content {
    border-color: var(--review-success);
    background: var(--review-success-light);
    color: var(--review-success-dark);
}

.recommendation-option.recommend .option-content i {
    color: var(--review-success);
    font-size: 18px;
}

.recommendation-option.recommend input:checked + .option-content i {
    color: var(--review-success-dark);
}

/* Not Recommend Option (No) */
.recommendation-option.not-recommend input:checked + .option-content {
    border-color: var(--review-danger);
    background: var(--review-danger-light);
    color: var(--review-danger-dark);
}

.recommendation-option.not-recommend .option-content i {
    color: var(--review-danger);
    font-size: 18px;
}

.recommendation-option.not-recommend input:checked + .option-content i {
    color: var(--review-danger-dark);
}

.option-text {
    font-size: 15px;
    line-height: 1.4;
}

/* Review Custom Fields in Form */
.bitprice-review-custom-fields {
    margin: 20px 0;
}

.bitprice-review-custom-fields p {
    margin-bottom: 15px;
}

.bitprice-review-custom-fields label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.bitprice-review-custom-fields input[type="checkbox"] {
    margin-right: 8px;
}

.bitprice-review-custom-fields input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--review-border-darker);
    border-radius: 4px;
}

.bitprice-review-custom-fields .form-text {
    color: var(--review-text-secondary);
    font-size: 12px;
    margin-top: 5px;
}

#review-image-preview,
#review-image-preview-custom {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Review Search Field */
.bitprice-reviews-search {
    width: 100%;
    margin-bottom: 20px;
}

.bitprice-reviews-search-wrapper {
    position: relative;
    width: 100%;
}

.bitprice-reviews-search input[type="search"] {
    width: 100%;
    height: 38px;
    padding: 6px 13px 6px 37px;
    border: 1px solid var(--review-border-search);
    border-radius: 6px;
    box-shadow: 0 1px 2px var(--review-shadow-light);
    font-size: 14px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.bitprice-reviews-search input[type="search"]:focus {
    outline: none;
    box-shadow: 0 1px 2px var(--review-shadow-light), 0 0 0 3px var(--review-shadow-focus);
}

.bitprice-reviews-search input[type="search"]::placeholder {
    color: var(--review-text-light);
    opacity: 1;
}

.bitprice-reviews-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--review-text-light);
    pointer-events: none;
}

.bitprice-reviews-search-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}


/* Review Filters */
.review-filters {
    margin-bottom: 30px;
}

.filter-options {
    display: flex;
    gap: 20px;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--review-btn-text);
    white-space: nowrap;
    margin-bottom: 0;
}

.review-filter-select {
    padding: 5px 35px 5px 15px;
    border: 1px solid var(--review-border-search);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    height: 32px;
    background-position: calc(100% - 8px) 8px;
}

.review-filter-select:focus {
    outline: none;
    border-color: var(--review-btn-secondary);
    box-shadow: 0 0 0 2px var(--review-shadow-secondary);
}

.active-filters {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--review-border-light-gray);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filters-label {
    font-size: 13px;
    color: var(--review-text-gray-dark);
    font-weight: 600;
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    background: var(--review-info-light);
    color: var(--review-info);
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-tag .remove {
    cursor: pointer;
    font-weight: bold;
}

.single-product #reviews .clear-filters {
    border: none;
    background: var(--review-danger-light);
    color: var(--review-danger);
    font-size: 12px;
    line-height: 1.6;
    cursor: pointer;
    text-decoration: none;
    border-radius: 12px 12px 12px 12px;
    padding: 4px 8px;

}
.single-product #reviews .clear-filters:hover,
.single-product #reviews .clear-filters:focus {
    background: var(--review-danger-light);
    text-decoration: none;
    box-shadow: none;
}

/* Review Items */
/* ===============================================
   INDIVIDUAL REVIEW CARDS - NEW DESIGN
   =============================================== */

/* Main review list container */
.commentlist.reviews-list,
#reviews-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Individual Review Card - Works for both initial and AJAX-loaded reviews */
#reviews .review-card,
#reviews li.review-card,
#reviews .commentlist li[id^="li-comment-"] {
    border-bottom: 1px solid var(--review-border);
    padding: 24px 0;
    margin-bottom: 16px;
    position: relative;
    transition: all 0.3s ease;
    list-style: none;
    display: block;
}

#reviews .review-card:hover,
#reviews li.review-card:hover,
#reviews .commentlist li[id^="li-comment-"]:hover {
    border-color: var(--review-border-dark);
}

#reviews .review-card.featured-review,
#reviews li.review-card.featured-review,
#reviews .commentlist li[id^="li-comment-"].featured-review {
    border-left: 4px solid var(--review-accent-orange);
    background: linear-gradient(135deg, var(--review-accent-gradient-start) 0%, var(--review-accent-gradient-end) 100%);
}

/* Review Content Container */
.review-content {
    position: relative;
    display: flex;
    gap: 24px;
}

/* Review Header */
.review-card .review-header,
li.review-card .review-header,
.commentlist li[id^="li-comment-"] .review-header {
    flex: 0 0 200px;
    max-width: 200px;
    margin-bottom: 16px;
}

.review-card .review-description {
    flex: 1;
    padding-right: 30px;
}

.review-card .reviewer-info,
li.review-card .reviewer-info,
.commentlist li[id^="li-comment-"] .reviewer-info {
    display: flex;
    gap: 12px;
    flex: 1;
    margin-bottom: 12px;
}

/* Reviewer Avatar */
.review-card .reviewer-avatar,
li.review-card .reviewer-avatar,
.commentlist li[id^="li-comment-"] .reviewer-avatar {
    width: 40px;
    height: 40px;
    position: relative;
}

#reviews .review-card .reviewer-avatar img,
#reviews li.review-card .reviewer-avatar img,
#reviews .commentlist li[id^="li-comment-"] .reviewer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
}

/* Featured Badge on Avatar */
.featured-badge-avatar {
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
    background: var(--review-featured-bg);
    border-radius: 12px;
    padding: 4px 12px;
    display: inline-block;
}


/* Registered User Badge on Avatar */
.registered-user-badge-avatar {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    z-index: 2;
}

/* Adjust positioning when both badges are present */
.reviewer-avatar:has(.featured-badge-avatar) .registered-user-badge-avatar {
    bottom: 14px;
    left: -2px;
}

/* Fallback for browsers that don't support :has() */
.reviewer-avatar .featured-badge-avatar ~ .registered-user-badge-avatar {
    bottom: 14px;
    left: -2px;
}

/* Reviewer Details */
.review-card .reviewer-details,
li.review-card .reviewer-details {
    flex: 1;
    min-width: 0;
}

.review-card .reviewer-name,
li.review-card .reviewer-name {
    font-size: 16px;
    line-height: 1;
    font-weight: 600;
    color: var(--review-text-dark);
    margin: 0 0 4px 0;
}

/* Reviewer Country */
.review-card .reviewer-country,
li.review-card .reviewer-country {
    font-size: 12px;
    color: var(--review-text-secondary);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.review-card .reviewer-country .country-flag,
li.review-card .reviewer-country .country-flag {
    font-size: 11px;
    color: var(--review-text-muted);
    margin-right: 2px;
}

.review-card .reviewer-country .country-flag-emoji,
li.review-card .reviewer-country .country-flag-emoji {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
}

/* Review Description Header */
.review-description-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Review Meta */
.review-card .review-meta,
li.review-card .review-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-card .review-date,
li.review-card .review-date {
    color: var(--review-text-secondary);
    font-size: 13px;
    font-weight: 400;
}

/* Review Badges Container */
.review-card .review-badges,
li.review-card .review-badges {
    display: flex;
    gap: 6px;
}

/* Recommended Badge */
.review-card .recommended-badge,
li.review-card .recommended-badge {
    color: var(--review-success-green);
    font-size: 13px;
    font-weight: 400;
    padding-left: 20px;
    margin-bottom: 6px;
    position: relative;
}
.review-card .recommended-badge:before,
li.review-card .recommended-badge:before {
    content: '';
    position: absolute;
    left: 6px;
    top: calc(50% - 2px);
    transform: translateY(-50%) rotate(45deg);
    width: 6px;
    height: 10px;
    border-right: 1px solid var(--review-success-green);
    border-bottom: 1px solid var(--review-success-green);
    z-index: 2;
}

/* Not Recommended Badge */
.review-card .not-recommended-badge,
li.review-card .not-recommended-badge {
    color: var(--review-danger-red);
    font-size: 13px;
    font-weight: 400;
    padding-left: 20px;
    margin-bottom: 6px;
    position: relative;
}
.review-card .not-recommended-badge:before,
li.review-card .not-recommended-badge:before {
    content: '';
    position: absolute;
    left: 3px;
    top: calc(50% - 1px);
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 1px;
    background: var(--review-danger-red);
    z-index: 2;
}
.review-card .not-recommended-badge:after,
li.review-card .not-recommended-badge:after {
    content: '';
    position: absolute;
    left: 3px;
    top: calc(50% - 1px);
    transform: translateY(-50%) rotate(-45deg);
    width: 12px;
    height: 1px;
    background: var(--review-danger-red);
    z-index: 2;
}

.review-card .review-rating .star-rating,
li.review-card .review-rating .star-rating {
    font-size: 16px;
}

/* Review Title */
.review-card .review-title,
li.review-card .review-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--review-text-dark);
    margin: 0 0 2px 0;
    line-height: 1.4;
}

/* Review Text Content */
.review-card .review-text,
li.review-card .review-text {
    color: var(--review-text-medium);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.review-card .review-text p,
li.review-card .review-text p {
    margin: 0 0 12px 0;
}

.review-card .review-text p:last-child,
li.review-card .review-text p:last-child {
    margin-bottom: 0;
}

/* Review Images */
.review-card .review-images,
li.review-card .review-images {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.review-card .review-image,
li.review-card .review-image {
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid var(--review-border);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.review-card .review-image:hover,
li.review-card .review-image:hover {
    transform: scale(1.05);
}

.review-card .review-image img,
li.review-card .review-image img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    display: block;
}

/* Review Helpfulness Section */
.review-card .review-helpfulness,
li.review-card .review-helpfulness {
    display: flex;
    align-items: center;
}

.review-card .helpfulness-question,
li.review-card .helpfulness-question {
    color: var(--review-text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.review-card .helpfulness-buttons,
li.review-card .helpfulness-buttons {
    display: flex;
    gap: 8px;
}

.single-product .review-card .helpfulness-btn,
.single-product li.review-card .helpfulness-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--review-bg-white, #fff);
    border: 1px solid var(--review-border);
    color: var(--review-text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.review-card .helpfulness-btn:hover:not(:disabled),
li.review-card .helpfulness-btn:hover:not(:disabled) {
    background: var(--review-bg-light);
    border-color: var(--review-border-dark);
    color: var(--review-text-primary);
}

.review-card .helpfulness-btn:disabled,
li.review-card .helpfulness-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.review-card .helpfulness-btn.voted,
li.review-card .helpfulness-btn.voted {
    background: var(--review-success-bg);
    border-color: var(--review-success-green);
    color: var(--review-success-green);
}

.review-card .helpfulness-btn.voted.not-helpful-btn,
li.review-card .helpfulness-btn.voted.not-helpful-btn {
    background: var(--review-danger-bg);
    border-color: var(--review-danger-red);
    color: var(--review-danger-red);
}

.review-card .helpfulness-btn i,
li.review-card .helpfulness-btn i {
    font-size: 12px;
}

/* Helpfulness Total Summary */
.review-card .helpfulness-total,
li.review-card .helpfulness-total {
    color: var(--review-text-secondary);
    font-size: 13px;
    font-style: italic;
}

/* Adjust helpfulness layout to stack when total is present */
.review-card .review-helpfulness:has(.helpfulness-total),
li.review-card .review-helpfulness:has(.helpfulness-total) {
    align-items: center;
    gap: 8px;
}

.review-card .review-helpfulness:has(.helpfulness-total) .helpfulness-buttons,
li.review-card .review-helpfulness:has(.helpfulness-total) .helpfulness-buttons {
    justify-content: flex-end;
}
/* Review Form - General Styles */
.comment-form {
    background: var(--review-bg-light);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--review-border-light-gray);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Form Field Styling */
.comment-form-title,
.comment-form-comment,
.comment-form-author,
.comment-form-email {
    margin-bottom: 20px;
}

.comment-form-title label,
.comment-form-comment label,
.comment-form-author label,
.comment-form-email label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--review-text-primary);
    font-size: 14px;
}

/* Review Title Field */
.comment-form-title input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--review-border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.comment-form-title input:focus {
    outline: none;
    border-color: var(--review-btn-secondary);
    box-shadow: 0 0 0 3px var(--review-shadow-secondary);
}

.comment-form-title input::placeholder {
    color: var(--review-text-muted);
    font-style: italic;
}

/* Comment Textarea */
.comment-form-comment textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--review-border-input);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: var(--review-bg-white);
    transition: all 0.3s ease;
    box-sizing: border-box;
    resize: vertical;
    min-height: 120px;
}

.comment-form-comment textarea:focus {
    outline: none;
    border-color: var(--review-btn-secondary);
    box-shadow: 0 0 0 3px var(--review-shadow-secondary);
}

.comment-form-comment textarea::placeholder {
    color: var(--review-text-muted);
    font-style: italic;
}

/* Name and Email Fields */
.comment-form-author input,
.comment-form-email input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--review-border-input);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: var(--review-bg-white);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.comment-form-author input:focus,
.comment-form-email input:focus {
    outline: none;
    border-color: var(--review-btn-secondary);
    box-shadow: 0 0 0 3px var(--review-shadow-secondary);
}

/* Required Field Styling */
.required {
    color: #dc3545;
    font-weight: bold;
}

/* Field Error States */
.comment-form-title.error input,
.comment-form-rating.error select,
.comment-form-comment.error textarea,
.comment-form-author.error input,
.comment-form-email.error input,
.recommendation-field.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1) !important;
}

.recommendation-field.error .recommendation-options {
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 15px;
    background-color: rgba(220, 53, 69, 0.05);
}

.recommendation-field.error h4 {
    color: #dc3545;
}

/* Inline Field Error Messages */
.field-error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 5px 0 15px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease-out;
}

.field-error-message i {
    color: #dc3545;
    flex-shrink: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 50px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

/* Form Validation Messages (legacy - keeping for backwards compatibility) */
.form-error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

/* CSS Variable Overrides for remaining hardcoded colors */
/* Update any remaining hardcoded colors that weren't caught in the main replacements */

/* Replace remaining #007cba with CSS variable */
.comment-form-title input:focus,
.comment-form-comment textarea:focus,
.comment-form-author input:focus,
.comment-form-email input:focus {
    border-color: var(--review-btn-secondary) !important;
}

.review-filter-select:focus {
    border-color: var(--review-btn-secondary) !important;
}

.load-more-btn {
    border-color: var(--review-btn-secondary) !important;
    color: var(--review-btn-secondary) !important;
}

.load-more-btn:hover {
    background: var(--review-btn-secondary) !important;
}

/* Replace remaining #dc3545 with CSS variable */
.required,
.field-error-message,
.field-error-message i,
.form-error-message,
.clear-filters {
    color: var(--review-danger) !important;
}

.field-error-message {
    background-color: var(--review-danger-light) !important;
}

.form-error-message {
    background-color: var(--review-danger-light) !important;
}

.comment-form-title.error input,
.comment-form-rating.error select,
.comment-form-comment.error textarea,
.comment-form-author.error input,
.comment-form-email.error input,
.recommendation-field.error {
    border-color: var(--review-danger) !important;
}

.recommendation-field.error .recommendation-options {
    border-color: var(--review-danger) !important;
}

.recommendation-field.error h4 {
    color: var(--review-danger) !important;
}

/* Replace remaining grays and other colors */
.reviews-count-info {
    color: var(--review-text-gray-dark) !important;
}

.no-reviews-message h3 {
    color: var(--review-text-dark-blue) !important;
}

.no-reviews-message p {
    color: var(--review-text-gray-dark) !important;
}

.no-reviews-message {
    background: var(--review-bg-light) !important;
}

/* Upload zone styling */
.upload-zone {
    border-color: var(--review-btn-border) !important;
    background: var(--review-bg-light) !important;
}

.upload-zone:hover {
    border-color: var(--review-btn-secondary) !important;
}

.upload-text {
    color: var(--review-text-gray) !important;
}

.upload-hint {
    color: var(--review-text-gray-dark) !important;
}

.upload-icon {
    color: var(--review-text-gray-dark) !important;
}

/* Modal styling */
.modal-close,
.modal-nav {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--review-text-primary) !important;
}

.modal-close:hover,
.modal-nav:hover {
    opacity: 0.7;
}

.modal-counter {
    color: var(--review-bg) !important;
}

/* Preview styling */
.preview-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    border-color: var(--review-border-darker) !important;
}

.preview-item img:hover {
    border-color: var(--review-btn-secondary) !important;
}

.remove-preview {
    background: var(--review-danger) !important;
    color: #fff;
}

.remove-preview:hover {
    background: var(--review-danger-red) !important;
}

.preview-empty {
    color: var(--review-text-secondary) !important;
}

.preview-count {
    color: var(--review-text-secondary) !important;
}

.review-image_preview {
    border-color: var(--review-border-darker) !important;
    background: var(--review-bg-neutral) !important;
}

/* Message notifications */
.review-message-success {
    background: var(--review-success-light) !important;
    color: var(--review-success-dark) !important;
}

.review-message-error {
    background: var(--review-danger-light) !important;
    color: var(--review-danger-dark) !important;
}

.review-message-info {
    background: var(--review-info-light) !important;
    color: #0c5460 !important;
}

/* Circle progress - static (no animation) */

/* Loading state for buttons */
.helpfulness-btn.loading,
.load-more-btn.loading {
    position: relative;
    color: transparent;
}

.helpfulness-btn.loading::after,
.load-more-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Utility Classes for JavaScript State Management */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.flex-visible {
    display: flex !important;
}

.inline-flex-visible {
    display: inline-flex !important;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.overflow-hidden {
    overflow: hidden;
}

.recommendation-only-row {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.recommendation-only-row .recommendation-field {
    flex: 1;
    max-width: 600px;
}

/* ===============================================
   IMAGE MODAL STYLING
   =============================================== */

/* Modal Container - Hidden by default */
.review-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Modal Active State */
.review-image-modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* Modal Overlay */
.review-image-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

/* Modal Content Container */
.review-image-modal .modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Close Button */
.review-image-modal .modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s ease;
    color: var(--review-text-primary);
}

.review-image-modal .modal-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Image Container */
.review-image-modal .modal-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

/* Modal Image */
.review-image-modal .modal-image {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Navigation Buttons */
.review-image-modal .modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.3s ease;
    color: var(--review-text-primary);
}

.review-image-modal .modal-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
}

.review-image-modal .modal-nav-prev {
    left: -54px;
}

.review-image-modal .modal-nav-next {
    right: -54px;
}

/* Hide navigation buttons when not needed */
.review-image-modal .modal-nav.hidden {
    display: none;
}

/* Modal Info */
.review-image-modal .modal-info {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.review-image-modal .modal-counter {
    font-size: 12px;
    font-weight: 500;
    color: var(--review-text-primary);
    white-space: nowrap;
}

/* Responsive Design for Modal - moved to consolidated media queries at end */

/* Image Preview Styling in Reviews */
#review-image-preview-custom {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

#review-image-preview-custom .preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--review-border);
    transition: all 0.3s ease;
}

#review-image-preview-custom .preview-item:hover {
    border-color: var(--review-border-dark);
    transform: scale(1.05);
}

#review-image-preview-custom .preview-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

#review-image-preview-custom .remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--review-danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
    transition: all 0.3s ease;
    padding: 0;
}

#review-image-preview-custom .remove-preview:hover {
    background: var(--review-danger-red);
    transform: scale(1.1);
}

#review-image-preview-custom .preview-empty {
    color: var(--review-text-secondary);
    font-style: italic;
    font-size: 14px;
    padding: 20px;
    text-align: center;
    border: 2px dashed var(--review-border);
    border-radius: 8px;
    width: 100%;
    background: var(--review-bg-light);
}

#review-image-preview-custom .preview-count {
    color: var(--review-text-secondary);
    font-size: 12px;
    margin-top: 5px;
}


/* Responsive adjustments moved to consolidated media queries at end */

/* ===============================================
   RESPONSIVE STYLES
   =============================================== */

/* Tablet Breakpoint (768px and below) */
@media (max-width: 768px) {
    /* Review Summary Section */
    .review-summary-section {
        flex-direction: column;
        padding: 24px 0 16px;
        gap: 24px;
    }
    
    /* Search Input */
    .bitprice-reviews-search input[type="search"] {
        font-size: 16px; /* Prevents zoom on iOS */
        height: 42px;
        padding: 8px 12px 8px 36px;
    }
    
    .bitprice-reviews-search-icon {
        left: 11px;
        width: 15px;
        height: 15px;
    }

    /* Review Content Layout */
    .review-content {
        flex-direction: column;
        gap: 0;
    }
    
    .review-card .review-header, 
    li.review-card .review-header,
    .commentlist li[id^="li-comment-"] .review-header {
        flex: 0 0 auto;
        max-width: 100%;
        margin-bottom: 0;
        display: flex;
        align-items: flex-start;
    }
    
    .review-card .review-helpfulness, 
    li.review-card .review-helpfulness,
    .review-card .review-helpfulness:has(.helpfulness-total), 
    li.review-card .review-helpfulness:has(.helpfulness-total) {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .review-card .review-description {
        padding-right: 0;
    }

    .filter-options {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    /* Modal Styles */
    .review-image-modal .modal-image {
        max-width: 95vw;
        max-height: 75vh;
    }
    
    .review-image-modal .modal-close {
        top: -40px;
        right: -8px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .review-image-modal .modal-nav {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .review-image-modal .modal-nav-prev {
        left: -48px;
    }
    
    .review-image-modal .modal-nav-next {
        right: -48px;
    }
    
    .review-image-modal .modal-info {
        bottom: -40px;
        padding: 5px 10px;
    }
    
    .review-image-modal .modal-counter {
        font-size: 10px;
    }
}

/* Mobile Breakpoint (480px and below) */
@media (max-width: 480px) {
    /* Modal Navigation */
    .review-image-modal .modal-nav-prev {
        left: -40px;
    }
    
    .review-image-modal .modal-nav-next {
        right: -40px;
    }
    
    .review-image-modal .modal-nav {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* ==================================================
   FORM SUBMISSION LOADING STATES
   ================================================== */

/* Submit button loading state */
.button-loading {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Loading indicator container */
.loading-indicator {
    display: none;
    align-items: center;
    margin-top: 10px;
    font-size: 14px;
    color: var(--review-text-muted);
}

.loading-indicator.visible {
    display: flex;
}

/* Loading spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--review-border);
    border-radius: 50%;
    border-top-color: var(--review-info);
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.loading-text {
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success message styling - positioned under form */
.review-message {
    position: relative;
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: fadeInDown 0.3s ease;
}

.review-message-success {
    background-color: var(--review-success-bg);
    color: var(--review-success-dark);
    border: 1px solid var(--review-success);
}

.review-message-error {
    background-color: var(--review-danger-bg);
    color: var(--review-danger-dark);
    border: 1px solid var(--review-danger);
}

.review-message-info {
    background-color: var(--review-info-light);
    color: var(--review-info-dark);
    border: 1px solid var(--review-info);
}

@keyframes fadeInDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile adjustments for loading */
@media (max-width: 768px) {
    .loading-indicator {
        font-size: 13px;
    }
    
    .loading-spinner {
        width: 18px;
        height: 18px;
        margin-right: 8px;
    }
    
    .review-message {
        margin: 15px 0;
        padding: 12px 15px;
        font-size: 14px;
    }
}