/* =========================================================
   Google Reviews Widget — Frontend Styles
   ========================================================= */

/* ── Variables ── */
.grw-wrap {
    --grw-primary:      #4285F4;
    --grw-star-full:    #F4B400;
    --grw-star-empty:   #ddd;
    --grw-radius:       12px;
    --grw-radius-sm:    8px;
    --grw-gap:          16px;
    --grw-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Light theme */
    --grw-bg:           #ffffff;
    --grw-card-bg:      #f9f9f9;
    --grw-border:       #e8e8e8;
    --grw-text:         #1a1a1a;
    --grw-text-muted:   #666;
    --grw-shadow:       0 2px 12px rgba(0,0,0,.08);
    --grw-shadow-hover: 0 6px 24px rgba(0,0,0,.14);

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

/* Dark theme */
.grw-wrap.grw-dark {
    --grw-bg:           #1e1e1e;
    --grw-card-bg:      #2a2a2a;
    --grw-border:       #3a3a3a;
    --grw-text:         #f0f0f0;
    --grw-text-muted:   #aaa;
    --grw-shadow:       0 2px 12px rgba(0,0,0,.3);
    --grw-shadow-hover: 0 6px 24px rgba(0,0,0,.5);
}

.grw-wrap *, .grw-wrap *::before, .grw-wrap *::after { box-sizing: border-box; }

/* ── Stars ── */
.grw-stars { display: inline-flex; gap: 2px; line-height: 1; }
.grw-star  { font-size: 18px; color: var(--grw-star-empty); }
.grw-star--full  { color: var(--grw-star-full); }
.grw-star--half  { color: var(--grw-star-full); opacity: .6; }

/* ── Error / Empty ── */
.grw-error, .grw-no-reviews {
    padding: 20px; border: 1px solid var(--grw-border); border-radius: var(--grw-radius);
    color: var(--grw-text-muted); text-align: center; font-size: 14px;
}
.grw-error { color: #d32f2f; border-color: #fcc; background: #fff8f8; }

/* ── Summary Header ── */
.grw-summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; background: var(--grw-card-bg);
    border: 1px solid var(--grw-border); border-radius: var(--grw-radius);
    margin-bottom: var(--grw-gap);
}
.grw-summary__info { display: flex; flex-direction: column; gap: 6px; }
.grw-summary__name { font-weight: 700; font-size: 16px; color: var(--grw-text); }
.grw-summary__rating { display: flex; align-items: center; gap: 8px; }
.grw-summary__avg   { font-size: 28px; font-weight: 800; color: var(--grw-text); }
.grw-summary__count { font-size: 13px; color: var(--grw-text-muted); }
.grw-summary__link  {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 13px; color: var(--grw-primary); text-decoration: none;
}
.grw-summary__link:hover { text-decoration: underline; }
.grw-summary__logo { opacity: .8; }

/* ── Card ── */
.grw-card {
    background: var(--grw-card-bg); border: 1px solid var(--grw-border);
    border-radius: var(--grw-radius); padding: 20px;
    box-shadow: var(--grw-shadow); transition: box-shadow .2s;
    display: flex; flex-direction: column; gap: 10px;
}
.grw-card:hover { box-shadow: var(--grw-shadow-hover); }

.grw-card__header { display: flex; align-items: center; gap: 12px; }
.grw-card__avatar { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--grw-primary); display: flex; align-items: center; justify-content: center; }
.grw-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.grw-card__initials { color: #fff; font-weight: 700; font-size: 16px; }
.grw-card__meta { flex: 1; min-width: 0; }
.grw-card__name { font-weight: 600; font-size: 14px; color: var(--grw-text); text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grw-card__name:hover { color: var(--grw-primary); }
.grw-card__time { font-size: 12px; color: var(--grw-text-muted); }
.grw-card__google { margin-left: auto; flex-shrink: 0; }
.grw-card__text { font-size: 14px; line-height: 1.6; color: var(--grw-text-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Slider ── */
.grw-slider { position: relative; overflow: hidden; }
.grw-slider__track { display: flex; transition: transform .4s cubic-bezier(.4,0,.2,1); }
.grw-slider__slide { flex: 0 0 100%; padding: 4px; }
.grw-slider__btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: var(--grw-bg); border: 1px solid var(--grw-border);
    border-radius: 50%; width: 38px; height: 38px; cursor: pointer;
    font-size: 18px; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--grw-shadow); z-index: 2; color: var(--grw-text);
    transition: background .2s;
}
.grw-slider__btn:hover { background: var(--grw-primary); color: #fff; border-color: var(--grw-primary); }
.grw-slider__btn--prev { left: 4px; }
.grw-slider__btn--next { right: 4px; }
.grw-slider__dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.grw-slider__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grw-border); cursor: pointer; border: none; padding: 0; transition: background .2s, transform .2s; }
.grw-slider__dot.is-active { background: var(--grw-primary); transform: scale(1.3); }

/* ── Grid ── */
.grw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--grw-gap); }

/* ── List ── */
.grw-list { display: flex; flex-direction: column; gap: var(--grw-gap); }
.grw-list__item .grw-card__text { -webkit-line-clamp: 10; }

/* ── Masonry ── */
.grw-masonry { columns: 3 280px; gap: var(--grw-gap); }
.grw-masonry__item { break-inside: avoid; margin-bottom: var(--grw-gap); }
.grw-masonry__item .grw-card__text { -webkit-line-clamp: 20; }

/* ── Testimonial ── */
.grw-testimonial { position: relative; overflow: hidden; }
.grw-testimonial__track { display: flex; transition: transform .4s cubic-bezier(.4,0,.2,1); }
.grw-testimonial__slide {
    flex: 0 0 100%; padding: 40px 60px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    background: var(--grw-card-bg); border: 1px solid var(--grw-border); border-radius: var(--grw-radius);
}
.grw-testimonial__quote { font-size: 64px; line-height: 1; color: var(--grw-primary); opacity: .3; font-family: Georgia, serif; margin-bottom: -20px; }
.grw-testimonial__text  { font-size: 18px; line-height: 1.7; color: var(--grw-text); max-width: 640px; font-style: italic; }
.grw-testimonial__author { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.grw-testimonial__photo  { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.grw-testimonial__initials { width: 48px; height: 48px; border-radius: 50%; background: var(--grw-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.grw-testimonial__name   { font-weight: 600; font-size: 15px; }

/* ── Compact ── */
.grw-compact { display: flex; flex-direction: column; gap: 12px; }
.grw-compact__item { display: flex; gap: 12px; padding: 14px; background: var(--grw-card-bg); border: 1px solid var(--grw-border); border-radius: var(--grw-radius-sm); }
.grw-compact__photo, .grw-compact__initials { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.grw-compact__initials { background: var(--grw-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.grw-compact__body { flex: 1; min-width: 0; }
.grw-compact__top  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.grw-compact__name { font-weight: 600; font-size: 13px; }
.grw-compact__time { font-size: 12px; color: var(--grw-text-muted); margin-left: auto; }
.grw-compact__top .grw-stars .grw-star { font-size: 14px; }
.grw-compact__text { font-size: 13px; color: var(--grw-text-muted); margin: 0; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Badge ── */
.grw-badge {
    display: inline-flex; align-items: center; gap: 14px;
    padding: 16px 20px; background: var(--grw-card-bg);
    border: 1px solid var(--grw-border); border-radius: var(--grw-radius);
    box-shadow: var(--grw-shadow);
}
.grw-badge__score  { font-size: 36px; font-weight: 800; color: var(--grw-text); }
.grw-badge__body   { display: flex; flex-direction: column; gap: 4px; }
.grw-badge__count  { font-size: 13px; color: var(--grw-text-muted); }

/* ── Floating ── */
.grw-floating { display: flex; }
.grw-floating__pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; background: var(--grw-bg);
    border: 1px solid var(--grw-border); border-radius: 999px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12); font-size: 14px; font-weight: 600;
}
.grw-floating__pill .grw-stars .grw-star { font-size: 14px; }
.grw-floating__text { color: var(--grw-text-muted); font-weight: 400; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .grw-masonry { columns: 1; }
    .grw-grid    { grid-template-columns: 1fr; }
    .grw-testimonial__slide { padding: 24px 20px; }
    .grw-testimonial__text  { font-size: 15px; }
    .grw-slider__btn { width: 30px; height: 30px; font-size: 14px; }
    .grw-summary { flex-direction: column; align-items: flex-start; gap: 10px; }
}
