/* Style de base */
.acf-block-component.acf-block-body .acf-block-preview {
  position: relative;
}

/* Boutons cachés par défaut */
.acf-block-component.acf-block-body .pib_edit_buttons {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 999;
  display: none;
}

/* Cas 1 : les boutons sont dans .acf-block-preview */
.acf-block-component.acf-block-body .acf-block-preview:hover .pib_edit_buttons {
  display: flex;
  flex-direction: row-reverse;
  gap: 1rem;
  width: fit-content;
}

/* Cas 2 : les boutons sont frères de .acf-block-preview */
.acf-block-component.acf-block-body:hover > div > .pib_edit_buttons {
  display: flex;
  flex-direction: row-reverse;
  gap: 1rem;
  width: fit-content;
}

/* Styles des boutons */
.pib_edit_buttons .pib_edit_button {
  background-color: white;
  border: solid 1px rgb(56, 56, 56);
  fill: rgb(56, 56, 56);
  color: rgb(56, 56, 56);
  padding: 1rem;
  transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  cursor: pointer;
}

.pib_edit_buttons .pib_edit_button:hover {
  fill: rgb(1, 120, 179);
}

/* Tooltip */
.pib_edit_buttons .pib_edit_button .infos {
  position: absolute;
  width: max-content;
  top: -2.75rem;
  right: 0;
  background-color: white;
  display: none;
  padding: 0.75rem;
  font-size: 0.75rem;
  border: solid 1px rgb(56, 56, 56);
}

.pib_edit_buttons .pib_edit_button:hover .infos {
  display: block;
}

/* PIB V2 */

.acf-block-body.acf-block-preview {
  position: relative;
}
.acf-block-body.acf-block-preview.is-hovered > .pib_edit_buttons,
.acf-block-body.acf-block-preview:hover > .pib_edit_buttons {
  display: flex;
  flex-direction: row-reverse;
  gap: 1rem;
  width: fit-content;
}
