/* 2GIS Reviews Widget — палитра задаётся для каждого экземпляра из админки */
.dgrw {
  --dgrw-accent: #19AA1E;
  --dgrw-on-accent: #FFFFFF;
  --dgrw-widget-bg: #F8FFF5;
  --dgrw-summary-bg: #EAF8DF;
  --dgrw-card-bg: #FFFFFF;
  --dgrw-text: #1A1A1A;
  --dgrw-muted: #54705A;
  --dgrw-border: #D7EDC8;
  --dgrw-star: #FFB919;
  --dgrw-brand-yellow: #FFB919;
  --dgrw-brand-green: var(--dgrw-accent);
  --dgrw-brand-lime: #82D714;
  --dgrw-brand-blue: #0073FA;
  --dgrw-brand-ink: #1A1A1A;
  --dgrw-red: var(--dgrw-accent);
  --dgrw-red-dark: var(--dgrw-accent);
  --dgrw-yellow: #ffba00;
  --dgrw-yellow-dark: #f0b000;
  --dgrw-yellow-soft: #fff3cc;
  --dgrw-card: var(--dgrw-card-bg);
  --dgrw-star-off: #e5e7eb;
  --dgrw-reply: var(--dgrw-summary-bg);
  --dgrw-radius: 20px;
  --dgrw-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --dgrw-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.1);

  color: var(--dgrw-text);
  width: 100%;
  max-width: 1430px;
  min-width: 0;
  margin: 28px auto;
  padding: 22px 20px 18px;
  border-radius: 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;

  background: var(--dgrw-widget-bg);
  border: 1px solid var(--dgrw-border);
  box-shadow: var(--dgrw-shadow);
  position: relative;
  overflow: hidden;
}

.dgrw::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--dgrw-brand-yellow) 0 24%, var(--dgrw-brand-green) 24% 54%, var(--dgrw-brand-lime) 54% 76%, var(--dgrw-brand-blue) 76% 100%);
  z-index: 0;
}

.dgrw * {
  box-sizing: border-box;
}

/* Header */
.dgrw__header {
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.dgrw__header::after {
  content: "";
  display: block;
  width: 76px;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--dgrw-brand-green) 0 46%, var(--dgrw-brand-lime) 46% 70%, var(--dgrw-brand-blue) 70% 100%);
}

.dgrw__title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--dgrw-text) !important;
}

/* Summary */
.dgrw__summary {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: var(--dgrw-summary-bg) !important;
  background-image: none !important;
  border: 1px solid var(--dgrw-border);
  border-radius: 22px;
  box-shadow: none;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
  color: var(--dgrw-text) !important;
}

.dgrw__summary-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 88px;
  padding: 10px 14px;
  border-radius: 20px;
  background: linear-gradient(165deg, var(--dgrw-brand-yellow) 0 22%, var(--dgrw-brand-green) 22% 78%, var(--dgrw-brand-lime) 78% 100%) !important;
  background-image: linear-gradient(165deg, var(--dgrw-brand-yellow) 0 22%, var(--dgrw-brand-green) 22% 78%, var(--dgrw-brand-lime) 78% 100%) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  color: var(--dgrw-on-accent) !important;
  flex-shrink: 0;
}

.dgrw__score-value {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--dgrw-on-accent) !important;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(26, 26, 26, 0.32);
}

.dgrw__summary-score .dgrw__stars {
  margin-top: 4px;
}

.dgrw__summary-score .dgrw__star {
  color: var(--dgrw-on-accent) !important;
  -webkit-text-fill-color: var(--dgrw-on-accent) !important;
  opacity: 0.35;
  font-size: 14px;
}

.dgrw__summary-score .dgrw__star.is-on {
  color: var(--dgrw-on-accent) !important;
  -webkit-text-fill-color: var(--dgrw-on-accent) !important;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(26, 26, 26, 0.28);
}

.dgrw__summary-score .dgrw__star--summary {
  --dgrw-star-fill: 0%;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  opacity: 1;
  background: linear-gradient(90deg,
    var(--dgrw-on-accent) 0 var(--dgrw-star-fill),
    rgba(255, 255, 255, 0.35) var(--dgrw-star-fill) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.dgrw__summary-meta {
  flex: 1;
  min-width: 0;
  color: var(--dgrw-text) !important;
}

.dgrw__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  height: 88px;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  line-height: 0;
  box-shadow: none;
}

.dgrw__brand-logo {
  display: block;
  width: auto;
  height: 76px;
  max-width: 220px;
}

.dgrw__org {
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 4px;
  color: var(--dgrw-text) !important;
}

.dgrw__based {
  color: var(--dgrw-muted) !important;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.85;
}

.dgrw__summary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.dgrw__summary-actions .dgrw__source-link {
  margin-top: 0;
}

.dgrw__summary a.dgrw__source-link,
.dgrw a.dgrw__source-link,
.dgrw__source-link {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 16px !important;
  border-radius: 999px !important;
  background: var(--dgrw-brand-blue) !important;
  background-image: none !important;
  color: var(--dgrw-on-accent) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  border: 0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14) !important;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.2 !important;
}

.dgrw__summary a.dgrw__source-link:hover,
.dgrw a.dgrw__source-link:hover,
.dgrw a.dgrw__source-link:focus,
.dgrw a.dgrw__source-link:visited,
.dgrw__source-link:hover {
  background: var(--dgrw-brand-blue) !important;
  background-image: none !important;
  color: var(--dgrw-on-accent) !important;
  text-decoration: none !important;
  transform: translateY(-1px);
  filter: brightness(0.88);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18) !important;
}

.dgrw a.dgrw__review-link,
.dgrw__review-link {
  display: inline-flex !important;
  align-items: center;
  padding: 8px 16px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--dgrw-brand-yellow) !important;
  color: var(--dgrw-brand-ink) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.dgrw a.dgrw__review-link:hover,
.dgrw a.dgrw__review-link:focus,
.dgrw a.dgrw__review-link:visited,
.dgrw__review-link:hover {
  background: var(--dgrw-brand-yellow) !important;
  color: var(--dgrw-brand-ink) !important;
  text-decoration: none !important;
}

.dgrw a.dgrw__review-link:hover,
.dgrw__review-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18) !important;
}

/* Stars — жёлтые у имени клиента */
.dgrw__stars {
  display: inline-flex !important;
  gap: 1px;
  letter-spacing: 0;
  line-height: 1;
  color: transparent;
}

.dgrw__star {
  font-size: 15px !important;
  line-height: 1 !important;
  color: var(--dgrw-star-off) !important;
  -webkit-text-fill-color: var(--dgrw-star-off) !important;
}

.dgrw__star.is-on {
  color: var(--dgrw-star) !important;
  -webkit-text-fill-color: var(--dgrw-star) !important;
  text-shadow: none;
}

.dgrw__stars--sm .dgrw__star {
  font-size: 14px !important;
}

/* Cards */
.dgrw__card {
  background: var(--dgrw-card-bg);
  border: 1px solid var(--dgrw-border);
  border-radius: var(--dgrw-radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  padding: 16px 16px 14px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  background-clip: padding-box;
}

.dgrw__card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--dgrw-brand-blue) !important;
  background-image: none !important;
  border-radius: 4px 0 0 4px;
}

.dgrw__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--dgrw-shadow-hover);
}

.dgrw__card-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding-left: 4px;
}

.dgrw__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.dgrw__avatar,
.dgrw__avatar--placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dgrw-summary-bg);
  color: var(--dgrw-brand-blue);
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  border: 2px solid var(--dgrw-card-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.dgrw__badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  color: var(--dgrw-on-accent);
  background: var(--dgrw-brand-blue);
  border: 2px solid var(--dgrw-card-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  line-height: 1;
}

.dgrw__author {
  font-weight: 800;
  font-size: 15px;
  color: var(--dgrw-text);
}

.dgrw__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 3px;
}

.dgrw__date {
  color: var(--dgrw-muted);
  font-size: 12px;
  font-weight: 500;
}

.dgrw__text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--dgrw-text);
  word-break: break-word;
  padding-left: 4px;
}

.dgrw__text::before {
  content: "“";
  color: var(--dgrw-brand-blue);
  font-size: 20px;
  font-weight: 800;
  line-height: 0;
  margin-right: 2px;
  vertical-align: -4px;
}

.dgrw__reply {
  margin-top: 10px;
  margin-left: 4px;
  padding: 10px 12px;
  background: var(--dgrw-reply);
  border: 1px solid var(--dgrw-border);
  border-left: 3px solid var(--dgrw-brand-green);
  border-radius: 12px;
  font-size: 13px;
  color: var(--dgrw-text);
  line-height: 1.45;
}

.dgrw__reply strong {
  color: var(--dgrw-brand-green);
  font-weight: 800;
}

/* List */
.dgrw__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

/* Table */
.dgrw__table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--dgrw-border);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  background: var(--dgrw-card-bg);
  position: relative;
  z-index: 1;
}

.dgrw__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.dgrw__table th,
.dgrw__table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--dgrw-border);
  vertical-align: top;
  text-align: left;
  font-size: 13px;
}

.dgrw__table th {
  background: var(--dgrw-summary-bg);
  font-weight: 800;
  white-space: nowrap;
  color: var(--dgrw-text);
}

.dgrw__table tr:hover td {
  background: var(--dgrw-summary-bg);
}

.dgrw__table tr:last-child td {
  border-bottom: 0;
}

.dgrw__author-cell {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
}

.dgrw__author-cell .dgrw__avatar {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.dgrw__td-text .dgrw__text::before {
  display: none;
}

/* Carousel — native scroll (стрелки листают через scrollBy) */
.dgrw__carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
}

.dgrw__viewport {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  /* hide scrollbar, keep scroll */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dgrw__viewport::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.dgrw__track {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 16px;
  width: max-content;
  transform: none !important;
}

.dgrw__card--slide {
  flex: 0 0 auto;
  min-height: 220px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.dgrw__card--slide .dgrw__text {
  flex: 1;
}

/* Nav — всегда кликабельны */
.dgrw__nav {
  flex: 0 0 44px !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  border: 0 !important;
  background: var(--dgrw-brand-yellow) !important;
  border-radius: 50% !important;
  font-size: 26px !important;
  line-height: 1 !important;
  color: var(--dgrw-brand-ink) !important;
  cursor: pointer !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18) !important;
  align-self: center;
  padding: 0 !important;
  margin: 0 !important;
  transition: transform 0.15s ease, opacity 0.15s ease;
  z-index: 5 !important;
  position: relative;
  pointer-events: auto !important;
  -webkit-appearance: none;
  appearance: none;
  user-select: none;
}

.dgrw__nav:hover {
  transform: scale(1.06);
  filter: brightness(1.04);
}

.dgrw__nav-icon {
  display: block;
  width: 24px;
  height: 24px;
  background-color: var(--dgrw-brand-ink);
  -webkit-mask: url("../image/dgis_reviews_arrow.webp") center / contain no-repeat;
  mask: url("../image/dgis_reviews_arrow.webp") center / contain no-repeat;
}

.dgrw__nav--prev .dgrw__nav-icon {
  transform: rotate(180deg);
}

.dgrw__nav.is-disabled {
  opacity: 0.4 !important;
  cursor: default !important;
  box-shadow: none !important;
  background: #DDE6D7 !important;
}

.dgrw--carousel .dgrw__nav {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  visibility: visible !important;
}

.dgrw__dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.dgrw__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: var(--dgrw-border);
  padding: 0;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease, border-radius 0.2s ease;
}

.dgrw__dot.is-active {
  width: 20px;
  border-radius: 999px;
  background: var(--dgrw-brand-blue);
}

/* Phones incl. iPhone Max: 1 card (JS sets width; CSS fallback) */
@media (max-width: 767px) {
  .dgrw {
    margin: 16px 0;
    padding: 16px 12px 14px;
    border-radius: 22px;
  }

  .dgrw__title {
    font-size: 20px;
  }

  .dgrw__summary {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    align-items: center;
    border-radius: 18px;
    padding: 12px;
    column-gap: 10px;
    row-gap: 14px;
  }

  .dgrw__summary-score {
    grid-column: 1;
    grid-row: 1;
    width: 100px;
    min-width: 0;
    min-height: 80px;
    padding: 8px;
  }

  .dgrw__score-value {
    font-size: 30px;
  }

  .dgrw__summary-meta {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .dgrw__brand {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: 100%;
    max-width: 206px;
    min-width: 0;
    height: 80px;
    margin: 0;
    padding: 0;
    border-radius: 18px;
    overflow: hidden;
  }

  .dgrw__brand-logo {
    width: 100%;
    height: 70px;
    max-width: 198px;
    object-fit: contain;
  }

  .dgrw__nav {
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    font-size: 22px !important;
  }

  .dgrw--table .dgrw__table {
    min-width: 520px;
  }
}

/* Corner style selected for this module instance. */
.dgrw--square,
.dgrw--square *,
.dgrw--square::before,
.dgrw--square *::before,
.dgrw--square *::after {
  border-radius: 0 !important;
}

.dgrw--rounded {
  border-radius: 28px !important;
}

.dgrw--rounded .dgrw__summary {
  border-radius: 22px !important;
}

.dgrw--rounded .dgrw__summary-score,
.dgrw--rounded .dgrw__card {
  border-radius: 20px !important;
}

.dgrw--rounded .dgrw__source-link,
.dgrw--rounded .dgrw__review-link {
  border-radius: 10px !important;
}

.dgrw--rounded .dgrw__avatar,
.dgrw--rounded .dgrw__avatar--placeholder {
  border-radius: 10px !important;
}

.dgrw--rounded .dgrw__badge {
  border-radius: 4px !important;
}

.dgrw--rounded .dgrw__nav {
  border-radius: 12px !important;
}

.dgrw--rounded .dgrw__dot {
  border-radius: 2px !important;
}

.dgrw--rounded .dgrw__dot.is-active {
  border-radius: 4px !important;
}

.dgrw--rounded .dgrw__reply {
  border-radius: 12px !important;
}

.dgrw--rounded .dgrw__table-wrap {
  border-radius: 18px !important;
}

@media (max-width: 767px) {
  .dgrw--rounded {
    border-radius: 22px !important;
  }

  .dgrw--rounded .dgrw__summary {
    border-radius: 18px !important;
  }
}
