/* Boton "Volver arriba" (30/09/2026). Abajo a la derecha, libre en todas las
   paginas. Queda por debajo de los paneles (carrito, menu, filtros, vista
   rapida), que usan z-index mucho mas altos. */
html body button.fde-top {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 140; /* sobre el contenido y la barra fija del catalogo (100); bajo el panel de filtros (150-151) y los demas paneles */
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid #e6e8e3;
  border-radius: 50%;
  background: #fff;
  color: var(--fde-green-text, #2e7d32);
  box-shadow: 0 6px 20px rgba(26, 26, 46, .14);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s, background-color .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
html body button.fde-top.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s, background-color .15s ease, color .15s ease;
}
html body button.fde-top svg { width: 22px; height: 22px; }
@media (hover: hover) {
  html body button.fde-top:hover { background: var(--fde-green, #4caf50); border-color: transparent; color: #fff; }
}
html body button.fde-top:active { transform: scale(.94); }
html body button.fde-top:focus-visible { outline: 3px solid var(--fde-green, #4caf50); outline-offset: 3px; }

@media (max-width: 767px) {
  html body button.fde-top {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
  }
  /* El aviso de "Producto agregado" sale abajo al centro: mientras se ve, el
     boton sube para no quedar pegado. */
  html body:has(#fdehcToast.show) button.fde-top.is-on { transform: translateY(-60px); }
}

/* Con un panel abierto (la pagina bloquea el scroll) no tiene sentido. */
html body[style*="overflow: hidden"] button.fde-top { opacity: 0; visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  html body button.fde-top, html body button.fde-top.is-on { transition: none; }
}
