/* Reviews Section Redesign */
.info-block.reviews-block .info-block-content {
    padding: 0;
}

.reviews-wrapper {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    padding: 30px;
}

@media screen and (min-width: 993px) {
    .reviews-summary {
        position: sticky;
        top: 100px;
        align-self: start;
        height: max-content;
        z-index: 10;
    }
}

.reviews-summary-header {
    text-align: center;
    margin-bottom: 20px;
}

.reviews-summary-title {
    font-size: 14px;
    color: var(--pc-muted, #6b7280);
    margin-bottom: 8px;
}

.reviews-summary-rating {
    font-size: 32px;
    font-weight: 700;
    color: var(--pc-text, #222);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.reviews-summary-rating .stars {
    font-size: 20px;
    color: #fbbf24;
}

.reviews-summary-count {
    font-size: 12px;
    color: var(--pc-muted, #9ca3af);
    margin-top: 4px;
}

/* Star Breakdown */
.star-breakdown {
    margin: 20px 0;
}

.star-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.star-row-label {
    font-size: 13px;
    color: var(--pc-text, #222);
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 12px;
}

.star-row-label .star-icon {
    color: #fbbf24;
    font-size: 14px;
}

.star-row-bar {
    flex: 1;
    height: 8px;
    background: var(--pc-line, #e5e7eb);
    border-radius: 4px;
    overflow: hidden;
}

.star-row-fill {
    height: 100%;
    background: #fbbf24;
    transition: width 0.3s ease;
}

.star-row-count {
    font-size: 12px;
    color: var(--pc-muted, #6b7280);
    min-width: 20px;
    text-align: right;
}

/* Write Review Button */
.write-review-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--primary-color, #17a34a);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.write-review-btn svg {
    flex-shrink: 0;
}

.write-review-btn:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 163, 74, 0.3);
}

/* Right Column - Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    padding: 20px;
    background: var(--pc-card, #fff);
    border: 1px solid var(--pc-line, #e6e8eb);
    border-radius: 12px;
    transition: box-shadow 0.3s ease;
    margin-bottom: 12px;
}


.review-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.review-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-author-info {
    flex: 1;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.review-author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--pc-text, #222);
}

.verified-badge {
    width: 16px;
    height: 16px;
    color: #10b981;
}

.review-author-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.review-meta-secondary {
    font-size: 12px;
    color: var(--pc-muted, #9ca3af);
    margin: 2px 0 6px;
}

.review-date {
    font-size: 12px;
    color: var(--pc-muted, #9ca3af);
}

.review-stars {
    color: #fbbf24;
    font-size: 13px;
    margin-bottom: 10px;
    display: flex;
    gap: 2px;
}

.review-date {
    font-size: 12px;
    color: var(--pc-muted, #9ca3af);
    display: flex;
    align-items: center;
}


.review-content {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--pc-text, #374151);
}

.review-reply-to {
    font-size: 12px;
    color: var(--pc-muted, #9ca3af);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.review-reply-to span {
    color: var(--primary-color, #17a34a);
    font-weight: 600;
}

.review-attributes {
    margin: 12px 0;
    padding: 12px;
    background: var(--pc-card, #f9fafb);
    border-radius: 6px;
    font-size: 13px;
}

.review-attribute {
    margin-bottom: 6px;
}

.review-attribute:last-child {
    margin-bottom: 0;
}

.review-attribute strong {
    color: var(--pc-text, #222);
    font-weight: 600;
}

/* Photo and Video display in reviews */
.review-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.review-photo-item {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--pc-line, #e6e8eb);
    transition: transform 0.2s ease;
}

.review-photo-item:hover {
    transform: scale(1.05);
}

.review-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-videos {
    margin: 15px 0;
}

.review-video-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--pc-text, #374151);
    background: #f9fafb;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--pc-line, #e6e8eb);
    width: fit-content;
}

.review-video-item svg {
    color: #ef4444;
}

.review-video-item a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}

.review-video-item a:hover {
    text-decoration: underline;
}

.review-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--pc-line, #e6e8eb);
}

.review-reply-btn,
.review-menu-btn {
    background: none;
    border: none;
    color: var(--pc-muted, #6b7280);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.review-reply-btn:hover,
.review-menu-btn:hover {
    background: var(--pc-line, #f3f4f6);
    color: var(--pc-text, #222);
}

.review-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.review-like-btn,
.review-dislike-btn {
    background: none;
    border: none;
    color: var(--pc-muted, #6b7280);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.review-like-btn:hover {
    background: #dcfce7;
    color: #16a34a;
}

.review-dislike-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.review-like-btn.active {
    color: #16a34a;
    background: #dcfce7;
}

.review-dislike-btn.active {
    color: #dc2626;
    background: #fee2e2;
}

.review-menu-btn svg {
    display: block;
}

.review-menu-btn {
    padding: 6px;
    border-radius: 50%;
}

/* Review Menu Dropdown */
.review-menu-wrapper {
    position: relative;
    display: inline-block;
}

.review-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    background: var(--pc-card, #fff);
    border: 1px solid var(--pc-line, #e6e8eb);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    padding: 6px 0;
    display: none;
    margin-top: 4px;
}

.menu-open .review-dropdown {
    display: block;
    animation: fadeInScale 0.2s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.review-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    background: none;
    border: none;
    font-size: 13px;
    color: var(--pc-text, #374151);
    cursor: pointer;
    transition: background 0.2s;
}

.review-dropdown button svg {
    opacity: 0.7;
}

.review-dropdown button:hover {
    background: var(--pc-line, #f3f4f6);
}

.review-dropdown .delete-review-btn {
    color: #dc2626;
}

.review-dropdown .delete-review-btn:hover {
    background: #fee2e2;
}

.review-dropdown button svg {
    flex-shrink: 0;
    color: var(--pc-muted);
}

.review-dropdown .delete-review-btn svg {
    color: #dc2626;
}

[data-theme="dark"] .review-dropdown {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .review-dropdown button {
    color: #f3f4f6;
}

[data-theme="dark"] .review-dropdown button:hover {
    background: #111827;
}

[data-theme="dark"] .review-dropdown .delete-review-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* Review Replies */
.review-replies {
    margin-top: 15px;
    margin-left: 22px;
    padding-left: 12px;
    border-left: 2px solid var(--pc-line, #e6e8eb);
}

.review-reply {
    padding: 15px;
    background: var(--pc-card, #f9fafb);
    border-radius: 8px;
    margin-bottom: 10px;
}

.review-reply:last-child {
    margin-bottom: 0;
}

/* Review Form Styling */
#review_form_wrapper {
    margin-top: 40px;
    padding: 30px;
    background: var(--pc-card, #fff);
    border: 1px solid var(--pc-line, #e6e8eb);
    border-radius: 12px;
}

#review_form_wrapper .comment-reply-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    display: block;
}

.comment-form p {
    margin-bottom: 15px;
}

.comment-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--pc-text, #222);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form select,
.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--pc-line, #e6e8eb);
    border-radius: 8px;
    background: var(--pc-card, #fff);
    color: var(--pc-text, #222);
    font-size: 14px;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form select:focus,
.comment-form textarea:focus {
    border-color: var(--primary-color, #17a34a);
    outline: none;
}

.comment-form .submit {
    padding: 12px 30px;
    background: var(--primary-color, #17a34a);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form .submit:hover {
    background: #15803d;
}

.comment-form-rating select {
    max-width: 200px;
}

/* Star Rating in form */
.comment-form-rating {
    margin-bottom: 20px;
}

/* Replies indent */
.commentlist>.review-item+.children {
    margin-left: 60px;
    list-style: none;
    padding: 0;
}

/* --- RESPONSIVE OPTIMIZATION --- */

/* Tablets and below (1200px) */
@media (max-width: 1200px) {
    .reviews-wrapper {
        grid-template-columns: 280px 1fr;
        gap: 30px;
        padding: 20px;
    }
}

/* Tablets and small laptops (992px) */
@media (max-width: 992px) {
    .reviews-wrapper {
        grid-template-columns: 1fr;
        /* Stack columns */
        gap: 20px;
    }
}

/* Mobile Phones (768px) */
@media (max-width: 768px) {
    .reviews-wrapper {
        padding: 24px 0;
        /* Horizontal padding removed to stretch */
    }

    .reviews-summary {
        border-left: none;
        border-right: none;
        border-radius: 0;
        border: 0px solid var(--pc-line, #e6e8eb);
    }



    .review-header {
        gap: 10px;
    }

    .review-avatar {
        width: 40px;
        height: 40px;
    }

    .review-meta {
        font-size: 11px;
    }

    /* Nested Replies Indentation */
    .review-item.depth-1>.review-replies {
        margin-left: 15px;
        padding-left: 10px;
    }

    .review-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .review-actions {
        justify-content: space-between;
        padding-top: 5px;
    }

    .review-like-btn,
    .review-dislike-btn,
    .review-reply-btn {
        padding: 6px 10px;
        font-size: 12px;
    }


}

/* Small Mobile Phones (480px) */
@media (max-width: 480px) {

    .review-item {
        padding: 12px;
    }

    /* Avatar and Author stacked */
    .review-header {
        flex-direction: row;
        /* Keep row but maybe wrap info */
    }

    .review-author {
        flex-wrap: wrap;
    }

    .review-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .review-date::before {
        display: none;
        /* Remove bullet on vertical stack */
    }

    /* Indentation minimal on tiny screens */
    .review-item.depth-1>.review-replies {
        margin-left: 8px;
        padding-left: 8px;
    }

    .review-photos .review-photo-item {
        width: 60px;
        height: 60px;
    }
}

/* Review Photo Item enhancements */
.review-photo-item {
    cursor: zoom-in;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.review-photo-item:hover {
    transform: scale(1.05);
}

/* Review Photo Gallery Modal */
.review-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.review-gallery-modal.active {
    display: flex;
    opacity: 1;
}

.review-gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.review-gallery-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

.review-gallery-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animation for image switch */
.review-gallery-image.changing {
    opacity: 0;
    transform: scale(0.98);
}

.review-gallery-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 10px 15px;
    border-radius: 30px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    z-index: 100;
}

.review-gallery-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.review-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 90;
}

.review-gallery-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.review-gallery-nav.prev {
    left: 40px;
}

.review-gallery-nav.next {
    right: 40px;
}

.review-gallery-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
}

@media screen and (max-width: 1100px) {
    .review-gallery-nav.prev {
        left: 20px;
    }

    .review-gallery-nav.next {
        right: 20px;
    }
}

@media screen and (max-width: 768px) {
    .review-gallery-container {
        padding: 10px;
    }

    .review-gallery-image-wrapper {
        height: 70vh;
        max-width: 100%;
        background: transparent;
    }

    .review-gallery-nav {
        width: 50px;
        height: 50px;
        background: rgba(0, 0, 0, 0.4);
    }

    .review-gallery-nav.prev {
        left: 10px;
    }

    .review-gallery-nav.next {
        right: 10px;
    }

    .review-gallery-close {
        top: 15px;
        right: 15px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .review-gallery-counter {
        bottom: 20px;
        font-size: 13px;
    }
}

/* Authentication Prompt responsive */
@media (max-width: 600px) {
    .review-auth-prompt {
        padding: 30px 20px;
    }

    .review-auth-prompt h3 {
        font-size: 18px;
    }

    .auth-prompt-btn {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* --- AUTHENTICATION PROMPT (Missing Base Styles) --- */
.review-auth-prompt {
    text-align: center;
    padding: 60px 40px;
    background: var(--pc-card, #fff);
    border: 1px solid var(--pc-line, #e6e8eb);
    border-radius: 12px;
    max-width: 800px;
    margin: 20px auto;
}

.auth-prompt-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--pc-line, #f3f4f6);
    color: var(--pc-muted, #9ca3af);
    border-radius: 50%;
    margin: 0 auto 24px;
}

.review-auth-prompt h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--pc-text, #111827);
    margin-bottom: 12px;
}

.review-auth-prompt p {
    font-size: 14px;
    color: var(--pc-muted, #6b7280);
    margin-bottom: 32px;
}

/* --- DARK MODE (Comprehensive) --- */
[data-theme="dark"] .reviews-summary,
[data-theme="dark"] .review-item,
[data-theme="dark"] .review-auth-prompt,
[data-theme="dark"] #review_form_wrapper {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .review-attributes,
[data-theme="dark"] .review-reply,
[data-theme="dark"] .auth-prompt-icon {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .review-item.depth-2,
[data-theme="dark"] .review-item.depth-3,
[data-theme="dark"] .review-item.depth-4,
[data-theme="dark"] .review-item.depth-5 {
    border-bottom-color: #2d3748;
}

[data-theme="dark"] .review-auth-prompt h3 {
    color: #f3f4f6;
}

[data-theme="dark"] .review-auth-prompt p {
    color: #9ca3af;
}

/* --- NESTED REPLIES LOGIC (Finalized) --- */

/* Limit visual nesting to 2 steps: Review -> All Replies */
.review-item.depth-0>.review-replies {
    margin-left: 40px;
    margin-top: 15px;
}

/* Remove further nesting indentation */
.review-item[class*="depth-"]:not(.depth-0)>.review-replies {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

/* Ensure mobile responsiveness for the indent */
@media screen and (max-width: 768px) {
    .review-item.depth-0>.review-replies {
        margin-left: 15px;
    }
}

.review-item.depth-1,
.review-item.depth-2,
.review-item.depth-3,
.review-item.depth-4,
.review-item.depth-5 {
    border: 1px solid var(--pc-line, #e6e8eb);
    background: var(--pc-card, #fff);
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 12px;
}

/* Header layout for replies: Name Left, Date Right */
.review-item[class*="depth-"]:not(.depth-0) .review-header {
    display: block;
    margin-bottom: 15px;
}

.review-item[class*="depth-"]:not(.depth-0) .review-author-info {
    width: 100%;
}

.review-item[class*="depth-"]:not(.depth-0) .review-content {
    margin-top: 10px;
}

.review-replies .review-item:last-child {
    padding-bottom: 8px !important;
}

/* Show All Replies Button */
.show-all-replies-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--primary-color, #17a34a);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 5px;
    transition: all 0.2s ease;
}

.show-all-replies-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.show-all-replies-btn svg {
    transition: transform 0.3s ease;
}

.show-all-replies-btn.active svg {
    transform: rotate(180deg);
}

/* Review Video Modal */
.review-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.review-video-modal.active {
    display: flex;
    opacity: 1;
}

.review-video-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.review-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

@media screen and (max-width: 768px) {
    .review-video-container {
        width: 95%;
        aspect-ratio: 16 / 9;
    }
}