﻿
/* ===============================
   Utility Classes
================================ */
.text-center {
    text-align: center;
}

.mb-5 {
    margin-bottom: 3rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* ===============================
   Navigation Arrow Icon
================================ */
.nav-arrow svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===============================
   Carousel Wrapper
================================ */
.reviews-carousel-wrapper {
    max-width: 1200px;
    margin: auto;
    position: relative;
}

/* ===============================
   Slider
================================ */
.reviews-slider {
    display: flex;
    gap: 1rem;
    padding: 0 1rem 1rem;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

    .reviews-slider::-webkit-scrollbar {
        display: none;
    }

/* ===============================
   Review Item
================================ */
.review-carousel-item {
    background: #f8f8f8;
    padding: 1rem;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    width: 100%;
    min-width: 90vw;
}

@media (min-width: 992px) {
    .review-carousel-item {
        width: calc(25% - 0.75rem);
        min-width: unset;
    }
}

/* ===============================
   Review Card Content
================================ */
.review-card-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.reviewer-info {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

/* ===============================
   Avatar + Google Badge
================================ */
.avatar-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

    .reviewer-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.avatar-wrapper .google-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
}

/* ===============================
   Reviewer Info
================================ */
.reviewer-details {
    display: flex;
    flex-direction: column;
}

.name-badge-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.author-name {
    font-weight: bold;
    color: #333;
    font-size: 0.9rem;
}

/* ===============================
   Rating
================================ */
.review-rating {
    display: flex;
    gap: 1px;
    margin-top: 4px;
}

    .review-rating .star {
        width: 18px;
        height: 18px;
        fill: #FBBC05;
    }

/* ===============================
   Review Text
================================ */
/*.review-text {
    color: #333;
    line-height: 1.4;
    margin-top: 0.5rem;
    flex-grow: 1;
}*/
.review-text {
    color: #333;
    line-height: 1.4;
    margin-top: 0.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* số dòng muốn hiển thị */
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
}
    .review-text.expanded {
        -webkit-line-clamp: unset;
        overflow: visible;
    }

.review-time {
    font-size: 0.8rem;
    color: #888;
    margin-top: 1rem;
}
.read-more-btn {
    background: none;
    border: none;
    padding: 0;
    margin-top: 4px;
    font-size: 0.85rem;
    color: #685951;
    cursor: pointer;
    display: none; /* JS sẽ bật khi cần */
    text-align: left; /* 👈 căn chữ trái */
    align-self: flex-start; /* 👈 QUAN TRỌNG */
}


    .read-more-btn:hover {
        text-decoration: underline;
    }


/* ===============================
   Navigation Arrows (Desktop)
================================ */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(100, 100, 100, 0.7);
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.prev-arrow {
    left: 10px;
}

.next-arrow {
    right: 10px;
}

@media (min-width: 992px) {
    .nav-arrow {
        display: flex;
    }

    .reviews-carousel-wrapper:hover .nav-arrow {
        opacity: 1;
    }

    .reviews-carousel-wrapper:hover .prev-arrow {
        transform: translate(-5px, -50%);
    }

    .reviews-carousel-wrapper:hover .next-arrow {
        transform: translate(5px, -50%);
    }
}

/* ===============================
   Progress Bar (Mobile)
================================ */
.navigation-bar {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 1rem auto 0;
    max-width: 400px;
}

@media (max-width: 991px) {
    .navigation-bar {
        display: flex;
    }
    .nav-arrow {
        display: flex;
        opacity: 1; /* 👈 BẮT BUỘC */
    }
}


.progress-container {
    flex-grow: 1;
    height: 4px;
    background-color: #eee;
    border-radius: 2px;
}

.progress-fill {
    height: 100%;
    background-color: #999;
    border-radius: 2px;
    transition: width 0.3s ease-in-out;
}

/* Mobile: 1 box */
.review-carousel-item {
    width: 90vw;
    min-width: 90vw;
}

/* Tablet: 2 box */
@media (min-width: 768px) and (max-width: 991px) {
    .review-carousel-item {
        width: calc(50% - 0.5rem);
        min-width: calc(50% - 0.5rem);
    }
}

/* Desktop: 4 box */
@media (min-width: 992px) {
    .review-carousel-item {
        width: calc(25% - 0.75rem);
        min-width: unset;
    }
}

