/* Google reviews (badge, panel, testimonials page, carousel). Class names kept from leadworks-reviews so existing theme CSS still applies. */
.lwr-inline, .lwr-carousel-wrap, #lwr-modal, #lwr-badge, .lwr-inline-badge {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}
.lwr-review-stars { display: inline-flex; gap: 1px; margin-top: 2px; vertical-align: middle; }
.lwr-review-stars svg { display: block; }

/* Floating badge */
#lwr-badge {
  position: fixed; bottom: 24px; z-index: 999998; cursor: pointer; border: 0; padding: 0; background: none;
  transition: transform .2s ease;
}
#lwr-badge.lwr-left { left: 24px; }
#lwr-badge.lwr-right { right: 24px; }
#lwr-badge:hover, #lwr-badge:focus-visible { transform: scale(1.06); }
#lwr-badge-inner {
  background: var(--lwr-primary, #e74c3c); color: #fff; border-radius: 50px; padding: 10px 18px 10px 12px;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.25);
  font-size: 15px; font-weight: 600; line-height: 1;
}
#lwr-badge-star { width: 28px; height: 28px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
#lwr-badge-rating { white-space: nowrap; }

/* Panel */
#lwr-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999999; }
#lwr-modal-overlay.lwr-active { display: block; }
#lwr-modal {
  position: fixed; bottom: 24px; width: 420px; max-width: calc(100vw - 48px); max-height: calc(100vh - 48px);
  background: #fff; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.3); z-index: 1000000;
  display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: translateY(20px) scale(.95);
  transition: transform .3s ease, opacity .3s ease;
}
#lwr-modal[hidden] { display: none; }
#lwr-modal.lwr-left { left: 24px; }
#lwr-modal.lwr-right { right: 24px; }
#lwr-modal.lwr-active { opacity: 1; transform: none; }
.lwr-header { background: var(--lwr-primary, #e74c3c); color: #fff; padding: 22px 44px 18px 20px; text-align: center; position: relative; flex-shrink: 0; }
.lwr-header h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; line-height: 1.3; color: #fff !important; }
.lwr-header-sub { color: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.lwr-header-sub svg { background: #fff; border-radius: 50%; padding: 2px; }
.lwr-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: rgba(255,255,255,.8); font-size: 22px; cursor: pointer; padding: 4px; line-height: 1; }
.lwr-close:hover, .lwr-close:focus-visible { color: #fff; }
.lwr-stats { display: flex; justify-content: center; gap: 30px; padding: 14px 20px; border-bottom: 1px solid #eee; flex-shrink: 0; }
.lwr-stat { text-align: center; }
.lwr-stat-value { font-size: 28px; font-weight: 700; color: var(--lwr-primary, #e74c3c); line-height: 1.2; }
.lwr-stat-label { font-size: 12px; color: #888; margin-top: 2px; }
.lwr-stars-row { display: flex; justify-content: center; gap: 2px; margin-top: 4px; }
.lwr-reviews { flex: 1; overflow-y: auto; padding: 8px 20px 20px; min-height: 200px; }
.lwr-review { padding: 14px 0; border-bottom: 1px solid #f0f0f0; }
.lwr-review:last-child { border-bottom: 0; }

/* Shared review card parts */
.lwr-review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.lwr-avatar, .lwr-avatar-placeholder { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.lwr-avatar-placeholder { background: var(--lwr-primary, #e74c3c); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; }
.lwr-reviewer-info { flex: 1; min-width: 0; }
.lwr-reviewer-name { font-weight: 600; font-size: 16px; color: var(--lwr-text, #333); line-height: 1.3; }
.lwr-google-icon { margin-left: auto; flex-shrink: 0; display: flex; }
.lwr-review-text { font-size: 14px; line-height: 1.5; color: #555; margin-top: 6px; white-space: pre-line; }
.lwr-read-more {
  color: var(--lwr-primary, #e74c3c); font-size: 12px; font-weight: 600; cursor: pointer; text-transform: uppercase;
  letter-spacing: .5px; margin-top: 4px; display: inline-block; border: 0; background: none; padding: 0; align-self: flex-start; text-align: left;
}
.lwr-read-more:hover { opacity: .8; }
.lwr-review-date { font-size: 11px; color: #aaa; margin-top: 6px; }
.lwr-load-more { display: block; width: 100%; padding: 10px; margin-top: 8px; border: 1px solid #eee; border-radius: 8px; background: #fafafa; color: #666; font-size: 13px; font-weight: 600; cursor: pointer; }
.lwr-spinner { display: flex; justify-content: center; padding: 30px; }
.lwr-spinner::after { content: ''; width: 28px; height: 28px; border: 3px solid #eee; border-top-color: var(--lwr-primary, #e74c3c); border-radius: 50%; animation: lwr-spin .7s linear infinite; }
@keyframes lwr-spin { to { transform: rotate(360deg); } }

/* Testimonials page */
.lwr-inline-header { text-align: center; margin-bottom: 24px; }
.lwr-inline-header .lwr-stat-value { font-size: 48px; }
.lwr-inline-header .lwr-stat-label { font-size: 14px; color: inherit; }
.lwr-inline-grid { display: grid; grid-template-columns: repeat(var(--lwr-cols, 2), minmax(0, 1fr)); gap: 16px; }
.lwr-inline-card, .lwr-carousel-card { background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 20px; color: #333; }
.lwr-inline-card .lwr-avatar, .lwr-inline-card .lwr-avatar-placeholder,
.lwr-carousel-card .lwr-avatar, .lwr-carousel-card .lwr-avatar-placeholder { width: 36px; height: 36px; }
.lwr-load-spinner { text-align: center; padding: 20px; min-height: 1px; }
.lwr-load-spinner .lwr-dots { display: none; gap: 6px; }
.lwr-load-spinner.lwr-active .lwr-dots { display: inline-flex; }
.lwr-load-spinner .lwr-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--lwr-primary, #e74c3c); animation: lwrPulse 1.2s ease-in-out infinite; }
.lwr-load-spinner .lwr-dots span:nth-child(2) { animation-delay: .2s; }
.lwr-load-spinner .lwr-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes lwrPulse { 0%,80%,100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* Carousel */
.lwr-carousel-wrap { position: relative; overflow: hidden; padding: 0 4px; }
.lwr-carousel-track { display: flex; align-items: stretch; transition: transform .5s ease; }
.lwr-carousel-slide { flex: 0 0 calc(100% / var(--lwr-cols, 3)); padding: 0 8px; box-sizing: border-box; }
.lwr-carousel-card { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; }
.lwr-carousel-card .lwr-review-text { flex: 1; }
.lwr-carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.3); color: #fff; border: 0; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center; z-index: 2; }
.lwr-carousel-nav:hover, .lwr-carousel-nav:focus-visible { background: rgba(0,0,0,.55); }
.lwr-carousel-nav.lwr-prev { left: 4px; }
.lwr-carousel-nav.lwr-next { right: 4px; }

/* Inline badge shortcode */
.lwr-inline-badge { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border: 1px solid #e5e5e5; border-radius: 12px; background: #fff; cursor: pointer; color: #333; font-size: 15px; line-height: 1.2; text-align: left; }
.lwr-inline-badge:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.lwr-inline-badge-score { font-weight: 700; font-size: 18px; }
.lwr-inline-badge-count { display: block; font-size: 13px; color: #666; margin-top: 2px; }

@media (max-width: 768px) { .lwr-carousel-slide { flex-basis: 100%; } }
@media (max-width: 600px) { .lwr-inline-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  #lwr-modal, #lwr-modal.lwr-left, #lwr-modal.lwr-right { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; max-height: calc(100vh - 16px); }
  #lwr-badge, #lwr-badge.lwr-right { left: 16px; right: auto; bottom: 16px; }
}
