.ag-resenas {
  --ag-opinion-derecha: var(--ag-chat-derecha, 22px);
  --ag-opinion-base: calc(var(--ag-chat-base, 36px) + var(--ag-chat-burbuja-alto, 54px) + 10px);
  --ag-ancho-resenas: calc(100vw - var(--ag-opinion-derecha) - max(10px, env(safe-area-inset-left, 0px)));
  position: fixed;
  right: calc(var(--ag-opinion-derecha) + var(--ag-ventana-derecha, 0px));
  bottom: calc(var(--ag-opinion-base) + var(--ag-ventana-base, 0px));
  z-index: 9000;
  color: #29303e;
  font: 400 14px/1.4 "Open Sans", Arial, sans-serif;
}
.ag-resenas[hidden] {display: none !important;}
#ag-accesos-flotantes > #ag-resenas {position: absolute;}
html.ag-carrito-abierto .ag-resenas,
body:has(dialog[open], #ag-contacto-rapido[data-abierto="true"], .cmplz-cookiebanner.cmplz-show, #cookie-notice.cookie-notice-visible) .ag-resenas {visibility: hidden;}

.ag-resenas .ag-resenas-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 48px;
  height: 48px;
  margin: 0 0 0 auto;
  padding: 0 11px 0 7px;
  box-sizing: border-box;
  appearance: none;
  border: 1px solid #dfe4de;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 14px #2032402b, 0 1px 3px #172a3d12;
  color: #25354a;
  font: 600 14px/1.25 "Open Sans", Arial, sans-serif;
  text-transform: none;
  cursor: pointer;
}
.ag-resenas-toggle > img {display: block; width: 32px; height: 24px; object-fit: contain;}
.ag-resenas .ag-resenas-toggle:focus-visible,
.ag-resenas-ficha > footer a:focus-visible {outline: 3px solid #1558bc; outline-offset: 3px;}

/* La insignia conserva un único nodo con dimensiones medibles mientras carga. */
.ag-resenas:not([open]) > .ag-resenas-ficha {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  justify-items: end;
  align-items: end;
  width: max-content;
  max-width: var(--ag-ancho-resenas);
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
.ag-resenas:not([open]) .ag-resenas-ficha > header,
.ag-resenas:not([open]) .ag-resenas-ficha > footer {display: none;}
.ag-resenas:not([open]) .ag-resenas-insignia {zoom: .78;}
.ag-resenas[data-insignia-lista]:not([open]) > .ag-resenas-ficha {position: relative; opacity: 1;}
.ag-resenas[data-insignia-lista]:not([open]) > .ag-resenas-toggle {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.ag-resenas[data-insignia-lista]:not([open]) > .ag-resenas-toggle > *,
.ag-resenas[open] > .ag-resenas-toggle > * {display: none;}

.ag-resenas[open] > .ag-resenas-toggle {width: 54px; height: 54px; padding: 0;}
.ag-resenas[open] > .ag-resenas-toggle::before,
.ag-resenas[open] > .ag-resenas-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 21px;
  height: 2.5px;
  border-radius: 4px;
  background: #535b65;
  transform: translate(-50%, -50%) rotate(45deg);
}
.ag-resenas[open] > .ag-resenas-toggle::after {transform: translate(-50%, -50%) rotate(-45deg);}
.ag-resenas[open] > .ag-resenas-ficha {
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  width: min(382px, var(--ag-ancho-resenas));
  max-height: calc(100vh - var(--ag-opinion-base) - 74px);
  max-height: calc(100dvh - var(--ag-opinion-base) - 74px - env(safe-area-inset-top, 0px));
  box-sizing: border-box;
  margin: 0;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 16px #20212426;
  color: #3c4043;
  text-align: left;
}
.ag-resenas-ficha:focus {outline: none;}
.ag-resenas-ficha > header {display: flex; align-items: center; gap: 10px; margin: 0 0 12px;}
.ag-resenas-ficha > header > img {display: block; width: 32px; height: 24px; object-fit: contain;}
.ag-resenas .ag-resenas-ficha > header > h2 {margin: 0; color: #202124; font: 600 17px/1.25 "Open Sans", Arial, sans-serif;}
.ag-resenas-ficha > header > h2 > span {display: block; color: #5f6368; font-size: 15px; font-weight: 400;}
.ag-resenas-ficha > footer {display: grid; justify-items: start; gap: 2px; margin-top: 12px; padding-top: 8px; border-top: 1px solid #e6e8eb;}
.ag-resenas-ficha > footer a {color: #1558bc; font: inherit; text-decoration: none; text-underline-offset: 3px;}
.ag-resenas-ficha > footer a:is(:hover, :focus-visible) {text-decoration: underline;}
.ag-resenas-ficha > footer > a {display: block; padding: 4px 0;}
.ag-resenas-ficha > footer > small {color: #62676d; font-size: 12px;}
@media (max-width: 360px), (max-height: 650px) {
  .ag-resenas[open] > .ag-resenas-ficha {padding: 10px;}
  .ag-resenas-ficha > header {margin-bottom: 8px;}
  .ag-resenas-ficha > footer {margin-top: 8px;}
}
