/* 
 * Custom Product Reviews CSS
 * Uses CSS variables from the theme with documented fallbacks.
 * Primary: var(--wp--preset--color--primary, #98782D)
 * Secondary: var(--wp--preset--color--secondary, #063F30)
 * Tertiary: var(--wp--preset--color--tertiary, #EDEBE4)
 */

.ng-custom-reviews-section {
    margin: 60px 0;
    font-family: inherit;
}

.ng-reviews-section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--wp--preset--color--secondary, #063F30);
    margin-bottom: 24px;
}

/* =========================================
   SUMMARY BLOCK
   ========================================= */
.ng-reviews-summary-block {
    margin-bottom: 40px;
}

.ng-reviews-summary-inner {
    display: flex;
    gap: 40px;
    align-items: center;
    background: var(--wp--preset--color--tertiary, #EDEBE4);
    padding: 30px;
    border-radius: 12px;
}

.ng-reviews-average-col {
    text-align: center;
    min-width: 150px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ng-reviews-avg-number {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--wp--preset--color--secondary, #063F30);
}

.ng-reviews-stars {
    color: var(--wp--preset--color--primary, #98782D);
    margin-bottom: 4px;
}

.ng-reviews-stars .ng-custom-stars {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.ng-reviews-stars .ng-star svg {
    width: 24px;
    height: auto;
}

.ng-reviews-total-text {
    font-size: 0.9rem;
    color: #666;
}

.ng-reviews-bars-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.ng-reviews-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ng-reviews-bar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    font-size: 0.85rem;
    color: #555;
}

.ng-reviews-bar-star {
    font-weight: 700;
    color: var(--wp--preset--color--secondary, #063F30);
}

.ng-review-rating-num {
    font-weight: 700;
    color: var(--wp--preset--color--secondary, #063F30);
}

.ng-review-stars .ng-custom-stars {
    display: flex;
    gap: 2px;
}

.ng-review-stars .ng-star svg {
    width: 16px;
    height: auto;
}

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

.ng-reviews-bar-fill {
    height: 100%;
    background: var(--wp--preset--color--primary, #98782D);
    border-radius: 4px;
}

/* =========================================
   REVIEW LIST & CARD
   ========================================= */
.ng-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.ng-review-card {
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 24px;
}

.ng-review-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ng-review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.ng-review-author-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ng-review-avatar img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.ng-review-author-info {
    display: flex;
    flex-direction: column;
}

.ng-review-author-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--wp--preset--color--secondary, #063F30);
}

.ng-review-verified-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #27ae60;
    background: #eafaf1;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.ng-review-date {
    font-size: 0.8rem;
    color: #888;
}

.ng-review-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ng-review-rating-num {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--wp--preset--color--secondary, #063F30);
}

.ng-review-rating .ng-review-stars {
    margin: 0;
    font-size: 1rem;
}

.ng-review-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 700;
}

.ng-review-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
}

/* Media Thumbnails */
.ng-review-media {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.ng-media-thumb {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1px solid #eaeaea;
}

.ng-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ng-video-placeholder {
    width: 100%;
    height: 100%;
    background: #333;
}

.ng-play-icon {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ng-play-icon svg {
    width: 28px;
    height: 28px;
}

.ng-reviews-load-more-container {
    text-align: center;
    margin-top: 30px;
}

.ng-load-more-btn {
    background: transparent;
    border: 2px solid var(--wp--preset--color--primary, #98782D);
    color: var(--wp--preset--color--primary, #98782D);
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.ng-load-more-btn:hover {
    background: var(--wp--preset--color--primary, #98782D);
    color: #fff;
}

/* =========================================
   FORM & MODAL
   ========================================= */
.ng-review-action-area {
    margin-bottom: 24px;
}

.ng-write-review-btn {
    background: var(--wp--preset--color--primary, #98782D);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.ng-write-review-btn:hover {
    opacity: 0.9;
}

.ng-review-ineligible-msg {
    padding: 16px;
    background: #f9f9f9;
    border-left: 4px solid var(--wp--preset--color--primary, #98782D);
    color: #555;
    font-size: 0.95rem;
}

/* Modal Overlay */
.ng-review-form-wrapper.ng-is-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ng-review-form-wrapper.ng-is-modal .ng-review-form-inner {
    background: #fff;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ng-review-form-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #888;
}

/* Inline form */
.ng-review-form-wrapper.ng-is-inline {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 12px;
    margin-top: 20px;
}

.woocommerce #reviews h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.4rem;
    color: var(--wp--preset--color--secondary, #063F30);
}

.ng-form-row {
    margin-bottom: 12px;
    position: relative;
}

.ng-flex-row {
    display: flex;
    gap: 16px;
}

.ng-flex-row .ng-col {
    flex: 1;
}

.ng-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.ng-form-row input[type="text"],
.ng-form-row input[type="email"],
.ng-form-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
}

.ng-form-row input:focus,
.ng-form-row textarea:focus {
    border-color: var(--wp--preset--color--primary, #98782D);
    outline: none;
}

.ng-char-counter {
    position: absolute;
    bottom: -20px;
    right: 0;
    font-size: 0.75rem;
    color: #888;
}

.ng-star-rating-input {
    display: flex;
    gap: 4px;
    font-size: 1.8rem;
    cursor: pointer;
    color: #ccc;
}

.ng-star-rating-input .ng-star.active path,
.ng-star-rating-input .ng-star.hover path {
    fill: var(--wp--preset--color--primary, #98782D);
}

/* Uploads */
.ng-upload-hint {
    font-size: 0.8rem;
    color: #666;
    margin: 0 0 10px;
}

.ng-dropzone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
}

.ng-dropzone.dragover {
    border-color: var(--wp--preset--color--primary, #98782D);
    background: #f0f7f4;
}

.ng-dropzone-inner svg {
    color: #888;
    margin-bottom: 0;
}

.ng-browse-text {
    color: var(--wp--preset--color--primary, #98782D);
    text-decoration: underline;
    font-weight: 600;
}

.ng-upload-previews {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.ng-upload-preview-item {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    position: relative;
    border: 1px solid #ddd;
}

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

.ng-remove-preview {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e74c3c;
    color: #fff;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ng-upload-counts {
    font-size: 0.8rem;
    color: #888;
    margin-top: 10px;
}

.ng-submit-btn {
    background: var(--wp--preset--color--secondary, #063F30);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.2s;
}

.ng-submit-btn:hover {
    opacity: 0.9;
}

.ng-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ng-review-form-msg {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 6px;
    display: none;
    font-size: 0.9rem;
}

.ng-review-form-msg.error {
    background: #fdf3f2;
    color: #c0392b;
    border: 1px solid #f5c6cb;
    display: block;
}

.ng-review-form-msg.success {
    background: #f0faf4;
    color: #27ae60;
    border: 1px solid #c3e6cb;
    display: block;
}

/* Lightbox styles can be simple */
.ng-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.ng-lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.ng-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.ng-lightbox-content img,
.ng-lightbox-content video {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.ng-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

.ng-lightbox-prev,
.ng-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    user-select: none;
    padding: 20px;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .ng-reviews-summary-inner {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .ng-flex-row {
        flex-direction: column;
    }
}