:root {
  --ag-chat-margen-x: clamp(10px, 2.4vw, 26px);
  --ag-chat-margen-y: clamp(9px, 2.3vh, 23px);
  --ag-chat-derecha: max(var(--ag-chat-margen-x), env(safe-area-inset-right, 0px));
  --ag-chat-base: max(var(--ag-chat-margen-y), env(safe-area-inset-bottom, 0px));
  --ag-chat-burbuja-alto: 54px;
}
#ag-accesos-flotantes {
  position: fixed;
  inset: auto 0 0 auto;
  z-index: 8990;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
}
#ag-accesos-flotantes::backdrop { background: transparent; pointer-events: none; }
#ag-accesos-flotantes > #ag-contacto-rapido { position: absolute; }
#ag-contacto-rapido {
  --ag-chat-marino: #1c2146;
  --ag-chat-tinta: #20283e;
  --ag-chat-verde: #b7ee94;
  --ag-chat-ancho: calc(100vw - var(--ag-chat-derecha) - max(var(--ag-chat-margen-x), env(safe-area-inset-left, 0px)));
  --ag-chat-cielo: max(var(--ag-chat-margen-y), env(safe-area-inset-top, 0px));
  position: fixed;
  z-index: 8990;
  right: calc(var(--ag-chat-derecha) + var(--ag-ventana-derecha, 0px));
  bottom: calc(var(--ag-chat-base) + var(--ag-ventana-base, 0px));
  isolation: isolate;
  color: var(--ag-chat-tinta);
  font: 400 14px/1.45 "Open Sans", Arial, sans-serif;
  text-align: left;
  -webkit-text-size-adjust: 100%;
}
#ag-contacto-rapido, #ag-contacto-rapido *, #ag-contacto-rapido *::before,
#ag-contacto-rapido *::after { box-sizing: border-box; }
#ag-contacto-rapido[hidden], #ag-contacto-rapido [hidden] { display: none !important; }
body:has(#ag-contacto-rapido .ag-chat-menu[open]) #ag-resenas {visibility:hidden;}
body.show-overlay-mobile-header #ag-contacto-rapido,
html.ag-carrito-abierto #ag-contacto-rapido,
body:has(#page.show-mobile-header, dialog[open], .cmplz-cookiebanner.cmplz-show, #cookie-notice.cookie-notice-visible, #ag-resenas[open]) #ag-contacto-rapido {
  visibility: hidden;
  pointer-events: none;
}
#ag-contacto-rapido :is(button, input, a) { font-family: inherit; }
#ag-contacto-rapido button, #ag-contacto-rapido .ag-chat-whatsapp {
  appearance: none;
  margin: 0;
  cursor: pointer;
  text-transform: none;
  text-shadow: none;
}
#ag-contacto-rapido svg { display: block; flex-shrink: 0; width: 21px; height: 21px; }
#ag-contacto-rapido :is(button, a, input):focus-visible {
  outline: 3px solid #096fb0;
  outline-offset: 2px;
}

#ag-contacto-rapido .ag-chat-lanzador {
  position: relative;
  display: flex;
  flex-direction:column;
  align-items: stretch;
  gap: 3px;
  width: 100%;
  max-width: var(--ag-chat-ancho);
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(133deg, #283657cb 0%, #1b2045d4 43%, #213740c7 100%);
  box-shadow: inset 0 1px 0 #ffffff31, 0 5px 16px #191f3d38, 0 2px 3px #191f3d24;
  -webkit-backdrop-filter: blur(17px) saturate(1.2);
  backdrop-filter: blur(17px) saturate(1.2);
}
#ag-contacto-rapido .ag-chat-menu {margin:0;padding:0;border:0;}
#ag-contacto-rapido .ag-chat-burbuja {
  display:grid;place-items:center;list-style:none;cursor:pointer;user-select:none;
  width:var(--ag-chat-burbuja-alto);height:var(--ag-chat-burbuja-alto);border-radius:50%;border:1px solid #e1efdcbd;
  background:radial-gradient(ellipse at 29% 15%,#7d938d99,transparent 58%),linear-gradient(145deg,#334765e8,#25284ce8);
  box-shadow:inset 0 1px 2px #ffffff83,inset 0 -2px 6px #0e193843,0 4px 14px #18283e42;
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
}
#ag-contacto-rapido .ag-chat-burbuja::-webkit-details-marker {display:none;}
#ag-contacto-rapido .ag-chat-burbuja span {font:26px/1 "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;}
#ag-contacto-rapido .ag-chat-burbuja:focus-visible {outline:3px solid #1979ae;outline-offset:3px;}
#ag-contacto-rapido .ag-chat-selector {
  position:absolute;right:0;bottom:calc(100% + 9px);overflow:auto;
  width:min(292px,var(--ag-chat-ancho));max-height:calc(100vh - 86px);max-height:calc(100dvh - 86px);
  border:1px solid #d5e0dcbd;border-radius:19px;background:#243047e8;color:white;
  box-shadow:0 10px 32px #101d3c42;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
}
#ag-contacto-rapido .ag-chat-selector .ag-chat-cabecera {padding:8px 8px 8px 17px;min-height:57px;}
#ag-contacto-rapido #ag-chat-menu-titulo {margin:2px 0 0;color:#fff;font:650 16px/1.2 "Open Sans",Arial,sans-serif;letter-spacing:-.02em;}
#ag-contacto-rapido .ag-chat-selector .ag-chat-lanzador {padding:8px;gap:6px;border-radius:0;}
#ag-contacto-rapido .ag-chat-selector .ag-chat-lanzador > :is(button,a) {gap:12px;padding:8px 12px;min-height:51px;}
#ag-contacto-rapido .ag-chat-selector .ag-chat-etiqueta small {font-size:11px;font-weight:500;line-height:1.28;letter-spacing:0;text-transform:none;}
#ag-contacto-rapido .ag-chat-selector .ag-chat-etiqueta strong {font-size:14px;}
@media (hover:hover) {#ag-contacto-rapido .ag-chat-burbuja:hover {filter:brightness(1.13);}}
#ag-contacto-rapido .ag-chat-lanzador::before {
  content: "";
  position: absolute;
  top: 0;
  right: 12%;
  left: 7%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffffffe0 30%, #c3f4db70 57%, transparent);
  pointer-events: none;
}
#ag-contacto-rapido .ag-chat-lanzador > :is(button, a) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-width: 0;
  min-height: 47px;
  padding: 4px 13px 4px 9px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: #fff;
  text-align: left;
  text-decoration: none;
  line-height: 1;
  transition: background-color .16s ease, box-shadow .16s ease;
}
#ag-contacto-rapido .ag-chat-abrir {
  background: linear-gradient(150deg, #ffffff15, transparent 70%);
  box-shadow: inset 0 1px 0 #ffffff12;
}
#ag-contacto-rapido .ag-chat-lanzador > .ag-chat-whatsapp {
  background: linear-gradient(155deg, #d6f7c4f7, #bce7a8de);
  color: #1b3c30;
  box-shadow: inset 0 1px 0 #ffffff85;
}
#ag-contacto-rapido .ag-chat-icono {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 31px;
  height: 31px;
}
#ag-contacto-rapido .ag-chat-abrir .ag-chat-icono { color: #d3efbc; }
#ag-contacto-rapido .ag-chat-icono svg { width: 24px; height: 24px; }
#ag-contacto-rapido .ag-chat-etiqueta { display: grid; align-content: center; gap: 3px; white-space: nowrap; }
#ag-contacto-rapido .ag-chat-etiqueta small {
  color: #d0d7e9;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .1em;
  text-transform: uppercase;
}
#ag-contacto-rapido .ag-chat-whatsapp .ag-chat-etiqueta small { color: #365b42; }
#ag-contacto-rapido .ag-chat-etiqueta strong {
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.025em;
}
#ag-contacto-rapido .ag-chat-lanzador > :focus-visible,
#ag-contacto-rapido .ag-chat-cerrar:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 4px #275168;
}

#ag-contacto-rapido .ag-chat-panel {
  --ag-chat-pad: 17px;
  display: flex;
  flex-direction: column;
  width: min(406px, var(--ag-chat-ancho));
  height: min(554px, calc(100vh - var(--ag-chat-base) - var(--ag-chat-cielo)));
  height: min(554px, calc(var(--ag-alto-chat, 100dvh) - var(--ag-chat-base) - var(--ag-chat-cielo)));
  container-type: size;
  overflow: hidden;
  margin: 0;
  border: 1px solid #abb8ca;
  border-radius: 23px;
  background: linear-gradient(156deg, #eff4f9fa, #f8faf8f7 62%, #ecf1f0fa);
  box-shadow: 0 16px 58px #111c4038, 0 3px 12px #111c4026, inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(20px) saturate(1.08);
  backdrop-filter: blur(20px) saturate(1.08);
}
#ag-contacto-rapido .ag-chat-cabecera {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  min-height: 74px;
  margin: 0;
  padding: 11px 12px 11px var(--ag-chat-pad);
  background: radial-gradient(ellipse at 82% -110%, #668780 6%, transparent 65%),
    linear-gradient(112deg, #252849, #303655 62%, #30464d);
  color: #fff;
  box-shadow: inset 0 1px 0 #ffffff36;
}
#ag-contacto-rapido .ag-chat-cabecera::after {
  content: "";
  position: absolute;
  right: 0; bottom: 0; left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d3f2bd99 32%, #ffffff3b 80%, transparent);
  pointer-events: none;
}
#ag-contacto-rapido .ag-chat-marca {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 41px; height: 41px;
  border: 1px solid #b6d9cd6e;
  border-radius: 13px;
  background: linear-gradient(146deg, #d7edcf2d, #ffffff0a 70%);
  box-shadow: inset 0 1px 0 #ffffff30;
  color: #d7f4ba;
}
#ag-contacto-rapido .ag-chat-marca svg { width: 24px; height: 24px; }
#ag-contacto-rapido .ag-chat-identidad { flex: 1; min-width: 0; }
#ag-contacto-rapido .ag-chat-identidad small {
  display: block;
  color: #d6e0de;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .035em;
}
#ag-contacto-rapido h2.ag-chat-titulo, #ag-contacto-rapido #ag-chat-titulo {
  margin: 0;
  color: #fff;
  font: 700 20px/1.25 "Open Sans", Arial, sans-serif;
  letter-spacing: -.035em;
  text-transform: none;
}
#ag-contacto-rapido .ag-chat-cerrar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 1px solid #d5f0e03d;
  border-radius: 50%;
  background: #ffffff10;
  color: #f9fbfe;
}
#ag-contacto-rapido .ag-chat-cerrar svg { width: 17px; height: 17px; }
#ag-contacto-rapido .ag-asistente-historial {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #9aa8b7 transparent;
  scrollbar-width: thin;
  padding: 17px var(--ag-chat-pad) 11px;
  color: var(--ag-chat-tinta);
  font-size: 14px;
  line-height: 1.5;
}
#ag-contacto-rapido .ag-asistente-historial > div {
  flex: none;
  max-width: 94%;
  padding: 10px 13px;
  overflow-wrap: anywhere;
}
#ag-contacto-rapido .ag-asistente-respuesta {
  align-self: flex-start;
  border: 1px solid #d2dbe5;
  border-radius: 4px 15px 15px;
  background: #fff;
  box-shadow: 0 2px 5px #27334e08;
}
#ag-contacto-rapido .ag-asistente-visitante {
  align-self: flex-end;
  border: 1px solid #c1d9c1;
  border-radius: 15px 4px 15px 15px;
  background: #e2efd9;
  color: #223f32;
}
#ag-contacto-rapido .ag-asistente-historial p {
  margin: 0;
  color: inherit;
  font: inherit;
  white-space: pre-line;
}
#ag-contacto-rapido .ag-asistente-historial a {
  display: block;
  width: fit-content;
  margin-top: 5px;
  padding-block: 2px;
  color: #19427d;
  font: 600 13px/1.45 "Open Sans", Arial, sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
#ag-contacto-rapido .ag-asistente-sugerencias {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px var(--ag-chat-pad);
}
#ag-contacto-rapido .ag-asistente-sugerencias:empty,
#ag-contacto-rapido .ag-asistente-estado:empty { display: none; }
#ag-contacto-rapido .ag-asistente-sugerencias button {
  max-width: 100%;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid #c1d0ce;
  border-radius: 12px;
  background: #f9fbfa;
  color: #2a5346;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
}
#ag-contacto-rapido .ag-asistente-estado {
  flex: none;
  padding: 3px var(--ag-chat-pad);
  color: #465769;
  font-size: 12px;
  line-height: 1.35;
}
#ag-contacto-rapido .ag-asistente-form {
  display: flex;
  flex: none;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 48px;
  margin: 4px var(--ag-chat-pad) 0;
  padding: 3px;
  border: 1px solid #aebcc7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px #111c4009;
}
#ag-contacto-rapido .ag-asistente-form:focus-within { border-color: #2d677c; box-shadow: 0 0 0 2px #4c809b47; }
#ag-contacto-rapido .ag-asistente-form input[type="text"] {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: 42px;
  margin: 0;
  padding: 6px 6px 6px 10px;
  border: 0;
  border-radius: 11px;
  outline-offset: -2px;
  background: transparent;
  box-shadow: none;
  color: #182b3d;
  font: 400 16px/1.3 "Open Sans", Arial, sans-serif;
}
#ag-contacto-rapido .ag-asistente-form input::placeholder,
#ag-contacto-rapido .ag-asistente-form input:focus::placeholder { color: #506174; opacity: 1; }
#ag-contacto-rapido .ag-asistente-enviar {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 1px solid #282e53;
  border-radius: 12px;
  background: linear-gradient(135deg, #45486f, #252a50 80%);
  color: #fff;
}
#ag-contacto-rapido .ag-asistente-enviar:disabled { background: #626c83; border-color: #626c83; cursor: default; }
#ag-contacto-rapido .ag-chat-pie {
  display: flex;
  flex: none;
  justify-content: center;
  margin: 0;
  padding: 0 var(--ag-chat-pad) 2px;
}
#ag-contacto-rapido .ag-chat-agente {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  color: #235b45;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #8eac9d;
  text-underline-offset: 3px;
}
#ag-contacto-rapido .ag-chat-agente svg { width: 16px; height: 16px; }
@media (hover: hover) {
  #ag-contacto-rapido .ag-chat-abrir:hover, #ag-contacto-rapido .ag-chat-cerrar:hover { background-color: #ffffff25; }
  #ag-contacto-rapido .ag-chat-whatsapp:hover { box-shadow: inset 0 0 0 40px #ffffff38; }
  #ag-contacto-rapido .ag-asistente-sugerencias button:hover { border-color: #749d88; background: #e9f4e9; }
  #ag-contacto-rapido .ag-asistente-historial a:hover, #ag-contacto-rapido .ag-chat-agente:hover { text-decoration-thickness: 2px; }
  #ag-contacto-rapido .ag-asistente-enviar:hover:enabled { background: #363e66; }
}
@media (prefers-reduced-motion: no-preference) {
  #ag-contacto-rapido .ag-chat-panel:not([hidden]) { animation: ag-chat-entrada .18s ease-out both; }
  @keyframes ag-chat-entrada { from { opacity: .7; translate: 0 4px; } to { opacity: 1; translate: 0 0; } }
}
@media (prefers-reduced-motion: reduce) {
  #ag-contacto-rapido .ag-chat-lanzador > :is(button, a) { transition: none; }
}
@media (max-width: 480px) {
  :root { --ag-chat-margen-x: 9px; --ag-chat-margen-y: 9px; }
  #ag-contacto-rapido .ag-chat-panel { --ag-chat-pad: 12px; border-radius: 19px; }
  #ag-contacto-rapido .ag-chat-lanzador { gap: 2px; padding: 3px; border-radius: 19px; }
  #ag-contacto-rapido .ag-chat-lanzador > :is(button, a) { min-height: 44px; gap: 5px; padding: 4px 9px 4px 6px; border-radius: 14px; }
  #ag-contacto-rapido .ag-chat-icono { width: 26px; height: 26px; }
  #ag-contacto-rapido .ag-chat-icono svg { width: 22px; height: 22px; }
  #ag-contacto-rapido .ag-chat-cabecera { min-height: 63px; }
}
/* La altura del panel refleja el visualViewport al abrir el teclado en móvil. */
@container (max-height: 425px) {
  #ag-contacto-rapido .ag-chat-cabecera { min-height: 48px; padding-block: 2px; gap: 8px; }
  #ag-contacto-rapido .ag-chat-marca { width: 33px; height: 33px; border-radius: 10px; }
  #ag-contacto-rapido #ag-chat-titulo { font-size: 17px; }
  #ag-contacto-rapido .ag-chat-identidad small { font-size: 10px; }
  #ag-contacto-rapido .ag-asistente-historial { padding-block: 8px; gap: 6px; }
  #ag-contacto-rapido .ag-asistente-sugerencias {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    padding-block: 3px;
  }
  #ag-contacto-rapido .ag-asistente-sugerencias button { flex: none; white-space: nowrap; }
  #ag-contacto-rapido .ag-asistente-form { margin-top: 2px; }
  #ag-contacto-rapido .ag-chat-agente { min-height: 32px; }
}
@media (max-height: 450px) and (orientation: landscape) {
  :root { --ag-chat-margen-y: 5px; }
  #ag-contacto-rapido .ag-chat-panel { --ag-chat-pad: 12px; width: min(460px, var(--ag-chat-ancho)); border-radius: 17px; }
}
@media (prefers-reduced-transparency: reduce) {
  #ag-contacto-rapido .ag-chat-lanzador { background: #303752; }
  #ag-contacto-rapido .ag-chat-panel { background: #f3f6f7; }
  #ag-contacto-rapido :is(.ag-chat-lanzador, .ag-chat-panel) { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  #ag-contacto-rapido .ag-chat-lanzador, #ag-contacto-rapido .ag-chat-panel,
  #ag-contacto-rapido .ag-chat-lanzador > :is(button, a), #ag-contacto-rapido .ag-chat-cerrar, #ag-contacto-rapido .ag-asistente-form {
    border: 1px solid ButtonText;
  }
  #ag-contacto-rapido :is(button, a, input):focus-visible { outline: 3px solid Highlight; }
}
