/* ================================================================
   Reviews Carousel Widget — cfbt-reviews-*
   Choice Elementor Addon  |  widget-reviews-carousel.css
   ================================================================ */

/* ── Section wrapper ──────────────────────────────────────── */
/* position:relative so the absolutely-positioned nav buttons anchor here */
.cfbt-reviews-section {
    position: relative;
    padding: 0 44px 24px;
    /* 44px left/right = lane for the ‹ › buttons */
}

/* ── Side-by-side layout: 4 equal columns ──────────────── */
/* Grid gives intro-card the exact same 1fr width as one review card */
.cfbt-reviews-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: stretch;
}

/* ── Carousel wrap — spans grid columns 2–4, clips overflow ── */
.cfbt-reviews-carousel-wrap {
    grid-column: 2 / 5;
    /* takes columns 2, 3, 4 — leaves col 1 for intro card */
    min-width: 0;
    overflow: hidden;
}

/* ── Sliding track ───────────────────────────────────────── */
.cfbt-reviews-track {
    display: flex;
    gap: 16px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    align-items: stretch;
}

/* Instantly reposition track for seamless loop snap-back */
.cfbt-reviews-track.cfbt-no-transition {
    transition: none !important;
}

/* ── Cards — shared base ───────────────────────────────── */
.cfbt-review-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    min-width: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

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

/*
 * Intro card: occupies grid column 1 automatically.
 * No flex/width sizing needed — the grid gives it exactly 1fr.
 */
.cfbt-review-card-intro {
    background: linear-gradient(145deg, #f8f9ff 0%, #eef1ff 100%);
    border: 1px solid #e0e4f8;
    align-self: stretch;
}

/*
 * Review cards: 3 visible inside the carousel-wrap (3fr, includes 2 gaps).
 * flex-basis is 33.333% of carousel-wrap ≈ 1fr of the whole grid.
 */
.cfbt-review-card-review {
    flex: 0 0 calc(33.333% - 11px);
}

.cfbt-reviews-intro-heading {
    font-size: 1.2em;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.35;
    margin: 0 0 20px;
}

/* Google wordmark */
.cfbt-reviews-google-wrap {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.cfbt-reviews-google-logo {
    width: 135px;
    height: auto;
    display: block;
}

/* Rating row */
.cfbt-reviews-rating-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cfbt-reviews-rating-score {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cfbt-reviews-score {
    font-size: 2.4em;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}

.cfbt-reviews-stars-static {
    display: flex;
    gap: 2px;
}

.cfbt-reviews-count {
    font-size: 0.82em;
    color: #666;
    font-weight: 500;
}

/* ── Stars ───────────────────────────────────────────────── */
.cfbt-reviews-star {
    font-size: 1.1em;
    line-height: 1;
}

.cfbt-reviews-star-full {
    color: #FBBC05;
}

.cfbt-reviews-star-half {
    color: #FBBC05;
    opacity: 0.6;
}

.cfbt-reviews-star-empty {
    color: #d0d0d0;
}

/* ── Review cards ────────────────────────────────────────── */
.cfbt-reviewer-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

/* Avatar — initial letter circle */
.cfbt-reviewer-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Initial letter */
.cfbt-reviewer-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.2em;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0;
    line-height: 1;
    user-select: none;
}

/* Fallback '?' when no name */
.cfbt-reviewer-initial-fallback {
    opacity: 0.6;
    font-size: 1em;
}

/* Reviewer info */
.cfbt-reviewer-info {
    flex: 1;
    min-width: 0;
}

.cfbt-reviewer-name {
    font-weight: 700;
    font-size: 0.95em;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cfbt-reviewer-name a {
    color: inherit;
    text-decoration: none;
}

.cfbt-reviewer-name a:hover {
    text-decoration: underline;
    color: #4285F4;
}

.cfbt-reviewer-location {
    font-size: 0.78em;
    color: #888;
    margin-top: 1px;
}

.cfbt-reviewer-time {
    font-size: 0.78em;
    color: #aaa;
    margin-top: 2px;
}

/* Stars on review card */
.cfbt-review-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 10px;
}

.cfbt-review-stars .cfbt-reviews-star {
    font-size: 1em;
}

/* Review text */
.cfbt-review-text {
    font-size: 0.88em;
    color: #444;
    line-height: 1.6;
    flex: 1;
}

.cfbt-review-text p {
    margin: 0;
}

/* ── Navigation buttons ───────────────────────────────────── */
/* Positioned relative to .cfbt-reviews-section, sit in the 44px padding lanes */
.cfbt-reviews-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #333;
    transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
    z-index: 10;
    padding: 0;
}

/* .cfbt-reviews-nav-btn:hover {
    background: #4285F4;
    color: #fff;
    border-color: #4285F4;
    box-shadow: 0 4px 14px rgba(66, 133, 244, 0.35);
} */

.cfbt-reviews-nav-prev {
    left: 4px;
    /* inside the 44px left padding of section */
}

.cfbt-reviews-nav-next {
    right: 4px;
    /* inside the 44px right padding of section */
}

/* ── Pagination dots + mobile arrows (dots visible on ALL screens) ───── */
.cfbt-reviews-mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-bottom: 8px;
}

.cfbt-reviews-mobile-dots {
    display: flex;
    gap: 7px;
    align-items: center;
}

.cfbt-reviews-mobile-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0d4e8;
    transition: background 0.3s, transform 0.3s;
    flex-shrink: 0;
    cursor: default;
}

.cfbt-reviews-mobile-dot.cfbt-dot-active {
    background: #4285F4;
    transform: scale(1.3);
}

/* Nav arrow buttons: hidden on desktop/tablet, shown only on mobile */
.cfbt-reviews-mobile-arrows {
    display: none;
    gap: 20px;
    align-items: center;
}

.cfbt-reviews-mobile-btn {
    background: #fff;
    border: 1.5px solid #d8dce8;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    color: #333;
    transition: background 0.2s, transform 0.15s;
    padding: 0;
    line-height: 1;
}

.cfbt-reviews-mobile-btn:hover,
.cfbt-reviews-mobile-btn:focus {
    background: #ff8a3d;
    color: #fff;
    border-color: #ff8a3d;
    outline: none;
}

.cfbt-reviews-mobile-btn:active {
    transform: scale(0.92);
}

/* ── Source / attribution ─────────────────────────────────── */
.cfbt-reviews-source {
    margin-top: 20px;
    font-size: 0.8em;
    color: #999;
    text-align: center;
}

.cfbt-reviews-source a {
    color: #4285F4;
    text-decoration: none;
}

.cfbt-reviews-source a:hover {
    text-decoration: underline;
}


/* ── Responsive ──────────────────────────────────────────────────────────────────────
   Tablet (768px-1199px) explicitly replicates desktop layout.
   Mobile (≤767px) single-card horizontal slider.                                    */

/* ── TABLET (768px – 1199px): force desktop layout ─────────────────────────────── */
@media (min-width: 768px) and (max-width: 1199px) {

    .cfbt-reviews-section {
        position: relative !important;
        padding: 0 44px 24px !important;
    }

    /* 2-column grid: intro card in col-1, 1 review card in col-2 */
    .cfbt-reviews-layout {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        align-items: stretch !important;
    }

    /* Intro card: visible in its grid column, sticky */
    .cfbt-reviews-layout > .cfbt-review-card-intro {
        display: flex !important;
    }

    /* Carousel wrap spans only col-2 — shows 1 review card at a time */
    .cfbt-reviews-carousel-wrap {
        grid-column: 2 / 3 !important;
        overflow: hidden !important;
        width: auto !important;
    }

    /* Each review card width is set by JS (sizeCards uses wrap.offsetWidth).
       Do NOT set flex here with !important — it overrides the JS inline style. */

    /* Track: horizontal, gap=0 so JS step = exact card width */
    .cfbt-reviews-track {
        flex-direction: row !important;
        gap: 0 !important;
        /* transform driven by JS */
    }

    /* Hide the intro-slide clone injected for mobile */
    .cfbt-intro-slide {
        display: none !important;
    }

    /* Desktop side-nav: visible */
    .cfbt-reviews-nav-btn {
        display: flex !important;
    }

    /* Dots: already visible from base CSS.
       Arrow buttons: hidden on tablet (side-nav arrows are used instead). */
    .cfbt-reviews-mobile-arrows {
        display: none !important;
    }

    /* Intro card: sticky */
    .cfbt-review-card-intro {
        position: sticky !important;
        top: 80px !important;
    }
}

/* ── Mobile (≤767px): horizontal slider — all cards incl. intro ──
   JS injects the intro card as slide #0 inside the track.
   768px+ (tablet & desktop) use the full desktop grid layout.        */
@media (max-width: 767px) {

    .cfbt-reviews-section {
        padding: 0 0 0;
    }

    /* Hide the original intro card grid cell — JS puts a clone in the track */
    .cfbt-reviews-layout>.cfbt-review-card-intro {
        display: none !important;
    }

    /* Layout: let carousel-wrap fill all available width */
    .cfbt-reviews-layout {
        display: block !important;
        grid-template-columns: unset !important;
    }

    /* Carousel wrap: full width, clips to 1 card */
    .cfbt-reviews-carousel-wrap {
        width: 100% !important;
        overflow: hidden !important;
    }

    /* Track: horizontal row, no gap so card width = step exactly */
    .cfbt-reviews-track {
        flex-direction: row !important;
        gap: 0 !important;
        /* transform is applied by JS — do NOT override it here */
    }

    /* Every card in the track (including injected intro clone) = full width */
    .cfbt-reviews-track .cfbt-review-card {
        flex: 0 0 100% !important;
        width: 100% !important;
        box-sizing: border-box;
        min-width: 0;
    }

    /* Intro card clone inside the track: not sticky */
    .cfbt-intro-slide {
        position: static !important;
    }

    /* Desktop side-nav: hidden on mobile */
    .cfbt-reviews-nav-btn {
        display: none !important;
    }

    /* ── Mobile-only: show arrow buttons + mobile-specific styles ── */
    .cfbt-reviews-mobile-arrows {
        display: flex !important;
    }

    .cfbt-reviews-score {
        font-size: 2em;
    }
}

/* ── Tablet & Desktop (≥768px): hide the JS-injected intro-slide in the track ── */
@media (min-width: 768px) {
    .cfbt-intro-slide {
        display: none !important;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .cfbt-review-card {
        padding: 18px 16px;
    }

    .cfbt-reviews-score {
        font-size: 1.8em;
    }
}