/* General Styles */
.mega-reviews-container {
    margin-bottom: 20px !important;
    position: relative !important; /* For loading indicator */
}
.mega-reviews-wrapper {
    width: 100% !important;
    margin: 0 auto !important;
}

/* Grid Layout (Flexbox Fix) */
.mega-reviews-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    margin: 0 -12.5px !important;
}
.mega-reviews-grid .mega-review-card {
    width: calc(100% / var(--grid-columns, 3) - 25px) !important;
    margin: 0 12.5px 25px !important;
}

/* Card Styles - Base styles for the review card */
.mega-review-card {
    background: var(--mega-card-bg-color, #ffffff) !important;
    border: 1px solid #f0f0f0 !important;
    padding: 20px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* Important for clipping overflow content within the card */
}
.mega-reviews-grid .mega-review-card {
    height: 100% !important; /* Ensures equal height for grid cards */
}
.mega-review-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 25px rgba(0,0,0,0.08) !important;
}

/* Header Style - Base header styles */
.mega-review-header {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 15px !important;
    gap: 15px !important;
    position: relative !important;
    padding-bottom: 10px !important; /* Space for separator */
    border-bottom: 2px solid transparent !important; /* Transparent separator by default */
}
.mega-review-avatar {
    width: 50px !important;
    height: 50px !important;
    object-fit: cover !important;
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px #eee !important;
    flex-shrink: 0 !important;
}
.mega-avatar-style-circle .mega-review-avatar {
    border-radius: 50% !important;
}
.mega-avatar-style-square .mega-review-avatar {
    border-radius: 8px !important;
}
.mega-review-author-meta {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    flex-grow: 1 !important; /* Allows it to fill available space */
}
.mega-review-author-name {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #111 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.mega-review-verified-badge {
    background-color: var(--mega-accent-color, #8e44ad) !important;
    color: #fff !important;
    font-size: 9px !important;
    font-weight: bold !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    /* Ensure visibility */
    display: inline-block !important; /* Ensure it's not hidden by default */
    vertical-align: middle !important; /* Align with text */
    line-height: 1 !important; /* Adjust line height */
}
.mega-review-rating {
    color: var(--mega-rating-color, #FFD700) !important;
    font-size: 13px !important;
}
.mega-review-date {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    font-size: 11px !important;
    color: #999 !important;
}

/* Content Style - Base content styles */
.mega-review-content {
    color: var(--mega-card-text-color, #444444) !important;
    flex-grow: 1 !important;
    margin-bottom: 15px !important;
    line-height: 1.7 !important;
    font-size: 14px !important;
}
.mega-review-content p {
    margin: 0 !important;
}

/* Read More & Helpful Buttons */
.mega-review-read-more {
    display: inline-block !important;
    margin-left: 4px !important;
    font-size: 13px !important;
    font-weight: bold !important;
    color: var(--mega-link-color, #8e44ad) !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}
.mega-review-read-more:hover {
    text-decoration: underline !important;
}
.mega-review-helpful-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.mega-review-feedback-buttons { /* New wrapper for helpful/unhelpful */
    display: flex !important;
    gap: 5px !important;
}
.mega-review-helpful-button,
.mega-review-unhelpful-button {
    background: var(--mega-helpful-bg-color, #f5f5f5) !important;
    color: var(--mega-helpful-text-color, #333333) !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    transition: background-color 0.2s, border-color 0.2s !important;
}
.mega-review-helpful-button.voted,
.mega-review-unhelpful-button.voted {
    background: var(--mega-accent-color, #8e44ad) !important; /* Use accent color for voted state */
    border-color: var(--mega-accent-color, #8e44ad) !important;
    color: #fff !important;
    cursor: not-allowed !important;
}
.mega-review-helpful-button.voted .helpful-count,
.mega-review-unhelpful-button.voted .unhelpful-count {
    color: #fff !important; /* Ensure count text is white when voted */
}

/* Footer Style */
.mega-review-footer {
    margin-top: auto !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 12px !important;
}
.mega-review-footer a {
    text-decoration: none !important;
    color: var(--mega-link-color, #999) !important;
    transition: color 0.2s !important;
}
.mega-review-footer a:hover {
    text-decoration: underline !important;
}

/* --- CARD STYLES --- */
/* Classic with Separator - REVERTED TO PREVIOUS WORKING VERSION */
.mega-card-style-default.mega-review-card {
    padding: 25px !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08) !important;
}
.mega-card-style-default .mega-review-header {
    border-bottom-color: var(--mega-accent-color, #8e44ad) !important;
    margin-bottom: 20px !important;
    padding-bottom: 10px !important;
}
.mega-card-style-default .mega-review-avatar {
    box-shadow: 0 0 0 3px var(--mega-card-bg-color, #ffffff), 0 0 0 4px var(--mega-accent-color, #8e44ad) !important;
}
.mega-card-style-default .mega-review-author-name {
    font-weight: 700 !important;
    color: #333 !important;
}
.mega-card-style-default .mega-review-content {
    line-height: 1.6 !important;
    font-size: 15px !important;
    color: var(--mega-card-text-color, #444444) !important;
}


/* Product Card - NEW STYLE */
.mega-card-style-product-card.mega-review-card {
    padding: 0 !important;
    border: none !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}
.mega-card-style-product-card .mega-review-product-image-wrapper {
    width: 100% !important;
    height: 180px !important; /* Fixed height for image area */
    background-color: var(--mega-accent-color, #8e44ad) !important; /* Accent background for image */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden !important;
    position: relative !important;
}
.mega-card-style-product-card .mega-review-product-image {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important; /* Ensure image fits */
    display: block !important;
}
.mega-card-style-product-card .mega-review-content-wrapper-inner { /* New wrapper for text content */
    padding: 20px !important;
    background-color: var(--mega-card-bg-color, #ffffff) !important;
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}
.mega-card-style-product-card .mega-review-header {
    order: 2 !important; /* Move header to bottom */
    margin-top: 15px !important;
    padding-top: 15px !important;
    border-top: 1px solid #eee !important; /* Separator */
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    flex-direction: row !important; /* Align items horizontally */
    justify-content: space-between !important; /* Space between author and date/rating */
    align-items: flex-end !important; /* Align to bottom */
}
.mega-card-style-product-card .mega-review-author-meta {
    flex-direction: row !important; /* Name and rating in a row */
    align-items: center !important;
    gap: 10px !important;
    flex-grow: 0 !important; /* Don't grow */
}
.mega-card-style-product-card .mega-review-avatar {
    width: 40px !important;
    height: 40px !important;
    box-shadow: none !important;
    border: 2px solid var(--mega-accent-color, #8e44ad) !important; /* Accent border */
}
.mega-card-style-product-card .mega-review-author-name {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--mega-card-text-color, #333) !important;
}
.mega-card-style-product-card .mega-review-verified-badge {
    position: static !important; /* Flow with text */
    margin-left: 5px !important;
    font-size: 8px !important;
    padding: 1px 4px !important;
    background-color: var(--mega-accent-color, #8e44ad) !important; /* Use accent color */
    color: #fff !important;
}
.mega-card-style-product-card .mega-review-rating {
    order: 3 !important; /* Move rating after name */
    font-size: 14px !important;
    margin-left: auto !important; /* Push to right */
}
.mega-card-style-product-card .mega-review-date {
    position: static !important; /* Flow with text */
    font-size: 11px !important;
    color: #999 !important;
    margin-left: auto !important; /* Push to right */
    align-self: flex-end !important; /* Align to end of flex item */
}
.mega-card-style-product-card .mega-review-content {
    order: 1 !important; /* Content at top */
    margin-bottom: 15px !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    padding: 0 !important; /* Remove default padding */
}
.mega-card-style-product-card .mega-review-footer {
    order: 3 !important; /* Footer at bottom */
    padding-top: 15px !important; /* Space above footer */
    border-top: 1px solid #eee !important; /* Separator */
}


/* Elegant Quote - REVERTED TO PREVIOUS WORKING VERSION */
.mega-card-style-elegant-quote.mega-review-card {
    padding: 30px !important;
    border-left: 8px solid var(--mega-accent-color, #8e44ad) !important;
    background: var(--mega-card-bg-color, #ffffff) !important;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1) !important;
    border-radius: 15px !important;
}
.mega-card-style-elegant-quote .mega-review-header {
    border-bottom: none !important;
    margin-bottom: 10px !important;
    justify-content: flex-end !important;
}
.mega-card-style-elegant-quote .mega-review-author-meta {
    order: 2 !important;
    align-items: flex-end !important;
}
.mega-card-style-elegant-quote .mega-review-avatar {
    order: 3 !important;
    margin-left: 15px !important;
    box-shadow: none !important;
    border: 3px solid var(--mega-accent-color, #8e44ad) !important;
    width: 60px !important;
    height: 60px !important;
}
.mega-card-style-elegant-quote .mega-review-date {
    position: static !important;
    order: 1 !important;
    margin-right: auto !important;
    font-size: 12px !important;
    color: #999 !important;
}
.mega-card-style-elegant-quote .mega-review-content {
    position: relative !important;
    padding: 20px !important;
    background-color: rgba(var(--mega-accent-color-rgb, 142, 68, 173), 0.08) !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    font-style: italic !important;
    line-height: 1.8 !important;
    font-size: 16px !important;
    color: var(--mega-card-text-color, #444444) !important;
}
.mega-card-style-elegant-quote .mega-review-content::before {
    content: '“' !important;
    position: absolute !important;
    left: 15px !important;
    top: -15px !important;
    font-size: 120px !important;
    color: var(--mega-accent-color, #8e44ad) !important;
    font-family: 'Georgia', serif !important;
    z-index: 0 !important;
    opacity: 0.1 !important;
    line-height: 1 !important;
}
.mega-card-style-elegant-quote .mega-review-content p {
    position: relative !important;
    z-index: 1 !important;
    margin: 0 !important;
}


/* Speech Bubble Style - REVERTED TO PREVIOUS WORKING VERSION */
.mega-card-style-speech-bubble.mega-review-card {
    position: relative !important;
    padding: 25px !important;
    border-radius: 25px !important;
    background: var(--mega-card-bg-color, #ffffff) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
    margin-bottom: 40px !important;
    border: none !important;
}
.mega-card-style-speech-bubble .mega-review-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 15px !important;
    margin-bottom: 10px !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}
.mega-card-style-speech-bubble .mega-review-avatar {
    width: 60px !important;
    height: 60px !important;
    box-shadow: none !important;
    border: 4px solid var(--mega-accent-color, #8e44ad) !important;
}
.mega-card-style-speech-bubble .mega-review-author-meta {
    flex-grow: 1 !important;
}
.mega-card-style-speech-bubble .mega-review-author-name {
    font-weight: 700 !important;
    font-size: 16px !important;
    color: #333 !important;
}
.mega-card-style-speech-bubble .mega-review-date {
    position: static !important;
    margin-left: auto !important;
    font-size: 11px !important;
    color: #999 !important;
}
.mega-card-style-speech-bubble .mega-review-content {
    background: var(--mega-card-bg-color, #ffffff) !important;
    border-radius: 15px !important;
    padding: 18px !important;
    position: relative !important;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1) !important;
    margin-top: 15px !important;
    line-height: 1.7 !important;
    font-size: 15px !important;
    color: var(--mega-card-text-color, #444444) !important;
}
.mega-card-style-speech-bubble .mega-review-content::after {
    content: '' !important;
    position: absolute !important;
    top: -15px !important;
    left: 50px !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 15px solid transparent !important;
    border-right: 15px solid transparent !important;
    border-bottom: 15px solid var(--mega-card-bg-color, #ffffff) !important;
    transform: translateX(-50%) !important;
    z-index: 2 !important;
    border-bottom-color: var(--mega-accent-color, #8e44ad) !important;
}
.mega-card-style-speech-bubble .mega-review-footer {
    margin-top: 20px !important;
}

/* Minimalist Style - RE-DESIGNED as per user request */
.mega-card-style-minimalist.mega-review-card {
    padding: 25px !important;
    border: none !important;
    box-shadow: none !important;
    background: var(--mega-card-bg-color, #ffffff) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    margin-bottom: 20px !important;
    display: flex !important;
    flex-direction: column !important;
}
.mega-card-style-minimalist .mega-review-header {
    order: 2 !important; /* Move header to bottom */
    margin-top: 15px !important;
    padding-top: 15px !important;
    border-top: 1px solid #eee !important; /* Separator line */
    margin-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 15px !important;
}
.mega-card-style-minimalist .mega-review-avatar {
    width: 45px !important;
    height: 45px !important;
    box-shadow: none !important;
    border: none !important;
    flex-shrink: 0 !important;
}
.mega-card-style-minimalist .mega-review-author-meta {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    flex-grow: 1 !important;
}
.mega-card-style-minimalist .mega-review-author-name {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #222 !important;
}
.mega-card-style-minimalist .mega-review-verified-badge {
    background-color: var(--mega-accent-color, #8e44ad) !important;
    color: #fff !important;
    font-size: 8px !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    position: static !important;
    margin-left: 5px !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    display: inline-block !important; /* Ensure visibility */
}
.mega-card-style-minimalist .mega-review-rating {
    font-size: 12px !important;
    color: var(--mega-rating-color, #FFD700) !important;
}
.mega-card-style-minimalist .mega-review-date {
    position: static !important;
    margin-left: auto !important; /* Push date to the right */
    font-size: 11px !important;
    color: #888 !important;
    order: 3 !important; /* Ensure date is after name/rating */
}
.mega-card-style-minimalist .mega-review-content {
    order: 1 !important; /* Move content to top */
    margin-bottom: 15px !important; /* Space before separator */
    line-height: 1.6 !important;
    font-size: 15px !important; /* Slightly larger font */
    color: var(--mega-card-text-color, #444444) !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.mega-card-style-minimalist .mega-review-footer {
    order: 3 !important; /* Move footer to bottom */
    margin-top: 10px !important;
    padding: 0 !important;
}


/* Centered Minimal - NEW STYLE */
.mega-card-style-centered-minimal.mega-review-card {
    padding: 30px !important;
    text-align: center !important;
    border: none !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08) !important;
    border-radius: 15px !important;
    background: var(--mega-card-bg-color, #ffffff) !important;
}
.mega-card-style-centered-minimal .mega-review-header {
    order: 2 !important; /* Move header to bottom */
    flex-direction: column !important;
    align-items: center !important;
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 1px solid #eee !important; /* Separator */
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
.mega-card-style-centered-minimal .mega-review-avatar {
    width: 60px !important;
    height: 60px !important;
    box-shadow: none !important;
    border: 3px solid var(--mega-accent-color, #8e44ad) !important;
}
.mega-card-style-centered-minimal .mega-review-author-meta {
    align-items: center !important; /* Center author meta */
    margin-top: 10px !important;
}
.mega-card-style-centered-minimal .mega-review-author-name {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #333 !important;
    display: block !important; /* Ensure name is block for centering */
}
.mega-card-style-centered-minimal .mega-review-verified-badge {
    position: static !important;
    margin-left: 5px !important;
    font-size: 8px !important;
    padding: 1px 4px !important;
    background-color: var(--mega-accent-color, #8e44ad) !important;
    color: #fff !important;
}
.mega-card-style-centered-minimal .mega-review-rating {
    font-size: 14px !important;
    margin-top: 5px !important;
}
.mega-card-style-centered-minimal .mega-review-date {
    position: static !important;
    margin-top: 5px !important;
    font-size: 11px !important;
    color: #999 !important;
}
.mega-card-style-centered-minimal .mega-review-content {
    order: 1 !important; /* Content at top */
    margin-bottom: 20px !important;
    line-height: 1.7 !important;
    font-size: 15px !important;
    color: var(--mega-card-text-color, #444444) !important;
    padding: 0 !important;
}
.mega-card-style-centered-minimal .mega-review-footer {
    order: 3 !important; /* Footer at bottom */
    margin-top: 15px !important;
    padding: 0 !important;
    justify-content: center !important; /* Center footer content */
}
.mega-card-style-centered-minimal .mega-review-product-link {
    margin-top: 10px !important; /* Space for product link */
}


/* Icon Card - NEW STYLE */
.mega-card-style-icon-card.mega-review-card {
    padding: 25px !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    text-align: center !important;
}
.mega-card-style-icon-card .mega-review-header {
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 15px !important;
    padding-bottom: 15px !important;
    border-bottom: 1px solid #eee !important;
}
.mega-card-style-icon-card .mega-review-header::before { /* Placeholder for icon */
    content: '★' !important; /* Using a star as a placeholder icon */
    font-size: 40px !important;
    color: var(--mega-accent-color, #8e44ad) !important;
    margin-bottom: 10px !important;
    display: block !important;
}
.mega-card-style-icon-card .mega-review-avatar {
    display: none !important; /* Hide avatar in this style */
}
.mega-card-style-icon-card .mega-review-author-meta {
    align-items: center !important;
}
.mega-card-style-icon-card .mega-review-author-name {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #333 !important;
}
.mega-card-style-icon-card .mega-review-verified-badge {
    position: static !important;
    margin-left: 5px !important;
    font-size: 8px !important;
    padding: 1px 4px !important;
    background-color: var(--mega-accent-color, #8e44ad) !important;
    color: #fff !important;
}
.mega-card-style-icon-card .mega-review-rating {
    font-size: 14px !important;
    margin-top: 5px !important;
}
.mega-card-style-icon-card .mega-review-date {
    position: static !important;
    margin-top: 5px !important;
    font-size: 11px !important;
    color: #999 !important;
}
.mega-card-style-icon-card .mega-review-content {
    margin-bottom: 15px !important;
    line-height: 1.6 !important;
    font-size: 14px !important;
    color: var(--mega-card-text-color, #444444) !important;
}
.mega-card-style-icon-card .mega-review-footer {
    margin-top: 10px !important;
    justify-content: center !important; /* Center footer content */
}


/* Slider Layout */
.mega-reviews-slider {
    position: relative;
    padding: 10px 0;
}
.mega-reviews-slider .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 30px;
}
.swiper-button-next, .swiper-button-prev {
    color: var(--mega-nav-color, #8e44ad);
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background-color 0.2s;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    margin-top: -15px;
}
.swiper-button-next:hover, .swiper-button-prev:hover {
    background-color: #f5f5f5;
}
.swiper-button-next:after, .swiper-button-prev:after {
    font-size: 16px;
    font-weight: bold;
}
.swiper-pagination {
    bottom: 0 !important;
    z-index: 10;
    position: absolute;
    width: 100%;
}
.swiper-pagination-bullet {
    background-color: #ccc;
    opacity: 1;
}
.swiper-pagination-bullet-active {
    background-color: var(--mega-nav-color, #8e44ad);
}

/* Filter Bar Styles - Position based on RTL and Responsive */
.mega-reviews-filter-bar {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    margin-bottom: 20px !important;
    background: #f9f9f9 !important;
    padding: 15px 20px !important;
    border-radius: 10px !important;
    border: 1px solid #eee !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03) !important;
    box-sizing: border-box !important; /* Ensure padding is included in width */
}

/* RTL specific alignment */
.mega-reviews-filter-bar-rtl {
    justify-content: flex-start !important; /* Align to left for RTL */
    direction: rtl !important; /* Set RTL direction for content */
}
.mega-reviews-filter-bar-rtl .mega-reviews-sort-group {
    flex-direction: row-reverse !important; /* Reverse order for RTL */
}
.mega-reviews-filter-bar-rtl .mega-reviews-sort-by {
    background-position: left 10px center !important; /* Arrow on left for RTL */
    padding-left: 30px !important; /* Space for arrow */
    padding-right: 12px !important; /* Adjust padding */
}


/* LTR specific alignment */
.mega-reviews-filter-bar-ltr {
    justify-content: flex-end !important; /* Align to right for LTR */
    direction: ltr !important; /* Set LTR direction for content */
}
.mega-reviews-filter-bar-ltr .mega-reviews-sort-group {
    flex-direction: row !important; /* Normal order for LTR */
}
.mega-reviews-filter-bar-ltr .mega-reviews-sort-by {
    background-position: right 10px center !important; /* Arrow on right for LTR */
    padding-right: 30px !important; /* Space for arrow */
    padding-left: 12px !important; /* Adjust padding */
}


.mega-reviews-filter-bar label {
    font-weight: 600 !important;
    color: #555 !important;
    font-size: 14px !important;
    white-space: nowrap !important;
}

.mega-reviews-sort-group {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.mega-reviews-sort-by {
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    background-color: #fff !important;
    font-size: 14px !important;
    cursor: pointer !important;
    appearance: none !important;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20256%20512%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M192%20256L64%20128v256z%22%2F%3E%3C%2Fsvg%3E') !important;
    background-repeat: no-repeat !important;
    background-size: 12px !important;
    min-width: 150px !important;
}

.mega-reviews-sort-by:focus {
    outline: none !important;
    border-color: var(--mega-accent-color, #8e44ad) !important;
    box-shadow: 0 0 0 2px rgba(142, 68, 173, 0.2) !important;
}

/* Loading Overlay */
.mega-reviews-container.mega-reviews-loading::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(255, 255, 255, 0.7) !important;
    z-index: 100 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 12px !important;
}

.mega-reviews-container.mega-reviews-loading::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 40px !important;
    height: 40px !important;
    border: 4px solid var(--mega-accent-color, #8e44ad) !important;
    border-top-color: transparent !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
    z-index: 101 !important;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive adjustments for filter bar */
@media (max-width: 768px) {
    .mega-reviews-filter-bar {
        flex-direction: column !important;
        align-items: center !important; /* Center align items in responsive */
        width: calc(100% - 40px) !important; /* Ensure it doesn't overflow */
        margin-left: auto !important; /* Center the div */
        margin-right: auto !important; /* Center the div */
        justify-content: center !important; /* Center content in responsive */
    }
    .mega-reviews-filter-bar-rtl,
    .mega-reviews-filter-bar-ltr {
        justify-content: center !important; /* Override specific alignments in responsive */
    }
    .mega-reviews-sort-group {
        flex-direction: row !important; /* Keep label and select in a row */
        justify-content: center !important;
        width: 100% !important;
    }
    .mega-reviews-sort-by {
        width: 100% !important; /* Make dropdown fill width */
        max-width: 200px !important; /* Limit max width for better appearance */
    }
}
