/* ═══════════════════════════════════════════════════════════════
   NMSH Google Reviews — Premium SaaS Testimonial Widget
   Matched to theinfiniteservice.com reference dimensions
   ═══════════════════════════════════════════════════════════════ */

/* ── Section ── */
.nmsh-google-reviews {
  position: relative;
  background: #0B0B0B;
  overflow: hidden;
  font-family: 'Nunito Sans', 'Jost', system-ui, -apple-system, sans-serif;
  color: #fff;
}

.nmsh-gr--full-width {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

/* ── Inner Container ── */
.nmsh-gr-inner {
  position: relative;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 20px;
  z-index: 1;
}

/* Radial gradient glow — PHP <style> overrides per-instance */
.nmsh-gr-inner::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 30%;
  width: 500px;
  height: 500px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(5,116,133,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* ── Grid: Trust (20%) + Carousel (80%) ── */
.nmsh-gr-grid {
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 40px;
  align-items: center;
}

.nmsh-gr-grid--right {
  grid-template-columns: 1fr 245px;
}

.nmsh-gr-grid--right .nmsh-gr-trust { order: 2; }
.nmsh-gr-grid--right .nmsh-gr-carousel-wrap { order: 1; }

.nmsh-gr-grid--above {
  grid-template-columns: 1fr;
  gap: 32px;
}

.nmsh-gr-grid--above .nmsh-gr-trust {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.nmsh-gr-grid--no-trust {
  grid-template-columns: 1fr;
}

/* ── Trust Panel ── */
.nmsh-gr-trust {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  min-width: 0;
}

.nmsh-gr-grid--above .nmsh-gr-trust,
.nmsh-gr-grid--right .nmsh-gr-trust {
  align-items: center;
}

.nmsh-gr-trust-heading {
  font-family: 'Spartan', 'Playfair Display', system-ui, sans-serif;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 16px;
  line-height: 1.1;
  white-space: nowrap;
}

.nmsh-gr-trust-stars {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  color: #FFC107;
}

.nmsh-gr-trust-stars svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.nmsh-gr-trust-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 16px;
}

.nmsh-gr-trust-count {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.72);
}

.nmsh-gr-trust-label {
  font-size: 13px;
  color: rgba(255,255,255,0.42);
}

.nmsh-gr-trust-source {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
}

/* Logo — explicit width so it's never too small.
   Elementor controls inject max-width via {{WRAPPER}}.elementor-element selector. */
.nmsh-gr-trust-logo {
  display: block;
  width: 120px;
  height: auto;
  min-width: 80px;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.25s;
}

.nmsh-gr-trust-logo:hover {
  opacity: 1;
}

/* ── Carousel Wrapper ── */
.nmsh-gr-carousel-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Carousel ── */
.nmsh-gr-carousel {
  position: relative;
}

.nmsh-gr-viewport {
  overflow: hidden;
  position: relative;
  padding: 0 4px;
}

.nmsh-gr-track {
  display: flex;
  gap: 16px;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: auto;
}

.nmsh-gr-track.is-animating {
  will-change: transform;
}

/* ── Slides — 3-up desktop ── */
.nmsh-gr-slide {
  flex: 0 0 auto;
  width: calc((100% - 32px) / 3);
  box-sizing: border-box;
}

/* ── Review Cards ── */
.nmsh-gr-card {
  background: #191919;
  border-radius: 14px;
  padding: 24px;
  border: none;
  box-shadow: none;
  transition:
    transform 250ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.nmsh-gr-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* ── Card Header ── */
.nmsh-gr-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
}

.nmsh-gr-avatar {
  width: 44px;
  height: 44px;
  border-radius: 30px;
  object-fit: cover;
  border: none;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}

.nmsh-gr-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  background: linear-gradient(135deg, rgba(5,116,133,0.25), rgba(5,116,133,0.08));
}

.nmsh-gr-reviewer {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nmsh-gr-name {
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nmsh-gr-date {
  font-size: 13px;
  color: #8a8a8a;
  line-height: 1.3;
}

.nmsh-gr-google-icon {
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  opacity: 0.4;
  transition: opacity 0.25s;
}

.nmsh-gr-card:hover .nmsh-gr-google-icon {
  opacity: 0.65;
}

.nmsh-gr-google-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Stars ── */
.nmsh-gr-stars {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 12px;
  color: #FFC107;
}

.nmsh-gr-stars svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Review Text ── */
.nmsh-gr-text {
  font-size: 15px;
  line-height: 1.5;
  color: #FFFFFF;
  margin: 0 0 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Verified Badge ── */
.nmsh-gr-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #4CAF50;
  margin-top: auto;
  padding-top: 4px;
}

.nmsh-gr-verified svg {
  flex-shrink: 0;
}

/* ── Navigation Arrows — flanking the carousel ── */
.nmsh-gr-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(25,25,25,0.95);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  outline: none;
}

.nmsh-gr-arrow:hover {
  background: #333;
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}

.nmsh-gr-arrow:focus-visible {
  outline: 2px solid #057485;
  outline-offset: 2px;
}

.nmsh-gr-arrow:active {
  transform: translateY(-50%) scale(0.93);
}

.nmsh-gr-prev {
  left: -16px;
}

.nmsh-gr-next {
  right: -16px;
}

.nmsh-gr-arrow img,
.nmsh-gr-arrow svg {
  width: 14px;
  height: 14px;
  display: block;
  pointer-events: none;
}

.nmsh-gr-arrow svg {
  stroke: currentColor;
  fill: none;
}

.nmsh-gr-prev img {
  transform: scaleX(-1);
}

/* ── Dots — below the carousel ── */
.nmsh-gr-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.nmsh-gr-dot {
  width: 8px;
  height: 8px;
  border-radius: 100px;
  border: none;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.nmsh-gr-dot:hover {
  background: rgba(255,255,255,0.28);
}

.nmsh-gr-dot.is-active {
  background: #057485;
  width: 24px;
}

.nmsh-gr-dot:focus-visible {
  outline: 2px solid #057485;
  outline-offset: 2px;
}

/* ═══════════════════════════════════════
   RTL
   ═══════════════════════════════════════ */
[dir="rtl"] .nmsh-gr-grid--right .nmsh-gr-trust { order: 0; }
[dir="rtl"] .nmsh-gr-grid--right .nmsh-gr-carousel-wrap { order: 0; }
[dir="rtl"] .nmsh-gr-prev { right: -16px; left: auto; }
[dir="rtl"] .nmsh-gr-next { left: -16px; right: auto; }
[dir="rtl"] .nmsh-gr-track { direction: ltr; }
[dir="rtl"] .nmsh-gr-slide { direction: rtl; }
[dir="rtl"] .nmsh-gr-text { text-align: right; }

/* ═══════════════════════════════════════
   Responsive — Desktop (≤1200px)
   ═══════════════════════════════════════ */
@media (max-width: 1200px) {
  .nmsh-gr-inner {
    padding: 0 20px;
  }

  .nmsh-gr-grid {
    gap: 32px;
  }

  .nmsh-gr-slide {
    width: calc((100% - 16px) / 2);
  }
}

/* ═══════════════════════════════════════
   Responsive — Tablet (≤1024px)
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
  .nmsh-gr-grid,
  .nmsh-gr-grid--right {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .nmsh-gr-grid--right .nmsh-gr-trust { order: 0; }
  .nmsh-gr-grid--right .nmsh-gr-carousel-wrap { order: 0; }

  .nmsh-gr-trust {
    align-items: center;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
  }

  .nmsh-gr-slide {
    width: calc((100% - 16px) / 2);
  }
}

/* ═══════════════════════════════════════
   Responsive — Mobile (≤768px)
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .nmsh-gr-inner {
    padding: 0 16px;
  }

  .nmsh-google-reviews {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  .nmsh-gr-grid {
    gap: 24px;
  }

  .nmsh-gr-trust-heading {
    font-size: 22px;
    letter-spacing: 1.5px;
  }

  .nmsh-gr-trust-stars svg {
    width: 22px;
    height: 22px;
  }

  .nmsh-gr-slide {
    width: 100%;
  }

  .nmsh-gr-card {
    padding: 20px;
    border-radius: 12px;
  }

  .nmsh-gr-avatar {
    width: 40px;
    height: 40px;
    border-radius: 28px;
  }

  .nmsh-gr-avatar--initials {
    font-size: 14px;
  }

  .nmsh-gr-name {
    font-size: 14px;
  }

  .nmsh-gr-text {
    font-size: 14px;
    line-height: 1.45;
    -webkit-line-clamp: 4;
  }

  .nmsh-gr-stars svg {
    width: 13px;
    height: 13px;
  }

  .nmsh-gr-arrow {
    width: 28px;
    height: 28px;
  }

  .nmsh-gr-arrow img,
  .nmsh-gr-arrow svg {
    width: 12px;
    height: 12px;
  }

  .nmsh-gr-prev { left: -10px; }
  .nmsh-gr-next { right: -10px; }

  .nmsh-gr-dots {
    margin-top: 16px;
  }

  .nmsh-gr-dot {
    width: 7px;
    height: 7px;
  }

  .nmsh-gr-dot.is-active {
    width: 22px;
  }
}

/* ═══════════════════════════════════════
   Responsive — Small Mobile (≤480px)
   ═══════════════════════════════════════ */
@media (max-width: 480px) {
  .nmsh-gr-inner {
    padding: 0 12px;
  }

  .nmsh-gr-trust-heading {
    font-size: 20px;
    letter-spacing: 1px;
  }

  .nmsh-gr-card {
    padding: 18px;
    border-radius: 10px;
  }

  .nmsh-gr-card-header {
    gap: 10px;
    margin-bottom: 12px;
  }

  .nmsh-gr-avatar {
    width: 38px;
    height: 38px;
    border-radius: 26px;
  }

  .nmsh-gr-google-icon {
    display: none;
  }

  .nmsh-gr-arrow {
    width: 26px;
    height: 26px;
  }
}

/* ═══════════════════════════════════════
   Accessibility — Reduced Motion
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .nmsh-gr-track,
  .nmsh-gr-card,
  .nmsh-gr-arrow,
  .nmsh-gr-dot {
    transition: none !important;
  }
  .nmsh-gr-card:hover {
    transform: none !important;
  }
}

/* ═══════════════════════════════════════
   Print
   ═══════════════════════════════════════ */
@media print {
  .nmsh-google-reviews {
    background: #fff !important;
  }
  .nmsh-gr-card {
    background: #f5f5f5 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .nmsh-gr-name,
  .nmsh-gr-text {
    color: #000 !important;
  }
  .nmsh-gr-date {
    color: #666 !important;
  }
  .nmsh-gr-arrow,
  .nmsh-gr-dots {
    display: none !important;
  }
}
