/**
 * Product Reviews Section — Premium Design
 *
 * Features:
 * - Summary card with average score, star display, clickable distribution bars
 * - Filter chips (All, 5★, 4★, ...) + sort dropdown
 * - Collapsible write-review form with interactive star rating
 * - Review cards with gradient avatars, verified badge, stars, dates
 * - AJAX load more pagination with stagger entrance animation
 * - Responsive, RTL support, reduced motion
 *
 * @package Codlion
 * @since 1.0.0
 */

/* ==========================================================================
   CSS Variables (scoped to reviews section)
   ========================================================================== */

.cl-reviews-section {
    --rv-star: #f5a623;
    --rv-star-empty: #e8e8e8;
    --rv-verified: #16a34a;
    --rv-verified-bg: rgba(22, 163, 74, 0.08);
    --rv-border: #ebebeb;
    --rv-surface: #ffffff;
    --rv-bg: #fafafa;
    --rv-text: #1a1a1a;
    --rv-text-light: #6b7280;
    --rv-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --rv-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.03);
    --rv-radius: 12px;
    --rv-radius-lg: 16px;
    --rv-radius-pill: 999px;
    --rv-transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --rv-font: inherit;
    --rv-primary: var(--primary-color, #a67c52);
}

/* Ensure :root --rv-primary is always available (set in theme-colors.php inline CSS) */

/* ==========================================================================
   Section Container
   ========================================================================== */

.cl-reviews-section {
    margin: 32px 0;
    padding: 0;
    font-family: var(--rv-font);
}

.cl-reviews-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1px 0;
}

/* When WhatsApp slider is active, use a scrollable container */
.cl-reviews-section[data-whatsapp-only="1"] .cl-reviews-container {
    overflow: hidden;
}

/* Scrollable wrapper — handles native scroll, drag, swipe */
.cl-reviews-whatsapp-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    cursor: grab;
    touch-action: pan-x pan-y;
    padding: 10px 0 14px;
    margin: 0 -2px;
}
.cl-reviews-whatsapp-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}
.cl-reviews-whatsapp-scroll.cl-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}
.cl-reviews-whatsapp-scroll.cl-dragging img {
    pointer-events: none;
}

.cl-reviews-header {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cl-reviews-heading {
    font-size: 24px;
    font-weight: 700;
    color: var(--rv-text);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* Rating summary in header (inline, side by side) */
.cl-reviews-rating-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cl-reviews-rating-stars {
    display: inline-flex;
    gap: 2px;
}

.cl-reviews-rating-score {
    font-size: 16px;
    font-weight: 700;
    color: var(--rv-text);
}

.cl-reviews-rating-count {
    font-size: 14px;
    color: var(--rv-text-light);
    font-weight: 500;
}

.cl-reviews-rating-verified {
    font-size: 12px;
    color: var(--rv-verified);
    background: var(--rv-verified-bg);
    padding: 2px 8px;
    border-radius: var(--rv-radius-pill);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cl-reviews-rating-verified i {
    font-size: 11px;
}

/* ==========================================================================
   Summary: Score + Distribution
   ========================================================================== */

.cl-reviews-summary {
    display: flex;
    gap: 48px;
    align-items: flex-start;
    padding: 32px 36px;
    background: var(--rv-surface);
    border: 1px solid var(--rv-border);
    border-radius: var(--rv-radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--rv-shadow);
}

.cl-reviews-summary-score {
    flex-shrink: 0;
    text-align: center;
    min-width: 160px;
    padding-right: 48px;
    border-right: 1px solid var(--rv-border);
}

.cl-reviews-avg {
    font-size: 52px;
    font-weight: 800;
    color: var(--rv-text);
    line-height: 1;
    display: block;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.cl-reviews-summary-stars {
    margin-bottom: 10px;
    font-size: 18px;
    line-height: 1;
}

.cl-reviews-total {
    font-size: 13px;
    color: var(--rv-text-light);
    font-weight: 500;
}

.cl-reviews-distribution {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 6px;
}

.cl-reviews-dist-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    transition: opacity var(--rv-transition);
}

.cl-reviews-dist-row:hover {
    opacity: 0.7;
}

.cl-reviews-dist-label {
    flex-shrink: 0;
    width: 48px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rv-text);
    display: flex;
    align-items: center;
    gap: 3px;
}

.cl-reviews-dist-label .fa-star {
    font-size: 10px;
}

.cl-reviews-dist-bar {
    flex: 1;
    height: 8px;
    background: #f0f0f0;
    border-radius: var(--rv-radius-pill);
    overflow: hidden;
}

.cl-reviews-dist-fill {
    height: 100%;
    background: var(--rv-star);
    border-radius: var(--rv-radius-pill);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cl-reviews-dist-count {
    flex-shrink: 0;
    width: 36px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--rv-text-light);
}

/* ==========================================================================
   Star Colors
   ========================================================================== */

.cl-review-star-filled {
    color: var(--rv-star);
}

.cl-review-star-empty {
    color: var(--rv-star-empty);
}

/* ==========================================================================
   Toolbar: Write
   ========================================================================== */

.cl-reviews-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* Write Review Button */
.cl-reviews-write-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 9px 22px;
    background: var(--rv-surface);
    border: 1.5px solid var(--rv-primary);
    border-radius: var(--rv-radius-pill);
    color: var(--rv-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: background-color var(--rv-transition),
                color var(--rv-transition),
                border-color var(--rv-transition);
}

.cl-reviews-write-btn:hover {
    background: var(--rv-primary);
    color: var(--cl-btn-text, #fff);
}

.cl-reviews-write-btn[aria-expanded="true"] .fa-pen-to-square::before {
    -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 352 512'><path d='M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z'/></svg>");
    mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 352 512'><path d='M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z'/></svg>");
}

/* ==========================================================================
   Write Review Form
   ========================================================================== */

.cl-reviews-form {
    margin-bottom: 24px;
    padding: 32px 36px;
    background: var(--rv-surface);
    border: 1px solid var(--rv-border);
    border-radius: var(--rv-radius-lg);
    box-shadow: var(--rv-shadow);
    animation: cl-reviews-form-open 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cl-reviews-form-subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--rv-text-light);
    font-weight: 500;
}

@keyframes cl-reviews-form-open {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cl-reviews-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.cl-reviews-form-field {
    margin-bottom: 18px;
}

.cl-reviews-form-field:last-child {
    margin-bottom: 0;
}

.cl-reviews-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--rv-text);
    margin-bottom: 7px;
}

.cl-required {
    color: var(--cl-danger, #dc2626);
}

.cl-reviews-form-field input[type="text"],
.cl-reviews-form-field input[type="email"],
.cl-reviews-form-field textarea {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--rv-border);
    border-radius: var(--rv-radius);
    font-size: 14px;
    color: var(--rv-text);
    background: var(--rv-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.cl-reviews-form-field input[type="text"]:focus,
.cl-reviews-form-field input[type="email"]:focus,
.cl-reviews-form-field textarea:focus {
    border-color: var(--rv-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rv-primary, #a67c52) 10%, transparent);
    outline: none;
    background: var(--rv-surface, #fff);
}

.cl-reviews-form-field textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.6;
}

/* Interactive star rating input */
.cl-reviews-star-input {
    display: flex;
    gap: 4px;
}

.cl-review-star-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    font-size: 26px;
    color: var(--rv-star-empty);
    transition: color 0.15s ease, transform 0.15s ease;
    line-height: 1;
}

.cl-review-star-btn:hover {
    transform: scale(1.15);
}

.cl-review-star-btn.cl-star-active,
.cl-review-star-btn.cl-star-active .fa-star {
    color: var(--rv-star);
}

/* Submit button */
.cl-reviews-form-actions {
    margin-top: 8px;
}

.cl-reviews-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 36px;
    background: var(--rv-primary);
    color: var(--cl-btn-text, #fff);
    border: none;
    border-radius: var(--rv-radius-pill);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background-color var(--rv-transition),
                transform var(--rv-transition),
                box-shadow var(--rv-transition);
}

.cl-reviews-submit-btn:hover {
    background: var(--link-hover-color, var(--rv-primary));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.cl-reviews-submit-btn:active {
    transform: translateY(0);
}

.cl-reviews-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Form message */
.cl-reviews-form-message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--rv-radius);
    font-size: 14px;
    font-weight: 500;
    animation: cl-reviews-form-open 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cl-reviews-form-message.cl-msg-success {
    background: rgba(22, 163, 74, 0.06);
    border: 1px solid rgba(22, 163, 74, 0.15);
    color: var(--rv-verified);
}

.cl-reviews-form-message.cl-msg-error {
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.15);
    color: var(--cl-danger, #dc2626);
}

/* ==========================================================================
   Reviews List
   ========================================================================== */

.cl-reviews-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* WhatsApp reviews: 4 columns on desktop (screenshots are narrow/portrait) */
.cl-reviews-list .cl-review-item-whatsapp {
    grid-column: auto;
}
.cl-reviews-list:has(.cl-review-item-whatsapp) {
    grid-template-columns: repeat(4, 1fr);
}

/* ==========================================================================
   WhatsApp Reviews Auto-Scrolling Slider
   Premium phone-screen style cards with WhatsApp chat appearance
   ========================================================================== */

/* Keyframe removed — now using JS requestAnimationFrame for auto-scroll */

.cl-reviews-whatsapp-slider {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 20px;
    width: max-content;
    padding: 0 2px;
    overflow: visible;
}

/* Premium WhatsApp card — realistic phone screen with header + chat + footer */
.cl-reviews-whatsapp-slider .cl-review-item-whatsapp {
    flex: 0 0 300px;
    min-width: 300px;
    max-width: 300px;
    height: 540px; /* Phone screen ratio ~9:16 */
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 2px solid rgba(0, 0, 0, 0.12);
    animation: none;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    background: #e5ddd5; /* WhatsApp chat background color */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cl-reviews-whatsapp-slider .cl-review-item-whatsapp:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    transform: translateY(-4px);
}

/* Phone screen inner container */
.cl-review-item-whatsapp .cl-wa-phone {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
}

/* ---- WhatsApp Chat Header ---- */
.cl-review-item-whatsapp .cl-wa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #075e54; /* WhatsApp dark green header */
    color: #fff;
    padding: 8px 10px;
    flex-shrink: 0;
    min-height: 44px;
}

.cl-review-item-whatsapp .cl-wa-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.cl-review-item-whatsapp .cl-wa-back {
    font-size: 14px;
    opacity: 0.9;
    flex-shrink: 0;
}

.cl-review-item-whatsapp .cl-wa-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
    overflow: hidden;
}

.cl-review-item-whatsapp .cl-wa-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: blur(4px);
    transform: scale(1.1); /* Prevent blur edge gaps */
}

.cl-review-item-whatsapp .cl-wa-header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.cl-review-item-whatsapp .cl-wa-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.cl-review-item-whatsapp .cl-wa-status {
    font-size: 10px;
    opacity: 0.8;
    line-height: 1.2;
}

.cl-review-item-whatsapp .cl-wa-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.cl-review-item-whatsapp .cl-wa-icon {
    font-size: 13px;
    opacity: 0.9;
}

/* ---- Chat Body (screenshot area) ---- */
.cl-review-item-whatsapp .cl-wa-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #e5ddd5;
    min-height: 0;
}

.cl-review-item-whatsapp .cl-wa-body .cl-review-image-top {
    margin: 0;
    aspect-ratio: auto;
    overflow: hidden;
    border-radius: 0;
    line-height: 0;
    width: 100%;
    height: 100%;
    background: #e5ddd5;
}

.cl-review-item-whatsapp .cl-wa-body .cl-review-image-top a {
    display: block;
    width: 100%;
    height: 100%;
}

.cl-review-item-whatsapp .cl-wa-body .cl-review-image-top img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover; /* Fill the chat body area */
    object-position: top center;
}

/* ---- WhatsApp Chat Footer (message input bar) ---- */
.cl-review-item-whatsapp .cl-wa-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    padding: 6px 8px;
    flex-shrink: 0;
    min-height: 42px;
}

/* Input bar — white rounded container with all icons inside (like real WhatsApp) */
.cl-review-item-whatsapp .cl-wa-input-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 20px;
    padding: 6px 10px;
    min-width: 0;
    min-height: 30px;
}

.cl-review-item-whatsapp .cl-wa-input-icon {
    font-size: 14px;
    color: #54656f;
    flex-shrink: 0;
}

.cl-review-item-whatsapp .cl-wa-input-emoji {
    font-size: 16px;
}

.cl-review-item-whatsapp .cl-wa-input-text {
    flex: 1;
    font-size: 12px;
    color: #8696a0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.cl-review-item-whatsapp .cl-wa-send {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

/* Pause on hover — handled by JS now */

/* Dragging state — grab cursor, disable hover lift on cards */
.cl-reviews-whatsapp-scroll.cl-dragging .cl-review-item-whatsapp {
    pointer-events: none;
    transform: none !important;
}
.cl-reviews-whatsapp-slider .cl-review-item-whatsapp {
    cursor: grab;
}

/* RTL: flip the back arrow to point right */
body.rtl-mode .cl-review-item-whatsapp .cl-wa-back {
    transform: scaleX(-1);
}

/* RTL: scroll direction handled by JS */

/* ---- Responsive ---- */

/* Tablet */
@media (max-width: 991px) {
    .cl-reviews-whatsapp-slider {
        gap: 14px;
    }
    .cl-reviews-whatsapp-slider .cl-review-item-whatsapp {
        flex: 0 0 260px;
        min-width: 260px;
        max-width: 260px;
        height: 480px;
    }
    .cl-review-item-whatsapp .cl-wa-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .cl-review-item-whatsapp .cl-wa-name {
        font-size: 12px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .cl-reviews-whatsapp-slider {
        gap: 10px;
    }
    .cl-reviews-whatsapp-slider .cl-review-item-whatsapp {
        flex: 0 0 220px;
        min-width: 220px;
        max-width: 220px;
        height: 420px;
        border-radius: 12px;
    }
    .cl-review-item-whatsapp .cl-wa-header {
        padding: 6px 8px;
    }
    .cl-review-item-whatsapp .cl-wa-avatar {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    .cl-review-item-whatsapp .cl-wa-name {
        font-size: 11px;
    }
    .cl-review-item-whatsapp .cl-wa-status {
        font-size: 9px;
    }
    .cl-review-item-whatsapp .cl-wa-header-right {
        gap: 10px;
    }
    .cl-review-item-whatsapp .cl-wa-icon {
        font-size: 11px;
    }
    .cl-review-item-whatsapp .cl-wa-input-bar {
        padding: 5px 8px;
        gap: 6px;
    }
    .cl-review-item-whatsapp .cl-wa-input-icon {
        font-size: 12px;
    }
    .cl-review-item-whatsapp .cl-wa-input-emoji {
        font-size: 14px;
    }
    .cl-review-item-whatsapp .cl-wa-input-text {
        font-size: 11px;
    }
    .cl-review-item-whatsapp .cl-wa-input {
        font-size: 11px;
        padding: 5px 10px;
    }
    .cl-review-item-whatsapp .cl-wa-send {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
}

/* Reduced motion — stop auto-scroll, still allow manual scroll */
@media (prefers-reduced-motion: reduce) {
    .cl-reviews-whatsapp-scroll {
        overflow-x: auto;
    }
}

.cl-review-item {
    display: flex;
    flex-direction: column;
    background: var(--rv-surface);
    border: 1px solid var(--rv-border);
    border-radius: var(--rv-radius-lg);
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    animation: cl-review-item-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cl-review-item-enter {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cl-reviews-list .cl-review-item:nth-child(1) { animation-delay: 0.05s; }
.cl-reviews-list .cl-review-item:nth-child(2) { animation-delay: 0.1s; }
.cl-reviews-list .cl-review-item:nth-child(3) { animation-delay: 0.15s; }
.cl-reviews-list .cl-review-item:nth-child(4) { animation-delay: 0.2s; }
.cl-reviews-list .cl-review-item:nth-child(5) { animation-delay: 0.25s; }

.cl-review-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

/* WhatsApp review (non-slider grid) — phone screen style */
.cl-review-item-whatsapp {
    padding: 0;
    height: 480px;
    background: #e5ddd5;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 2px solid rgba(0, 0, 0, 0.12);
}
.cl-review-item-whatsapp .cl-review-image-top {
    margin: 0;
    aspect-ratio: auto;
    overflow: hidden;
    border-radius: inherit;
    line-height: 0;
    width: 100%;
    height: 100%;
    background: #e5ddd5;
}
.cl-review-item-whatsapp .cl-review-image-top a {
    display: block;
    width: 100%;
    height: 100%;
}
.cl-review-item-whatsapp .cl-review-image-top img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: top center;
}

.cl-review-body {
    flex: 1;
    min-width: 0;
    padding: 14px 16px 16px;
}

.cl-review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.cl-review-head-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cl-review-author {
    font-size: 15px;
    font-weight: 700;
    color: var(--rv-text);
}

.cl-review-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--rv-verified-bg);
    border-radius: var(--rv-radius-pill);
    font-size: 11px;
    font-weight: 600;
    color: var(--rv-verified);
}

.cl-review-verified .fa-circle-check {
    font-size: 11px;
}

.cl-review-date {
    font-size: 12px;
    color: var(--rv-text-light);
    font-weight: 500;
    flex-shrink: 0;
}

.cl-review-stars {
    font-size: 14px;
    line-height: 1;
    margin-bottom: 10px;
}

.cl-review-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--rv-text, var(--text-color, #4b5563));
    font-weight: 400;
    margin: 0;
}

/* Empty state */
.cl-reviews-empty {
    text-align: center;
    padding: 56px 20px;
    color: var(--rv-text-light);
}

.cl-reviews-empty i {
    font-size: 44px;
    margin-bottom: 16px;
    color: var(--rv-star-empty);
}

.cl-reviews-empty p {
    font-size: 15px;
    margin: 0;
    font-weight: 500;
}

/* ==========================================================================
   Load More
   ========================================================================== */

.cl-reviews-load-more-wrap {
    text-align: center;
    margin-top: 28px;
}

.cl-reviews-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 36px;
    background: var(--rv-surface);
    border: 1.5px solid var(--rv-border);
    border-radius: var(--rv-radius-pill);
    color: var(--rv-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: border-color var(--rv-transition), color var(--rv-transition), background-color var(--rv-transition);
}

.cl-reviews-load-more:hover {
    border-color: var(--rv-primary);
    color: var(--rv-primary);
}

.cl-reviews-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

body.rtl-mode .cl-reviews-summary {
    flex-direction: row-reverse;
}

body.rtl-mode .cl-reviews-summary-score {
    text-align: center;
    border-right: none;
    border-left: 1px solid var(--rv-border);
    padding-right: 0;
    padding-left: 48px;
}

body.rtl-mode .cl-review-head {
    flex-direction: row-reverse;
}

body.rtl-mode .cl-review-item {
    flex-direction: row-reverse;
}

body.rtl-mode .cl-reviews-dist-label {
    text-align: right;
}

body.rtl-mode .cl-reviews-dist-count {
    text-align: left;
}

body.rtl-mode .cl-reviews-toolbar {
    flex-direction: row-reverse;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 991px) {
    .cl-reviews-summary {
        flex-direction: column;
        gap: 24px;
        padding: 24px 20px;
    }

    .cl-reviews-summary-score {
        min-width: 0;
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--rv-border);
        padding-bottom: 24px;
    }

    .cl-reviews-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .cl-reviews-form {
        padding: 24px 20px;
    }

    .cl-reviews-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* WhatsApp slider: handled by flex layout above */

    .cl-review-body {
        padding: 10px 12px 12px;
    }

    .cl-review-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .cl-review-head-left {
        gap: 4px;
    }

    .cl-review-author {
        font-size: 13px;
    }

    .cl-review-verified {
        font-size: 9px;
        padding: 1px 6px;
    }

    .cl-review-date {
        font-size: 10px;
    }

    .cl-review-stars {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .cl-review-text {
        font-size: 12px;
        line-height: 1.5;
    }

    .cl-reviews-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .cl-reviews-write-btn {
        width: auto;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .cl-reviews-heading {
        font-size: 20px;
    }

    .cl-reviews-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* WhatsApp slider: handled by flex layout above */

    .cl-reviews-container {
        padding: 0;
    }

    .cl-review-body {
        padding: 8px 10px 10px;
    }

    .cl-review-author {
        font-size: 12px;
    }

    .cl-review-text {
        font-size: 11px;
        line-height: 1.5;
    }

    .cl-review-verified {
        font-size: 8px;
        padding: 1px 5px;
    }

    .cl-review-date {
        font-size: 9px;
    }

    .cl-review-stars {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .cl-review-text {
        font-size: 11px;
        line-height: 1.5;
    }

    .cl-reviews-header {
        margin-bottom: 20px;
    }

    .cl-reviews-rating-summary {
        gap: 4px;
    }

    .cl-reviews-rating-score {
        font-size: 14px;
    }

    .cl-reviews-rating-count {
        font-size: 12px;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .cl-review-item,
    .cl-reviews-write-btn,
    .cl-reviews-submit-btn,
    .cl-reviews-load-more,
    .cl-review-star-btn,
    .cl-reviews-dist-fill,
    .cl-reviews-form,
    .cl-reviews-form-message {
        transition: none;
        animation: none;
    }
}

/* ==========================================================================
   Review Image (display at top of review card)
   ========================================================================== */

.cl-review-image-top {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: #f9fafb;
}

.cl-review-image-top a {
    display: block;
    width: 100%;
    height: 100%;
}

.cl-review-image-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cl-review-item:hover .cl-review-image-top img {
    transform: scale(1.06);
}

/* ==========================================================================
   Review Image Upload (form)
   ========================================================================== */

.cl-review-image-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cl-review-image-upload input[type="file"] {
    font-size: 13px;
}

.cl-review-image-preview {
    position: relative;
    display: inline-block;
}

.cl-review-image-preview img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--rv-radius);
    border: 2px solid var(--rv-border);
}

.cl-review-image-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cl-danger, #d63638);
    color: var(--cl-surface, #fff);
    border: 2px solid var(--rv-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.cl-review-image-remove i {
    font-size: 10px;
}

