/* ============================================================
   MPMD Google Reviews — Widget Styles
   Google Business Profile reviews list aesthetic.
   ============================================================ */

/* ── Root variables ──────────────────────────────────────── */
.mpmd-widget {
    --mpmd-star-color:   #FBBC04;
    --mpmd-star-empty:   #E0E0E0;
    --mpmd-card-bg:      #ffffff;
    --mpmd-card-shadow:  0 2px 12px rgba(0, 0, 0, 0.10);
    --mpmd-card-radius:  12px;
    --mpmd-text-main:    #1a1a1a;
    --mpmd-text-muted:   #717171;
    --mpmd-badge-bg:     #ffffff;
    --mpmd-nav-color:    #555555;
    --mpmd-gap:          16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    width: 100%;
}

.mpmd-widget *,
.mpmd-widget *::before,
.mpmd-widget *::after {
    box-sizing: inherit;
}

/* ── Summary badge ───────────────────────────────────────── */
.mpmd-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--mpmd-badge-bg);
    border-radius: 50px;
    padding: 10px 20px 10px 14px;
    box-shadow: var(--mpmd-card-shadow);
    margin-bottom: 24px;
}

.mpmd-badge-logo {
    flex-shrink: 0;
}

.mpmd-badge .mpmd-google-icon {
    width: 32px;
    height: 32px;
    display: block;
}

.mpmd-badge-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}

.mpmd-badge-stars {
    display: flex;
    gap: 2px;
}

.mpmd-badge-stars .mpmd-star {
    font-size: 18px;
}

.mpmd-badge-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--mpmd-text-muted);
}

.mpmd-avg-rating {
    font-weight: 700;
    font-size: 14px;
    color: var(--mpmd-text-main);
}

.mpmd-badge-sep {
    color: var(--mpmd-text-muted);
}

.mpmd-review-link {
    color: var(--mpmd-text-muted);
    text-decoration: none;
}

.mpmd-review-link:hover {
    text-decoration: underline;
    color: var(--mpmd-text-main);
}

/* ── Stars (shared) ──────────────────────────────────────── */
.mpmd-star {
    display: inline-block;
    line-height: 1;
    color: var(--mpmd-star-empty);
}

.mpmd-star.filled {
    color: var(--mpmd-star-color);
}

/* ── Reviews list wrapper ────────────────────────────────── */
.mpmd-reviews-list {
    display: flex;
    flex-direction: column;
}

/* ── Single review item ──────────────────────────────────── */
.mpmd-review-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 0;
    border-bottom: 1px solid #e8e8e8;
}

.mpmd-review-item:last-child {
    border-bottom: none;
}

/* ── Review header (avatar + name/date + G icon) ─────────── */
.mpmd-review-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.mpmd-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    color: #ffffff;
    overflow: hidden;
}

.mpmd-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.mpmd-avatar-initial {
    position: relative;
    z-index: 0;
    line-height: 1;
}

.mpmd-reviewer-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mpmd-reviewer-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--mpmd-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mpmd-review-date {
    font-size: 12px;
    color: var(--mpmd-text-muted);
}

.mpmd-card-google-badge {
    flex-shrink: 0;
    margin-left: auto;
}

.mpmd-card-google-badge .mpmd-google-icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* ── Stars row (stars + verified checkmark) ──────────────── */
.mpmd-review-stars-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mpmd-review-stars-row .mpmd-star {
    font-size: 16px;
}

.mpmd-verified-icon {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    max-width: 16px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── Review text ─────────────────────────────────────────── */
.mpmd-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mpmd-review-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--mpmd-text-main);
    margin: 0;
    word-break: break-word;
}

.mpmd-review-text.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mpmd-review-text.truncated.expanded {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

.mpmd-read-more {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #4285F4;
    text-align: left;
}

.mpmd-read-more:hover {
    text-decoration: underline;
}

/* ── No reviews ──────────────────────────────────────────── */
.mpmd-no-reviews {
    font-size: 14px;
    color: var(--mpmd-text-muted);
    text-align: center;
    padding: 24px 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .mpmd-badge {
        padding: 8px 14px 8px 10px;
        gap: 8px;
    }

    .mpmd-badge .mpmd-google-icon {
        width: 26px;
        height: 26px;
    }

    .mpmd-badge-stars .mpmd-star {
        font-size: 15px;
    }

    .mpmd-reviewer-name {
        font-size: 13px;
    }
}

/* ── Sticky Reviews Button ───────────────────────────────────────────────── */

.mpmd-sticky-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: none;
    border-radius: 28px;
    padding: 11px 18px 11px 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.20), 0 1px 3px rgba(0,0,0,0.10);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    font-family: inherit;
    transition: box-shadow .2s, transform .2s;
}

.mpmd-sticky-btn:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    transform: translateY(-2px);
}

.mpmd-sticky-btn:focus-visible {
    outline: 2px solid #4285F4;
    outline-offset: 2px;
}

.mpmd-sticky-btn-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
    min-width: 0;
}

.mpmd-sticky-btn-stars {
    display: flex;
    align-items: center;
    gap: 1px;
    line-height: 1;
    margin-bottom: 2px;
}

.mpmd-sticky-btn-meta {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #202124;
    white-space: nowrap;
}

.mpmd-sticky-btn-sep {
    margin: 0 3px;
    color: #9aa0a6;
}

/* Dark backdrop (click to close) */
.mpmd-sticky-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.mpmd-sticky-backdrop.mpmd-open {
    opacity: 1;
    pointer-events: auto;
}

/* Floating popup anchored above the button (bottom & side set via inline style) */
.mpmd-sticky-overlay {
    position: fixed;
    z-index: 9999;
    width: 360px;
    max-width: calc(100vw - 48px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s cubic-bezier(.32,.72,0,1);
}

.mpmd-sticky-overlay.mpmd-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Popup panel */
.mpmd-sticky-popup {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 72vh;
    box-shadow: 0 8px 40px rgba(0,0,0,0.20), 0 2px 8px rgba(0,0,0,0.10);
}

.mpmd-sticky-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.mpmd-sticky-popup-title {
    font-weight: 600;
    font-size: 15px;
    color: #202124;
}

.mpmd-sticky-popup-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #5f6368;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .15s;
}

.mpmd-sticky-popup-close:hover {
    background: #f1f3f4;
}

.mpmd-sticky-popup-body {
    overflow-y: auto;
    padding: 4px 20px 24px;
    flex: 1;
}

@media (max-width: 540px) {
    .mpmd-sticky-overlay {
        width: calc(100vw - 32px);
        max-width: none;
    }
    .mpmd-sticky-btn {
        bottom: 16px;
        right: 16px;
        padding: 10px 14px 10px 10px;
        font-size: 13px;
    }
}
