/* =========================================================
   HMF Google Reviews – Frontend CSS
   Farben kommen per Inline-Style aus dem Admin
   ========================================================= */

/* ── Widget Wrapper ── */
.hmf-rev-widget {
  font-family: 'Google Sans', Roboto, Arial, sans-serif !important;
  border-radius: 12px;
  border: 1px solid var(--hmf-border, #dadce0);
  box-shadow: 0 1px 3px rgba(60,64,67,.12), 0 1px 2px rgba(60,64,67,.08);
  overflow: visible;
  margin: 0;
  padding: 0;
}

/* ── Header ── */
.hmf-rev-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--hmf-border, #dadce0);
  flex-wrap: wrap;
  border-radius: 12px 12px 0 0;
}

.hmf-rev-header-inner {
  display: flex;
  align-items: center;
  gap: .875rem;
}

.hmf-rev-biz-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--hmf-border, #dadce0);
  flex-shrink: 0;
  background: #fff;
}

.hmf-rev-biz-logo-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f1f3f4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
}

.hmf-rev-biz-name {
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.hmf-rev-header-rating {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  margin-top: .2rem;
  font-size: .8125rem;
}

.hmf-rev-rating-number {
  font-size: .9375rem;
  font-weight: 700;
}

.hmf-rev-google-wordmark {
  height: 16px;
  width: auto;
  vertical-align: middle;
  display: inline-block;
}

/* Header CTA */
.hmf-rev-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: .45rem 1.125rem;
  border: 1px solid var(--hmf-border, #dadce0);
  border-radius: 20px;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background .15s;
  font-family: inherit;
}

.hmf-rev-cta-btn:hover,
.hmf-rev-cta-btn:focus {
  background: #e8f0fe !important;
  outline: none;
}

/* ── Sterne ── */
.hmf-rev-stars {
  display: inline-flex;
  gap: 0;
  line-height: 1;
}

.hmf-s {
  font-size: 1.05rem;
  line-height: 1;
}

/* ── Track / Slider / Grid / List ── */
.hmf-rev-track-wrap {
  position: relative;
  padding: .875rem 0 .375rem;
}

/* Slider: extra seitlicher Platz für die Pfeile */
.hmf-rev-layout-slider .hmf-rev-track-wrap {
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

/* SLIDER – CSS scroll-snap (nativ, butterweich, kein Clipping) */
.hmf-rev-layout-slider .hmf-rev-track {
  display: flex;
  gap: .875rem;
  overflow-x: auto;
  /* scroll-behavior via JS animateScroll gesteuert */
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: .25rem 1.5rem .875rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}

.hmf-rev-layout-slider .hmf-rev-track:active {
  cursor: grabbing;
}

.hmf-rev-layout-slider .hmf-rev-track::-webkit-scrollbar {
  display: none;
}

.hmf-rev-layout-slider .hmf-rev-card {
  flex: 0 0 clamp(240px, 40vw, 310px);
  scroll-snap-align: start;
}

/* GRID */
.hmf-rev-layout-grid .hmf-rev-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: .875rem;
  padding: .25rem 1.5rem .875rem;
}

/* LIST */
.hmf-rev-layout-list .hmf-rev-track {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  padding: .25rem 1.5rem .875rem;
}

/* ── Karte ── */
.hmf-rev-card {
  border-radius: 10px;
  border: 1px solid var(--hmf-border, #e8eaed);
  padding: 1rem 1rem .875rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  box-shadow: 0 1px 2px rgba(60,64,67,.06);
  transition: box-shadow .2s;
}

.hmf-rev-card:hover {
  box-shadow: 0 2px 8px rgba(60,64,67,.14);
}

/* Card Top */
.hmf-rev-card-top {
  display: flex;
  align-items: center;
  gap: .625rem;
}

.hmf-rev-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.hmf-rev-avatar-letter {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff !important;
  flex-shrink: 0;
  text-transform: uppercase;
}

.hmf-rev-card-meta {
  flex: 1;
  min-width: 0;
}

.hmf-rev-author {
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.hmf-rev-date {
  font-size: .75rem;
  margin-top: .1rem;
}

.hmf-rev-g-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-left: auto;
}

.hmf-rev-card-stars {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.hmf-rev-verified {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Text */
.hmf-rev-text {
  font-size: .875rem;
  line-height: 1.55;
  margin: 0;
}

.hmf-rev-more-btn {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  font-size: .8125rem;
  color: #1a73e8 !important;
  cursor: pointer;
  font-family: inherit;
  margin-top: .15rem;
  display: block;
  text-decoration: none;
}

.hmf-rev-more-btn:hover {
  text-decoration: underline;
}

/* ── Inhaber-Antwort ── */
.hmf-rev-owner-reply {
  border-radius: 8px;
  padding: .75rem .875rem;
  margin-top: .25rem;
  border-left: 3px solid var(--hmf-border, #dadce0);
}

.hmf-rev-owner-reply-header {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .4rem;
  flex-wrap: wrap;
}

.hmf-rev-owner-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.hmf-rev-owner-label {
  font-size: .8125rem;
  font-weight: 600;
}

.hmf-rev-owner-date {
  font-size: .75rem;
}

.hmf-rev-owner-text {
  font-size: .8125rem;
  line-height: 1.55;
  margin: 0;
}

/* ── Slider Pfeile ── außerhalb der Karten, am Rand des Track-Wrap */
.hmf-rev-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--hmf-border, #dadce0);
  box-shadow: 0 1px 4px rgba(60,64,67,.18);
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: box-shadow .15s, background .15s;
  line-height: 1;
  padding: 0;
}

.hmf-rev-nav:hover { box-shadow: 0 2px 6px rgba(60,64,67,.22); }
/* Pfeile sitzen im padding-Bereich, NICHT über den Karten */
.hmf-rev-prev { left: .25rem; }
.hmf-rev-next { right: .25rem; }
.hmf-rev-nav.hidden { opacity: 0; pointer-events: none; }

/* ── "Eine Rezension schreiben" Button ── */
.hmf-rev-write-wrap {
  display: flex;
  justify-content: center;
  padding: .375rem 1.5rem 1.25rem;
}

.hmf-rev-write-btn {
  display: inline-flex;
  align-items: center;
  padding: .625rem 1.75rem;
  border-radius: 20px;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none !important;
  font-family: inherit;
  transition: filter .15s;
  box-shadow: 0 1px 3px rgba(60,64,67,.18);
  border: none;
}

.hmf-rev-write-btn:hover,
.hmf-rev-write-btn:focus {
  filter: brightness(1.1);
  outline: none;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .hmf-rev-header { padding: 1rem; flex-direction: column; align-items: flex-start; }
  .hmf-rev-layout-slider .hmf-rev-card { flex: 0 0 84vw; }
  .hmf-rev-nav { display: none; }
}

/* ── A11y ── */
.hmf-rev-widget :focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Animationen ── */
@media (prefers-reduced-motion: no-preference) {
  .hmf-rev-card {
    animation: hmfFadeIn .25s ease both;
  }
  @keyframes hmfFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: none; }
  }
}
