/* ── Google Reviews — Frontend Styles ───────────────────── */

/* ── CSS custom properties (set inline per widget) ─────── */
.bptk-gr-wrap {
    --gr-star:    #F59E0B;
    --gr-card-bg: #ffffff;
    --gr-text:    #111827;
    --gr-radius:  8px;

    font-family: inherit;
    color: var(--gr-text);
    box-sizing: border-box;
}

.bptk-gr-wrap *,
.bptk-gr-wrap *::before,
.bptk-gr-wrap *::after {
    box-sizing: inherit;
}

/* ── Header ──────────────────────────────────────────────── */

.bptk-gr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0 24px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.bptk-gr-biz-name {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 6px;
    color: var(--gr-text);
}

.bptk-gr-overall {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.bptk-gr-big-num {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    color: var(--gr-text);
}

.bptk-gr-total {
    font-size: 13px;
    color: #6b7280;
}

.bptk-gr-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.bptk-gr-google-logo {
    display: block;
}

.bptk-gr-view-all {
    font-size: 13px;
    color: #4285F4;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}

.bptk-gr-view-all:hover {
    border-color: #4285F4;
}

/* ── Stars ───────────────────────────────────────────────── */

.bptk-gr-stars {
    display: inline-flex;
    gap: 1px;
    line-height: 1;
}

.bptk-gr-star {
    font-style: normal;
    font-size: 18px;
    line-height: 1;
}

.bptk-gr-star.full,
.bptk-gr-star.half {
    color: var(--gr-star);
}

.bptk-gr-star.empty {
    color: #d1d5db;
}

.bptk-gr-card-stars .bptk-gr-star {
    font-size: 14px;
}

/* ── Cards layout: Grid ──────────────────────────────────── */

.bptk-gr-layout-grid .bptk-gr-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ── Cards layout: List ──────────────────────────────────── */

.bptk-gr-layout-list .bptk-gr-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Individual card ─────────────────────────────────────── */

.bptk-gr-card {
    background: var(--gr-card-bg);
    border-radius: var(--gr-radius);
    border: 1px solid #e5e7eb;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.15s;
}

.bptk-gr-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

/* ── Card top row ────────────────────────────────────────── */

.bptk-gr-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* ── Avatar ──────────────────────────────────────────────── */

.bptk-gr-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.bptk-gr-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4285F4;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ── Reviewer info ───────────────────────────────────────── */

.bptk-gr-reviewer-info {
    flex: 1;
    min-width: 0;
}

.bptk-gr-reviewer-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gr-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.bptk-gr-reviewer-name:hover {
    text-decoration: underline;
}

.bptk-gr-date {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Review text ─────────────────────────────────────────── */

.bptk-gr-text-wrap {
    font-size: 14px;
    line-height: 1.6;
    color: var(--gr-text);
}

.bptk-gr-text {
    margin: 0;
    white-space: pre-line;
    overflow: hidden;
}

.bptk-gr-text.is-truncated {
    /* JS sets max-height via inline style */
}

.bptk-gr-read-more {
    display: inline-block;
    margin-top: 6px;
    font-size: 13px;
    color: #4285F4;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
}

.bptk-gr-read-more:hover {
    color: #1a56db;
}

/* ── Footer ──────────────────────────────────────────────── */

.bptk-gr-footer {
    margin-top: 24px;
    text-align: center;
}

.bptk-gr-write-review {
    display: inline-block;
    padding: 11px 22px;
    border: 2px solid #4285F4;
    border-radius: 6px;
    color: #4285F4;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.bptk-gr-write-review:hover {
    background: #4285F4;
    color: #fff;
}

/* ── Cards layout: Slider ────────────────────────────────── */

.bptk-gr-layout-slider .bptk-gr-slider-wrap {
    position: relative;
}

.bptk-gr-layout-slider .bptk-gr-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;       /* Firefox */
    padding-bottom: 4px;         /* room for box-shadow */
}

.bptk-gr-layout-slider .bptk-gr-cards::-webkit-scrollbar {
    display: none;               /* Chrome / Safari */
}

.bptk-gr-layout-slider .bptk-gr-card {
    flex: 0 0 calc(25% - 15px);  /* 4 visible at once */
    min-width: 260px;
    scroll-snap-align: start;
}

/* ── Slider nav buttons ──────────────────────────────────── */

.bptk-gr-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.10);
    transition: background .15s, color .15s, opacity .15s;
    padding: 0;
}

.bptk-gr-slider-btn:hover {
    background: #f3f4f6;
}

.bptk-gr-slider-btn:disabled,
.bptk-gr-slider-btn[aria-disabled="true"] {
    opacity: .35;
    cursor: default;
}

.bptk-gr-slider-prev { left:  -19px; }
.bptk-gr-slider-next { right: -19px; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
    .bptk-gr-layout-slider .bptk-gr-card {
        flex: 0 0 calc(50% - 10px); /* 2 visible on tablet */
    }
}

@media (max-width: 600px) {
    .bptk-gr-layout-grid .bptk-gr-cards {
        grid-template-columns: 1fr;
    }

    .bptk-gr-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .bptk-gr-header-right {
        align-items: flex-start;
    }

    .bptk-gr-layout-slider .bptk-gr-card {
        flex: 0 0 85%; /* 1 card + peek of next on mobile */
    }

    .bptk-gr-slider-prev { left:  0; }
    .bptk-gr-slider-next { right: 0; }
}
