/* css/google-reviews.css
 * Sección "Lo que dicen nuestros clientes" (reseñas de Google Maps) · AFD Detailing Store
 * Colores tomados de style.css. Para ajustar, cambiá solo las variables de .gr
 */

.gr {
  --gr-bg-surface: #0d1219;
  --gr-bg-raised: #111923;
  --gr-line: rgba(234, 243, 255, 0.08);
  --gr-line-strong: rgba(234, 243, 255, 0.14);
  --gr-text: #eaf3ff;
  --gr-muted: #93a4b8;
  --gr-brand: #00e0ff;
  --gr-brand-2: #0b82ff;
  --gr-star: #f5b82e;
  --gr-star-off: #2a3441;
  --gr-skeleton: #18212c;
  /* Atribución "Google Maps": Google solo permite blanco, #1F1F1F o #5E5E5E */
  --gr-gmaps: #ffffff;

  padding: 72px 16px;
  color: var(--gr-text);
}

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

.gr [hidden] {
  display: none !important;
}

.gr-container {
  max-width: 1180px;
  margin: 0 auto;
}

/* ---------- Encabezado ---------- */

.gr-head {
  max-width: 720px;
  margin-bottom: 28px;
}

.gr-title {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--gr-text);
  text-shadow: none;
  text-transform: none;
  text-wrap: balance;
}

.gr-subtitle {
  margin: 0;
  text-wrap: pretty;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gr-muted);
}

/* ---------- Panel (todo lo que viene de Google va acá adentro) ---------- */

.gr-panel {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "side    reviews"
    "actions reviews"
    "foot    foot";
  column-gap: 32px;
  row-gap: 20px;
  padding: 28px;
  background: var(--gr-bg-surface);
  border: 1px solid var(--gr-line);
  border-radius: 22px;
}

/* ---------- Calificación ---------- */

.gr-side {
  grid-area: side;
  position: relative;
  overflow: hidden;
  padding: 26px 24px 24px;
  border-radius: 16px;
  border: 1px solid rgba(0, 224, 255, 0.16);
  background:
    linear-gradient(155deg, rgba(0, 224, 255, 0.10) 0%, rgba(0, 224, 255, 0) 45%),
    var(--gr-bg-raised);
}

/* Reflejo que cruza una sola vez, como la luz sobre un capot encerado */
.gr-side::after {
  content: "";
  position: absolute;
  inset: -20% auto -20% 0;
  width: 45%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.14) 50%, transparent 100%);
  transform: translateX(-160%) skewX(-12deg);
  pointer-events: none;
}

.gr.is-shine .gr-side::after {
  animation: gr-sheen 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s 1 both;
}

@keyframes gr-sheen {
  to { transform: translateX(330%) skewX(-12deg); }
}

.gr-score {
  margin: 0;
  font-size: 76px;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  /* Número con acabado cromado */
  background: linear-gradient(180deg, #ffffff 0%, #e6f6fc 42%, #8fb2c2 52%, #dff3fa 70%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gr-score-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.gr-count {
  margin: 0;
  font-size: 14px;
  color: var(--gr-muted);
}

/* ---------- Estrellas (SVG) ---------- */

.gr-stars {
  position: relative;
  display: inline-flex;
  line-height: 0;
}

.gr-stars__row {
  display: inline-flex;
  gap: 2px;
}

.gr-stars__row svg {
  width: var(--gr-star-size, 16px);
  height: var(--gr-star-size, 16px);
  flex-shrink: 0;
}

.gr-stars__row--off { color: var(--gr-star-off); }

.gr-stars__row--on {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--gr-fill, 100%);
  overflow: hidden;
  color: var(--gr-star);
}

.gr-side .gr-stars { --gr-star-size: 20px; }

/* ---------- Acciones ---------- */

.gr-actions {
  grid-area: actions;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gr-brand), var(--gr-brand-2));
  color: #001018;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 170, 255, 0.22);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.gr-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(0, 200, 255, 0.32);
  color: #001018;
}

.gr-btn svg,
.gr-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.gr-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gr-text);
  text-decoration: none;
}

.gr-link:hover {
  color: var(--gr-brand);
}

.gr-fallback {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gr-muted);
}

/* ---------- Carrusel ---------- */

.gr-reviews {
  grid-area: reviews;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gr-track {
  --gr-fade-l: 0px;
  --gr-fade-r: 0px;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 2px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * 16px) / 2.35);
  column-gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--gr-fade-l), #000 calc(100% - var(--gr-fade-r)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--gr-fade-l), #000 calc(100% - var(--gr-fade-r)), transparent 100%);
}

.gr-track::-webkit-scrollbar {
  display: none;
}

.gr-track.has-more-left { --gr-fade-l: 40px; }
.gr-track.has-more-right { --gr-fade-r: 64px; }

.gr-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 252px;
  padding: 22px 22px 18px;
  background: var(--gr-bg-raised);
  border: 1px solid var(--gr-line);
  border-radius: 14px;
}

.gr-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gr-time {
  font-size: 13px;
  color: var(--gr-muted);
  white-space: nowrap;
}

.gr-text {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--gr-text);
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.gr-card.is-open .gr-text {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.gr-text--empty {
  color: var(--gr-muted);
}

.gr-linkbtn {
  appearance: none;
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--gr-brand);
  cursor: pointer;
}

.gr-linkbtn:hover {
  text-decoration: underline;
}

.gr-translated {
  margin: -4px 0 0;
  font-size: 12px;
  color: var(--gr-muted);
}

.gr-translated .gr-linkbtn {
  font-size: inherit;
  margin-left: 6px;
}

.gr-author {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--gr-line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.gr-author > a {
  flex-shrink: 0;
  display: block;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}

.gr-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  background: var(--gr-skeleton);
}

.gr-avatar--initial {
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: var(--gr-text);
  background: linear-gradient(145deg, #1c2a38, #142029);
  border: 1px solid var(--gr-line-strong);
}

.gr-author__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gr-author__name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--gr-text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.gr-author__name:hover {
  color: var(--gr-brand);
}

.gr-author__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
}

.gr-author__links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gr-muted);
  text-decoration: none;
}

.gr-author__links a:hover {
  color: var(--gr-text);
  text-decoration: underline;
}

.gr-author__links svg {
  width: 12px;
  height: 12px;
}

/* Controles */

.gr-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gr-dots {
  display: flex;
  align-items: center;
  gap: 2px;
}

.gr-dot {
  appearance: none;
  width: 26px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.gr-dot::before {
  content: "";
  width: 18px;
  height: 3px;
  border-radius: 3px;
  background: var(--gr-line-strong);
  transition: background 0.2s ease;
}

.gr-dot.is-active::before {
  background: var(--gr-brand);
}

.gr-arrows {
  display: flex;
  gap: 8px;
}

.gr-arrow {
  appearance: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--gr-line-strong);
  background: transparent;
  color: var(--gr-text);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.gr-arrow svg {
  width: 18px;
  height: 18px;
}

.gr-arrow:hover:not(:disabled) {
  border-color: var(--gr-brand);
  color: var(--gr-brand);
}

.gr-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.gr-reviews:not(.is-scrollable) .gr-controls {
  display: none;
}

/* ---------- Pie: aviso + atribución ---------- */

.gr-foot {
  grid-area: foot;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 18px;
  border-top: 1px solid var(--gr-line);
}

.gr-note {
  margin: 0;
  text-wrap: pretty;
  max-width: 760px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--gr-muted);
}

.gr-note a {
  color: inherit;
  text-decoration: underline;
}

.gr-gmaps {
  font-family: Roboto, sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: normal;
  white-space: nowrap;
  color: var(--gr-gmaps);
  flex-shrink: 0;
}

/* ---------- Carga ---------- */

.gr-sk {
  display: block;
  border-radius: 6px;
  background: var(--gr-skeleton);
  animation: gr-pulse 1.4s ease-in-out infinite;
}

.gr-sk--score { width: 120px; height: 64px; border-radius: 10px; }
.gr-sk--stars { width: 110px; height: 16px; margin-top: 16px; }
.gr-sk--count { width: 90px; height: 12px; margin-top: 10px; }
.gr-sk--avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.gr-sk--name { width: 55%; height: 12px; }
.gr-sk--line { width: 100%; height: 11px; }
.gr-sk--short { width: 62%; }

.gr-card--skeleton {
  pointer-events: none;
}

@keyframes gr-pulse {
  50% { opacity: 0.45; }
}

/* ---------- Sin reseñas (Google no respondió o se llegó al límite del día) ---------- */

.gr.is-fallback .gr-panel {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "side" "actions";
  justify-items: center;
  text-align: center;
}

.gr.is-fallback .gr-side {
  border: 0;
  background: none;
  padding: 0;
}

.gr.is-fallback .gr-reviews,
.gr.is-fallback .gr-foot,
.gr.is-fallback .gr-score-block {
  display: none;
}

.gr.is-fallback .gr-actions {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 24px;
}

/* ---------- Accesibilidad ---------- */

.gr a:focus-visible,
.gr button:focus-visible,
.gr-track:focus-visible {
  outline: 2px solid var(--gr-brand);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .gr.is-shine .gr-side::after { animation: none; }
  .gr-sk { animation: none; }
  .gr-btn { transition: none; }
}

/* ---------- Tablet ---------- */

@media (max-width: 960px) {
  .gr-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    grid-template-areas:
      "side    actions"
      "reviews reviews"
      "foot    foot";
    row-gap: 24px;
  }

  .gr-side {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .gr-score-block {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .gr-score { font-size: 60px; }
  .gr-score-meta { margin-top: 0; }

  .gr-actions {
    align-self: center;
    min-width: 220px;
  }

  .gr-track {
    grid-auto-columns: calc((100% - 16px) / 1.8);
  }
}

/* ---------- Celular ---------- */

@media (max-width: 640px) {
  .gr {
    padding: 48px 16px;
  }

  .gr-head {
    margin-bottom: 22px;
  }

  .gr-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "side"
      "reviews"
      "actions"
      "foot";
    padding: 16px;
    border-radius: 18px;
    row-gap: 18px;
  }

  .gr-side {
    padding: 18px;
  }

  .gr-score { font-size: 52px; }

  .gr-actions {
    min-width: 0;
    align-self: stretch;
  }

  .gr-track {
    grid-auto-columns: 86%;
    column-gap: 12px;
  }

  .gr-card {
    min-height: 236px;
    padding: 18px 18px 16px;
  }

  .gr-arrows {
    display: none;
  }

  .gr-controls {
    justify-content: center;
  }

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

  .gr.is-fallback .gr-actions {
    flex-direction: column;
    align-self: stretch;
  }
}
