/**
 * TH Social Reviews - Stylesheet
 * Styling for Google and Facebook reviews display
 */

/* Main Container */
.th-social-reviews {
    margin: 30px 0 60px;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    width: 100%;
    box-sizing: border-box;
}

.th-social-reviews *,
.th-social-reviews *::before,
.th-social-reviews *::after {
    box-sizing: border-box;
}

/* Header Section */
.th-reviews-header {
    text-align: center;
    margin-bottom: 20px;
}

.th-reviews-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.2;
    font-family: "Poppins", sans-serif;
    color: #252B36;
}

/* Product Exclusive */
.tab-pane .th-reviews-title{
    font-size: 18px;
    text-align: left;
    text-transform: uppercase;
}

.th-reviews-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/*.tab-content:has(.tab-pane.active #facebookCommentsLoginTitle) .tab-pane:has(.th-social-reviews) {*/
/*    display: none;*/
/*}*/

#product .tabs .nav.nav-tabs .nav-item:has(.nav-link:empty){
    display:none;
}

/* Carousel Wrapper */
.th-carousel-wrapper {
    position: relative;
    margin-top: 15px;
    padding: 0 40px;
}

/* No Slider Mode (for cases where slider is disabled) */
.th-no-slider .th-carousel-wrapper {
    padding: 0;
}

.th-no-slider .th-reviews-track {
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.th-no-slider .th-review-slide {
    flex-shrink: 0;
    padding: 0;
}

.th-no-slider .th-review-item {
    height: auto;
}

/* Carousel Container */
.th-reviews-carousel {
    overflow: hidden;
    width: 100%;
    padding: 10px 0;
}

.th-reviews-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
    align-items: stretch;
}

.th-review-slide {
    padding: 0 10px;
    box-sizing: border-box;
    flex-shrink: 0;
    display: block;
}

/* Prevent text selection during drag */
.th-reviews-track.dragging {
    user-select: none;
}

/* Individual Review Card */
.th-review-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.th-review-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Carousel Navigation Buttons */
.th-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #e9e9ea;
    border: 1px solid #e9e9ea;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    color: #4b5563;
}

.th-carousel-btn::before {
    font-family: "Ionicons";
    font-size: 18px;
    line-height: 1;
}

.th-carousel-prev::before {
    content: "\f3d2";
}

.th-carousel-next::before {
    content: "\f3d3";
}

.th-carousel-btn:hover {
    background: #fff;
    border-color: #8ac43f;
    color: #4b5563;
}

.th-carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.th-carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.th-carousel-btn:disabled:hover {
    background: #e9e9ea;
    border-color: #e9e9ea;
    color: #4b5563;
}

.th-carousel-prev {
    left: 0;
    margin-left: 5px;
}

.th-carousel-next {
    right: 0;
    margin-right: 5px;
}

/* Carousel Navigation (dots + mobile arrows) */
.th-carousel-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

/* Carousel Dots */
.th-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.th-carousel-dot {
    width: 20px;
    height: 5px;
    border-radius: 3px;
    background: #d1d5db;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.th-carousel-dot:hover {
    background: #9ca3af;
}

.th-carousel-dot.active {
    background: #8ac43f;
}

/* Mobile arrows in navigation bar - hidden by default */
.th-carousel-prev-mobile,
.th-carousel-next-mobile {
    display: none;
    position: static;
    transform: none;
    flex-shrink: 0;
}

.th-carousel-prev-mobile:active,
.th-carousel-next-mobile:active {
    transform: scale(0.95);
}

/* Review Header */
.th-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.th-review-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.th-review-rating {
    display: flex;
    gap: 1px;
    flex-shrink: 0;
}

/* Avatar */
.th-review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.th-review-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8ac43f 0%, #6ba32e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Author Details */
.th-review-author-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.th-review-author {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.th-review-source {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.th-icon-google,
.th-icon-facebook {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.th-source-link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.th-source-link:hover {
    color: #8ac43f;
    text-decoration: underline;
}

/* Rating Stars */
.th-star {
    font-size: 14px;
    line-height: 1;
}

.th-star-filled {
    color: #fbbf24;
}

.th-star-empty {
    color: #d1d5db;
}

/* Review Text */
.th-review-text {
    flex: 1;
    overflow: hidden;
}

.th-review-text p {
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
    margin: 0;
    word-wrap: break-word;
}

/* Date in source line */
.th-source-date-separator {
    color: #9ca3af;
    margin: 0 2px;
}

.th-review-date {
    font-size: 12px;
    color: #9ca3af;
}

/* Source-specific styling */
.th-review-item[data-source="Google"] {
    border-left: 3px solid #8ac43f;
}

.th-review-item[data-source="Facebook"] {
    border-left: 3px solid #8ac43f;
}

/* Responsive Design */
@media (max-width: 991px) {
    .th-social-reviews {
        margin: 20px 0 40px;
    }
}

@media (max-width: 768px) {
    .th-social-reviews {
        margin: 15px 0 30px;
    }

    .th-reviews-title {
        font-size: 20px;
    }

    .th-reviews-subtitle {
        font-size: 13px;
    }

    .th-review-item {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .th-reviews-title {
        font-size: 18px;
    }

    /* Hide desktop arrows, show mobile arrows */
    .th-carousel-prev-desktop,
    .th-carousel-next-desktop {
        display: none;
    }

    .th-carousel-prev-mobile,
    .th-carousel-next-mobile {
        display: flex;
    }

    .th-carousel-wrapper {
        padding: 0;
    }

    .th-carousel-btn {
        width: 32px;
        height: 32px;
    }

    .th-carousel-btn::before {
        font-size: 16px;
    }

    .th-review-avatar,
    .th-review-avatar-placeholder {
        width: 36px;
        height: 36px;
    }

    .th-review-avatar-placeholder {
        font-size: 14px;
    }

    .th-review-item {
        padding: 12px;
    }

    .th-review-text p {
        font-size: 12px;
        -webkit-line-clamp: 3;
    }

    .th-star {
        font-size: 13px;
    }

    .th-carousel-dots {
        gap: 6px;
    }

    .th-carousel-dot {
        width: 16px;
        height: 5px;
    }
}

/* Loading State */
.th-reviews-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.th-reviews-loading::before {
    content: "";
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #8ac43f;
    border-radius: 50%;
    animation: th-spin 0.8s linear infinite;
}

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

/* Empty State */
.th-reviews-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.th-reviews-empty::before {
    content: "💬";
    display: block;
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ===========================================
   GRID LAYOUT (CMS Pages)
   =========================================== */

.th-social-reviews-grid {
    margin: 40px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.th-social-reviews-grid .th-reviews-header {
    text-align: center;
    margin-bottom: 30px;
}

.th-social-reviews-grid .th-reviews-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.2;
}

.th-social-reviews-grid .th-reviews-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Grid Container */
.th-reviews-grid {
    display: grid;
    grid-template-columns: repeat(var(--cards-per-row, 3), 1fr);
    gap: 24px;
}

/* Grid Card */
.th-review-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.th-review-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.th-review-card[data-source="Google"] {
    border-left: 3px solid #8ac43f;
}

.th-review-card[data-source="Facebook"] {
    border-left: 3px solid #8ac43f;
}

/* Card Header */
.th-review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.th-review-card .th-review-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.th-review-card .th-review-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.th-review-card .th-review-avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8ac43f 0%, #6ba32e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.th-review-card .th-review-author-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.th-review-card .th-review-author {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.th-review-card .th-review-source {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

.th-review-card .th-icon-google,
.th-review-card .th-icon-facebook {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.th-review-card .th-review-rating {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.th-review-card .th-star {
    font-size: 18px;
    line-height: 1;
}

.th-review-card .th-star-filled {
    color: #fbbf24;
}

.th-review-card .th-star-empty {
    color: #d1d5db;
}

/* Card Text */
.th-review-card-text {
    flex: 1;
    margin-bottom: 16px;
}

.th-review-card-text p {
    font-size: 15px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
    word-wrap: break-word;
}

/* Card Footer */
.th-review-card-footer {
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
    margin-top: auto;
}

.th-review-card .th-review-date {
    font-size: 13px;
    color: #9ca3af;
}

/* Grid Responsive */
@media (max-width: 1200px) {
    .th-reviews-grid {
        grid-template-columns: repeat(min(var(--cards-per-row, 3), 3), 1fr);
    }
}

@media (max-width: 991px) {
    .th-reviews-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .th-social-reviews-grid .th-reviews-title {
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .th-reviews-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .th-review-card {
        padding: 20px;
    }

    .th-review-card-header {
        flex-direction: column;
        gap: 12px;
    }

    .th-review-card .th-review-rating {
        align-self: flex-start;
    }

    .th-social-reviews-grid .th-reviews-title {
        font-size: 22px;
    }

    .th-social-reviews-grid .th-reviews-subtitle {
        font-size: 14px;
    }
}

/* ===========================================
   CHECKOUT OVERALL RATINGS
   =========================================== */

.th-checkout-ratings {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.th-rating-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    min-width: 200px;
}

.th-rating-card:hover {
    border-color: #8ac43f;
    box-shadow: 0 2px 8px rgba(138, 196, 63, 0.15);
    text-decoration: none;
    color: inherit;
}

.th-rating-logo {
    flex-shrink: 0;
}

.th-rating-logo svg {
    display: block;
    width: 32px;
    height: 32px;
}

.th-rating-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.th-rating-score {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 16px;
}

.th-rating-number {
    font-size: 14px !important;
    font-weight: 700;
    color: #1f2937;
}

.th-rating-stars {
    display: flex;
    gap: 1px;
}

.th-rating-stars .th-star {
    font-size: 14px !important;
    line-height: 1;
}

.th-rating-stars .th-star-filled {
    color: #fbbf24;
}

.th-rating-stars .th-star-empty {
    color: #d1d5db;
}

.th-rating-count {
    font-size: 12px;
    color: #6b7280;
    line-height: 16px;
}

/* Checkout Ratings Responsive */
@media (max-width: 576px) {
    .th-checkout-ratings {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .th-rating-card {
        min-width: 0;
        justify-content: center;
    }
}

