.tp-trust {
  --tp-green: #00b67a;
  --tp-green-deep: #008f60;
  --tp-ink: #191919;
  --tp-muted: #6d716b;
  --tp-line: rgba(57, 66, 55, 0.1);
  --tp-surface: #fffdf9;
  --tp-card-w: 116px;
  --tp-panel-w: 212px;

  position: fixed;
  bottom: 20px;
  z-index: 998;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tp-trust--left {
  left: 20px;
  align-items: flex-start;
}

.tp-trust--right {
  right: 20px;
  align-items: flex-end;
}

.tp-trust__panel {
  width: var(--tp-panel-w);
  max-width: calc(100vw - 32px);
  padding: 14px 16px 12px;
  border: 1px solid var(--tp-line);
  border-radius: 14px;
  background: var(--tp-surface);
  box-shadow: 0 14px 36px rgba(31, 34, 31, 0.11);
  transform-origin: bottom center;
  animation: tp-trust-rise 0.24s ease;
  box-sizing: border-box;
  overflow: visible;
}

.tp-trust--right .tp-trust__panel {
  transform-origin: bottom right;
}

.tp-trust--left .tp-trust__panel {
  transform-origin: bottom left;
}

.tp-trust__panel[hidden] {
  display: none;
}

.tp-trust__panel-top {
  margin-bottom: 8px;
  text-align: center;
  overflow: visible;
}

.tp-trust__panel-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin: 0 0 10px;
  color: var(--tp-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tp-trust__panel-stars {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 0 8px;
  padding: 0 8px;
  box-sizing: border-box;
  overflow: visible;
  --font-size: 0.88;
  --letter-spacing: 0;
}

.tp-trust__panel-score {
  margin: 5px 0 0;
  color: var(--tp-ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.tp-trust__panel-max {
  color: var(--tp-muted);
  font-size: 11px;
  font-weight: 600;
}

.tp-trust__panel-label {
  margin: 3px 0 0;
  color: var(--tp-muted);
  font-size: 10px;
  font-weight: 600;
}

.tp-trust__panel-count {
  margin: 4px auto 0;
  max-width: 100%;
  padding: 0 4px;
  color: var(--tp-muted);
  font-size: 10px;
  line-height: 1.4;
  text-wrap: balance;
}

.tp-trust__links {
  margin: 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--tp-line);
  list-style: none;
}

.tp-trust__links a {
  display: block;
  padding: 7px 4px;
  color: var(--tp-ink);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
  border-radius: 6px;
  text-wrap: pretty;
}

.tp-trust__links a:hover,
.tp-trust__links a:focus-visible {
  color: var(--tp-green);
  background: rgba(0, 182, 122, 0.06);
  outline: none;
}

.tp-trust__card {
  position: relative;
  width: var(--tp-card-w);
  overflow: visible;
}

.tp-trust__menu {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.tp-trust__dot {
  display: block;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: #a3aba4;
}

.tp-trust__menu:hover,
.tp-trust__menu:focus-visible,
.tp-trust[data-tp-open="true"] .tp-trust__menu {
  background: rgba(0, 0, 0, 0.05);
  outline: none;
}

.tp-trust__card-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 10px 10px;
  border: 1px solid var(--tp-line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(0, 182, 122, 0.07) 0%, rgba(0, 182, 122, 0) 38%),
    var(--tp-surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 10px 28px rgba(31, 34, 31, 0.09);
  color: inherit;
  text-align: center;
  text-decoration: none;
  overflow: visible;
}

.tp-trust[data-tp-open="true"] .tp-trust__card-link {
  border-color: rgba(0, 182, 122, 0.2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 12px 32px rgba(0, 182, 122, 0.11);
}

.tp-trust__accent {
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, var(--tp-green) 20%, var(--tp-green) 80%, transparent);
  opacity: 0.85;
  pointer-events: none;
}

.tp-trust__glow {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 182, 122, 0.14) 0%, rgba(0, 182, 122, 0) 72%);
  transform: translateX(-50%);
  pointer-events: none;
}

.tp-trust__stars {
  --letter-spacing: 0;
  --font-size: 1;
  --percent: calc((var(--tp-rating) / 5) * 100%);
  position: relative;
  z-index: 1;
  display: inline-flex;
  justify-content: center;
  max-width: 100%;
  letter-spacing: 0;
  font-size: calc(var(--font-size) * 1rem);
  line-height: 1;
}

.tp-trust__stars--card {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 7px;
  padding: 0 10px;
  box-sizing: border-box;
  --font-size: 0.8;
}

.tp-trust__stars-fill {
  display: inline-block;
  font-family: Times, serif;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tp-trust__stars-fill::before {
  content: "★★★★★";
  background: linear-gradient(90deg, var(--tp-green) var(--percent), #d5dbd7 var(--percent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tp-trust__score {
  position: relative;
  z-index: 1;
  color: var(--tp-ink);
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
}

.tp-trust__label {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 182, 122, 0.11);
  color: var(--tp-green-deep);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.tp-trust__brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(57, 66, 55, 0.08);
}

.tp-trust__brand-star {
  flex-shrink: 0;
}

.tp-trust__brand-name {
  color: var(--tp-ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.tp-trust__brand svg {
  width: 15px;
  height: 15px;
}

.tp-trust:not(.tp-trust--loaded) .tp-trust__card-link {
  opacity: 0.9;
}

.tp-trust:not(.tp-trust--loaded) [data-tp-score] {
  opacity: 0.45;
}

.trustpilot-widget,
iframe[src*="trustpilot"],
#tp-widget-wrapper,
.tp-widget-wrapper {
  display: none !important;
}

@keyframes tp-trust-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media screen and (max-width: 749px) {
  .tp-trust {
    bottom: 10px;
    --tp-card-w: 104px;
    --tp-panel-w: min(210px, calc(100vw - 124px));
  }

  .tp-trust--left {
    left: 10px;
  }

  .tp-trust--right {
    right: 10px;
  }

  .tp-trust__panel {
    padding: 12px 14px 10px;
  }

  .tp-trust__panel-brand {
    font-size: 10px;
    margin-bottom: 8px;
  }

  .tp-trust__panel-score {
    font-size: 23px;
  }

  .tp-trust__panel-stars {
    --font-size: 0.82;
    margin-bottom: 6px;
  }

  .tp-trust__links a {
    font-size: 10px;
    padding: 6px 2px;
  }

  .tp-trust__card-link {
    padding: 15px 9px 9px;
    border-radius: 13px;
  }

  .tp-trust__menu {
    top: 6px;
    right: 6px;
    width: 16px;
    height: 18px;
  }

  .tp-trust__dot {
    width: 2px;
    height: 2px;
  }

  .tp-trust__stars--card {
    margin-bottom: 6px;
    padding: 0 7px;
    --font-size: 0.74;
  }

  .tp-trust__score {
    font-size: 24px;
  }

  .tp-trust__label {
    margin-top: 4px;
    padding: 3px 8px;
    font-size: 9.5px;
  }

  .tp-trust__brand {
    margin-top: 8px;
    padding-top: 8px;
    gap: 4px;
  }

  .tp-trust__brand-name {
    font-size: 9.5px;
  }

  .tp-trust__brand svg {
    width: 13px;
    height: 13px;
  }

  .tp-trust__glow {
    width: 60px;
    height: 60px;
    top: -11px;
  }

  .tp-trust__accent {
    left: 10px;
    right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tp-trust__panel,
  .tp-trust__links a {
    animation: none;
    transition: none;
  }
}

body.template-product .tp-trust { display: none !important; }
